[libvirt] [PATCH 0/7] QEMU network/bridge backed NIC hotplug

Mark McLoughlin markmc at redhat.com
Mon Jul 27 09:32:42 UTC 2009


On Mon, 2009-07-27 at 11:06 +0200, Daniel Veillard wrote:
> On Wed, Jul 22, 2009 at 10:57:29PM +0100, Mark McLoughlin wrote:
> > 
> > Hey,
> >         So, here are the patches needed to complete the QEMU NIC hotplug
> > work by supporting network and bridge backed interfaces.
> > 
> >         We support this by passing a tap file descriptor to qemu over
> > the monitor socket using SCM_RIGHTS.
> > 
> >         The monitor commands required for this (getfd and closefd) are
> > queued up in Anthony's queue and should be in qemu-0.11-rc1 which is due
> > to be released very soon:
> > 
> >   http://repo.or.cz/w/qemu/aliguori-queue.git?a=commitdiff;h=4edd6c2645
> >   http://repo.or.cz/w/qemu/aliguori-queue.git?a=commitdiff;h=f4069061e3
> > 
> >         Note: I just remembered I'm not handling missing support for
> > these commands very well. I'll make it handle an 'unknown command' reply
> > gracefully by failing the attach tommorrow.
> 
>   Yes that's my main uncertainty about this patch set, we assume the
> support is present and I don't see any detection code, can you send this
> quickly to finish the serie of patches ?

Yep, the below hunk is all we need - I'll squash it into 7/7

Thanks,
Mark.

diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 23cbd8f..d65a2a3 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -4684,6 +4684,16 @@ static int qemudDomainAttachNetDevice(virConnectPtr conn,
 
         DEBUG("%s: getfd reply: %s", vm->def->name, reply);
 
+        /* If the command isn't supported then qemu prints:
+         * unknown command: getfd" */
+        if (strstr(reply, "unknown command:")) {
+            qemudReportError(conn, dom, NULL, VIR_ERR_NO_SUPPORT,
+                             "%s",
+                             _("bridge/network interface attach not supported: "
+                               "qemu 'getfd' monitor command available"));
+            goto cleanup;
+        }
+
         VIR_FREE(reply);
         VIR_FREE(cmd);
     }





More information about the libvir-list mailing list