qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch 18/18] qemu: PCI device, disk and host network hot-add / hot-remove
Date: Wed, 4 Feb 2009 15:37:08 +0000	[thread overview]
Message-ID: <20090204153708.GF26946@redhat.com> (raw)
In-Reply-To: <4989B25F.6000100@codemonkey.ws>

On Wed, Feb 04, 2009 at 09:21:03AM -0600, Anthony Liguori wrote:
> Daniel P. Berrange wrote:
> >On Wed, Feb 04, 2009 at 11:33:21AM -0200, Marcelo Tosatti wrote:
> >  
> >>Add monitor command to hot-add PCI devices (nic and storage).
> >>    
> >>Syntax is:
> >>    
> >>pci_add pcibus nic|storage params
> >>    
> >>It returns the bus slot and function for the newly added device on 
> >>success.
> >>    
> >>It is possible to attach a disk to a device after PCI initialization via
> >>the drive_add command. If so, a manual scan of the SCSI bus on the guest
> >>is necessary.
> >>    
> >>Save QEMUMachine necessary for drive_init.
> >>    
> >>Add monitor command to hot-remove devices, remove device data on _EJ0 
> >>notification.
> >>    
> >
> >Does this allow for hot-add of host TAP devices passing a open
> >file descriptor across with SCM_RIGHTS (man 7 unix) on the UNIX
> >domain socket connection to the monitor ?   This ability is
> >critical for libvirt, because we need to be able to allocate the
> >TAP devices ourselves & do various configuration tasks before giving
> >them to QEMU - the external script capability isn't suitable /flexible
> >enough for this.
> >  
> 
> It doesn't support this today but additional patches to enable that are 
> certainly welcome.  The best way would be a generic mechanism to send a 
> file descriptor to QEMU that could then be used anywhere fd= is valid.  
> For instance:
> 
> (qemu) receivefd unix:foo.sock,server
> fd=5
> (qemu) closefd 5

I think this is a bit of an unpleasent way to interact. There should be no
need for the user of the monitor to know or care about the FD number
from QEMU's side. When running the 'host_net_add' command QEMU should be
able to see that it is being asked to use an FD, and automatically receive
it at this time. This avoids need for user of the monitor to run separate
commands, and worry about closing the FD if something fails in the 2nd
command, and avoids having to parse the receivefd command, and splice 
that into the next command. eg I'd expect that

 (qemu)  host_net_add  tap,fd=,vlan=9,ifname=vnet3

should see the empty 'fd=' arg and just 'do the right thing' by using 
SCM_RIGHTS to fetch the FD.

Or could we avoid the FD passing, and just rely on giving an 'ifname'
that already exists, and expect QEMU to open this existing named TAP
device ? Though there may be difficulties with transfering "ownership"
of the TAP device, to ensure it disappears when QEMU quits, rather
than when the monitor caller quits.

Regards,
Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

  reply	other threads:[~2009-02-04 16:28 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 13:33 [Qemu-devel] [patch 00/18] acpi pci hotplug support Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 01/18] qemu: add pci helper functions Marcelo Tosatti
2009-02-04 14:56   ` Paul Brook
2009-02-04 19:15     ` Anthony Liguori
2009-02-06 17:35       ` Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 02/18] qemu: return PCIDevice on net device init and record devfn Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 03/18] qemu: dynamic drive/drive_opt index allocation Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 04/18] qemu: dynamic nic info " Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 05/18] qemu: drive removal support Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 06/18] qemu: record devfn on block driver instance Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 07/18] qemu: move drives_opt for external use Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 08/18] qemu: net/drive add/remove tweaks Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 09/18] qemu: add net_client_uninit / qemu_find_vlan_client Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 10/18] qemu: add cpu_unregister_io_memory and make io mem table index dynamic Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 11/18] qemu: add qemu_free_irqs Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 12/18] qemu: add pci_unregister_device Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 13/18] qemu: warn if PCI region is not power of two Marcelo Tosatti
2009-02-04 14:38   ` Paul Brook
2009-02-06 17:34     ` Marcelo Tosatti
2009-02-08  6:08       ` malc
2009-02-08 17:20         ` Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 14/18] qemu: LSI SCSI and e1000 unregister callbacks Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 15/18] qemu: zero ioport_opaque on isa_unassign_ioport Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 16/18] qemu: initialize hot add system / acpi gpe Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 17/18] qemu: pci hotplug GPE support Marcelo Tosatti
2009-02-04 13:33 ` [Qemu-devel] [patch 18/18] qemu: PCI device, disk and host network hot-add / hot-remove Marcelo Tosatti
2009-02-04 14:38   ` Daniel P. Berrange
2009-02-04 15:21     ` Anthony Liguori
2009-02-04 15:37       ` Daniel P. Berrange [this message]
2009-02-04 15:59       ` Avi Kivity
2009-02-04 16:46         ` Anthony Liguori
2009-02-04 14:59   ` Paul Brook
2009-02-04 16:17   ` Markus Armbruster
2009-02-04 17:47   ` Blue Swirl

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=20090204153708.GF26946@redhat.com \
    --to=berrange@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=mtosatti@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).