[libvirt] [PATCH 05/16] Wire up SPICE client relocation with QEMU migration

Eric Blake eblake at redhat.com
Thu May 12 03:06:08 UTC 2011


On 05/11/2011 03:09 AM, Daniel P. Berrange wrote:
> Use the graphics information from the QEMU migration cookie to
> issue a 'client_migrate_info' monitor command to QEMU. This causes
> the SPICE client to automatically reconnect to the target host
> when migration completes
> 
> * src/qemu/qemu_migration.c: Set data for SPICE client relocation
>   before starting migration on src
> * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
>   src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
>   src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
>   new qemuMonitorGraphicsRelocate() command
> ---
>  
> +static int
> +qemuDomainMigrateGraphicsRelocate(struct qemud_driver *driver,
> +                                  virDomainObjPtr vm,
> +                                  qemuMigrationCookiePtr cookie)
> +{
> +    qemuDomainObjPrivatePtr priv = vm->privateData;
> +    int ret;
> +
> +    if (!cookie)
> +        return 0;
> +
> +    if (!cookie->graphics)
> +        return 0;
> +
> +    /* QEMU doesnt' support VNC relocation yet, so

s/doesnt'/doesn't/

> @@ -1129,6 +1162,9 @@ static int doNativeMigrate(struct qemud_driver *driver,
>                                         QEMU_MIGRATION_COOKIE_GRAPHICS)))
>          goto cleanup;
>  
> +    if (qemuDomainMigrateGraphicsRelocate(driver, vm, mig) < 0)
> +        VIR_WARN0("unable to provide data for graphics client relocation");

More rebasing fun.

> +{
> +    int ret;
> +    VIR_DEBUG("mon=%p type=%d hostname=%s port=%d tlsPort=%d tlsSubject=%s",
> +              mon, type, hostname, port, tlsPort, NULLSTR(tlsSubject));
> +
> +    if (mon->json)
> +        ret = qemuMonitorJSONGraphicsRelocate(mon,
> +                                              type,
> +                                              hostname,
> +                                              port,
> +                                              tlsPort,
> +                                             tlsSubject);

Indentation.

ACK with this squashed in:

diff --git i/src/qemu/qemu_migration.c w/src/qemu/qemu_migration.c
index 6fa21be..99b5116 100644
--- i/src/qemu/qemu_migration.c
+++ w/src/qemu/qemu_migration.c
@@ -754,7 +754,7 @@ qemuDomainMigrateGraphicsRelocate(struct
qemud_driver *driver,
     if (!cookie->graphics)
         return 0;

-    /* QEMU doesnt' support VNC relocation yet, so
+    /* QEMU doesn't support VNC relocation yet, so
      * skip it to avoid generating an error
      */
     if (cookie->graphics->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE)
@@ -1163,7 +1163,7 @@ static int doNativeMigrate(struct qemud_driver
*driver,
         goto cleanup;

     if (qemuDomainMigrateGraphicsRelocate(driver, vm, mig) < 0)
-        VIR_WARN0("unable to provide data for graphics client relocation");
+        VIR_WARN("unable to provide data for graphics client relocation");

     /* Issue the migrate command. */
     if (STRPREFIX(uri, "tcp:") && !STRPREFIX(uri, "tcp://")) {
diff --git i/src/qemu/qemu_monitor.c w/src/qemu/qemu_monitor.c
index 7e0e46e..15c6cab 100644
--- i/src/qemu/qemu_monitor.c
+++ w/src/qemu/qemu_monitor.c
@@ -1638,7 +1638,7 @@ int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
                                               hostname,
                                               port,
                                               tlsPort,
-                                             tlsSubject);
+                                              tlsSubject);
     else
         ret = qemuMonitorTextGraphicsRelocate(mon,
                                               type,


-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110511/d0e5d66c/attachment-0001.sig>


More information about the libvir-list mailing list