qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Christoph Hellwig <chellwig@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] RFC v2: blockdev_add & friends, brief rationale, QMP docs
Date: Wed, 16 Jun 2010 12:50:06 +0300	[thread overview]
Message-ID: <4C189E4E.5030503@redhat.com> (raw)
In-Reply-To: <m3ljagjqh7.fsf@blackfin.pond.sub.org>

On 06/15/2010 05:54 PM, Markus Armbruster wrote:
> Avi Kivity<avi@redhat.com>  writes:
>
>    
>> On 06/15/2010 04:27 PM, Markus Armbruster wrote:
>>      
>>>        
>>>> I'm only talking about the interface, not the implementation.
>>>> Internal design details shouldn't be exposed.
>>>>
>>>> For the implementation, I imagine you can create an empty blockdev
>>>> during guest device creation and treat blockdev_add/blockdev_del as
>>>> media change/eject.
>>>>
>>>>          
>>> If blockdev_del only ejects media, then we need another command to get
>>> rid of a blockdev.
>>>
>>>        
>> No.  If you have a blockdev just to satisfy the guest device's need
>> for a blockdev pointer, you can delete it automatically when the last
>> reference goes.
>>      
> That's not how netdev and chardev behave.
>    

Ok.  To me duplicate argument lists suggest a lack of orthogonality, though.

How about

   blockdev_add id=...
   media_attach blockdev=..., media-parameters
   media_detach blockdev=...
   blockdev_del id=...

So blockdev_add/del define/remove a slot for the media, 
media_attach/detach connect it to media.

>>> Unless you propose that blockdev_del merely ejects media if the blockdev
>>> is being used by a device, but destroys the blockdev outright if not.
>>> But that would be sick, wouldn't it?
>>>
>>>        
>> Create a blockdev implicitly with guest device creation, and use
>> blockdev_add (or media_attach) to attach the media.
>>
>> (but that creates a window where the guest device is visible but media
>> is not yet inserted?)
>>      
> Think so, for hot plug.
>
> Actually, the device model driver would reject an empty blockdev, unless
> it's a device with removable media, such as a CD-ROM.
>
> Having a device with fixed media go through a "no media yet" state
> during initialization just complicates things.  Defining the media
> *before* creating the device is much simpler.
>    

That is true.  Maybe we should just ignore the duplication.

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2010-06-16  9:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10 17:45 [Qemu-devel] RFC v2: blockdev_add & friends, brief rationale, QMP docs Markus Armbruster
2010-06-15  9:04 ` Avi Kivity
2010-06-15 12:23   ` Markus Armbruster
2010-06-15 12:43     ` Avi Kivity
2010-06-15 13:27       ` Markus Armbruster
2010-06-15 13:40         ` Avi Kivity
2010-06-15 14:54           ` Markus Armbruster
2010-06-16  9:50             ` Avi Kivity [this message]
2010-06-16 11:02               ` Markus Armbruster
2010-06-16 11:06                 ` Avi Kivity
2010-06-15 13:44 ` [Qemu-devel] " Avi Kivity
2010-06-15 14:39   ` Gerd Hoffmann
2010-06-16 11:20   ` Kevin Wolf
2010-06-16 12:41     ` Markus Armbruster
2010-06-16 13:41       ` Anthony Liguori
2010-06-16 13:57         ` Kevin Wolf
2010-06-16 14:24           ` Christoph Hellwig
2010-06-16 14:47             ` Markus Armbruster
2010-06-16 18:07           ` Anthony Liguori
2010-06-17  8:20             ` Kevin Wolf
2010-06-17 13:01               ` Anthony Liguori
2010-06-17 14:15                 ` Kevin Wolf
2010-06-18  8:20                   ` Markus Armbruster
2010-06-18  9:36                     ` Kevin Wolf
2010-06-18  7:06                 ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C189E4E.5030503@redhat.com \
    --to=avi@redhat.com \
    --cc=armbru@redhat.com \
    --cc=chellwig@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).