]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: migration: Drop dead VNC cookie handling
authorCole Robinson <crobinso@redhat.com>
Wed, 13 Apr 2016 15:06:42 +0000 (11:06 -0400)
committerCole Robinson <crobinso@redhat.com>
Fri, 15 Apr 2016 11:54:49 +0000 (07:54 -0400)
The only caller of this code is:

    for (i = 0; i < dom->def->ngraphics; i++) {
       if (dom->def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
           if (!(mig->graphics =
                 qemuMigrationCookieGraphicsAlloc(driver, dom->def->graphics[i])))
               return -1;
           mig->flags |= QEMU_MIGRATION_COOKIE_GRAPHICS;
           break;
       }
    }

So this is never triggered for VNC, and in fact VNC has no support for
seamless migration anyways so that seems correct. Drop the dead VNC
handling.

src/qemu/qemu_migration.c

index b9e5fc2127b60dfa2303c7105bef05154f8dbc48..ecc0aae68ac3494e16bc07ca8bb8695daea49c96 100644 (file)
@@ -314,8 +314,8 @@ qemuDomainExtractTLSSubject(const char *certdir)
 #endif
 
 static qemuMigrationCookieGraphicsPtr
-qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver,
-                                 virDomainGraphicsDefPtr def)
+qemuMigrationCookieGraphicsSpiceAlloc(virQEMUDriverPtr driver,
+                                      virDomainGraphicsDefPtr def)
 {
     qemuMigrationCookieGraphicsPtr mig = NULL;
     const char *listenAddr;
@@ -326,33 +326,20 @@ qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver,
         goto error;
 
     mig->type = def->type;
-    if (mig->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
-        mig->port = def->data.vnc.port;
-
-        if (!gListen || !(listenAddr = gListen->address))
-            listenAddr = cfg->vncListen;
-
-#ifdef WITH_GNUTLS
-        if (cfg->vncTLS &&
-            !(mig->tlsSubject = qemuDomainExtractTLSSubject(cfg->vncTLSx509certdir)))
-            goto error;
-#endif
-    } else {
-        mig->port = def->data.spice.port;
-        if (cfg->spiceTLS)
-            mig->tlsPort = def->data.spice.tlsPort;
-        else
-            mig->tlsPort = -1;
+    mig->port = def->data.spice.port;
+    if (cfg->spiceTLS)
+        mig->tlsPort = def->data.spice.tlsPort;
+    else
+        mig->tlsPort = -1;
 
-        if (!gListen || !(listenAddr = gListen->address))
-            listenAddr = cfg->spiceListen;
+    if (!gListen || !(listenAddr = gListen->address))
+        listenAddr = cfg->spiceListen;
 
 #ifdef WITH_GNUTLS
-        if (cfg->spiceTLS &&
-            !(mig->tlsSubject = qemuDomainExtractTLSSubject(cfg->spiceTLSx509certdir)))
-            goto error;
+    if (cfg->spiceTLS &&
+        !(mig->tlsSubject = qemuDomainExtractTLSSubject(cfg->spiceTLSx509certdir)))
+        goto error;
 #endif
-    }
     if (VIR_STRDUP(mig->listen, listenAddr) < 0)
         goto error;
 
@@ -467,7 +454,8 @@ qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig,
     for (i = 0; i < dom->def->ngraphics; i++) {
        if (dom->def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
            if (!(mig->graphics =
-                 qemuMigrationCookieGraphicsAlloc(driver, dom->def->graphics[i])))
+                 qemuMigrationCookieGraphicsSpiceAlloc(driver,
+                                                       dom->def->graphics[i])))
                return -1;
            mig->flags |= QEMU_MIGRATION_COOKIE_GRAPHICS;
            break;