qemu: migration: Drop dead VNC cookie handling

Message ID 50e4600460941ebf38b93b0f8cf967a3af75a8a0.1460494834.git.crobinso@redhat.com
State New
Headers show

Commit Message

Cole Robinson April 12, 2016, 9 p.m.
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 | 34 +++++++++++-----------------------
 1 file changed, 11 insertions(+), 23 deletions(-)

-- 
2.7.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Cole Robinson April 15, 2016, 11:58 a.m. | #1
On 04/15/2016 04:07 AM, Peter Krempa wrote:
> On Tue, Apr 12, 2016 at 17:00:40 -0400, Cole Robinson wrote:

>> 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 | 34 +++++++++++-----------------------

>>  1 file changed, 11 insertions(+), 23 deletions(-)

>>

>> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c

>> index 8d2ca3b..ca3619d 100644

>> --- a/src/qemu/qemu_migration.c

>> +++ b/src/qemu/qemu_migration.c

>> @@ -320,33 +320,21 @@ qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver,

> 

> In that case this function should be called

> qemuMigrationCookieGraphicsSpiceAlloc.

> 

> ACK with that change.

> 


Renamed and pushed

Thanks,
Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Patch

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 8d2ca3b..ca3619d 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -320,33 +320,21 @@  qemuMigrationCookieGraphicsAlloc(virQEMUDriverPtr driver,
         goto error;
 
     mig->type = def->type;
-    if (mig->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
-        mig->port = def->data.vnc.port;
-        listenAddr = virDomainGraphicsListenGetAddress(def, 0);
-        if (!listenAddr)
-            listenAddr = cfg->vncListen;
+    mig->port = def->data.spice.port;
+    if (cfg->spiceTLS)
+        mig->tlsPort = def->data.spice.tlsPort;
+    else
+        mig->tlsPort = -1;
+    listenAddr = virDomainGraphicsListenGetAddress(def, 0);
+    if (!listenAddr)
+        listenAddr = cfg->spiceListen;
 
 #ifdef WITH_GNUTLS
-        if (cfg->vncTLS &&
-            !(mig->tlsSubject = qemuDomainExtractTLSSubject(cfg->vncTLSx509certdir)))
-            goto error;
+    if (cfg->spiceTLS &&
+        !(mig->tlsSubject = qemuDomainExtractTLSSubject(cfg->spiceTLSx509certdir)))
+        goto error;
 #endif
-    } else {
-        mig->port = def->data.spice.port;
-        if (cfg->spiceTLS)
-            mig->tlsPort = def->data.spice.tlsPort;
-        else
-            mig->tlsPort = -1;
-        listenAddr = virDomainGraphicsListenGetAddress(def, 0);
-        if (!listenAddr)
-            listenAddr = cfg->spiceListen;
 
-#ifdef WITH_GNUTLS
-        if (cfg->spiceTLS &&
-            !(mig->tlsSubject = qemuDomainExtractTLSSubject(cfg->spiceTLSx509certdir)))
-            goto error;
-#endif
-    }
     if (VIR_STRDUP(mig->listen, listenAddr) < 0)
         goto error;