From: Michal Privoznik Date: Thu, 6 Jun 2013 14:04:42 +0000 (+0200) Subject: qemuDomainMigrateGraphicsRelocate: Use then new virSocketAddrIsWildcard X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b72ba1da364a8f72aaba2f703dd84daf38b99dcc;p=libvirt.git qemuDomainMigrateGraphicsRelocate: Use then new virSocketAddrIsWildcard Since we have the new internal API to check for wildcard address, we can use it instead of parsing and formatting. --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index dec04a5620..ca79bc2afe 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1740,7 +1740,6 @@ qemuDomainMigrateGraphicsRelocate(virQEMUDriverPtr driver, int ret; char *listenAddress; virSocketAddr addr; - bool reformatted = false; if (!cookie) return 0; @@ -1756,23 +1755,10 @@ qemuDomainMigrateGraphicsRelocate(virQEMUDriverPtr driver, listenAddress = cookie->graphics->listen; - /* Okay, here's the magic: some mgmt applications set bare '0' as listen - * address. On the other hand, it's a valid IPv4 address. This means, we - * need to reformat the address so the if statement below can check just - * for two ANYCAST addresses and not all their variants. */ - if (listenAddress && - virSocketAddrParse(&addr, listenAddress, AF_UNSPEC) > 0) { - listenAddress = virSocketAddrFormat(&addr); - reformatted = true; - } - if (!listenAddress || - STREQ(listenAddress, "0.0.0.0") || - STREQ(listenAddress, "::")) { - if (reformatted) - VIR_FREE(listenAddress); + (virSocketAddrParse(&addr, listenAddress, AF_UNSPEC) > 0 && + virSocketAddrIsWildcard(&addr))) listenAddress = cookie->remoteHostname; - } ret = qemuDomainObjEnterMonitorAsync(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT);