qemu_domain: add a empty listen type address if we remove socket for VNC

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-05-19 09:35:02 +02:00
parent 5f29c53150
commit ed7683f4d6
2 changed files with 12 additions and 4 deletions

View File

@ -1995,7 +1995,7 @@ qemuCanonicalizeMachine(virDomainDefPtr def, virQEMUCapsPtr qemuCaps)
} }
static void static int
qemuDomainRecheckInternalPaths(virDomainDefPtr def, qemuDomainRecheckInternalPaths(virDomainDefPtr def,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
unsigned int flags) unsigned int flags)
@ -2008,12 +2008,17 @@ qemuDomainRecheckInternalPaths(virDomainDefPtr def,
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC && if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
graphics->data.vnc.socket && graphics->data.vnc.socket &&
STRPREFIX(graphics->data.vnc.socket, cfg->libDir)) { STRPREFIX(graphics->data.vnc.socket, cfg->libDir)) {
if (flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) if (flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) {
VIR_FREE(graphics->data.vnc.socket); VIR_FREE(graphics->data.vnc.socket);
if (virDomainGraphicsListenAppendAddress(graphics, NULL) < 0)
return -1;
}
else else
graphics->data.vnc.socketAutogenerated = true; graphics->data.vnc.socketAutogenerated = true;
} }
} }
return 0;
} }
@ -2066,7 +2071,8 @@ qemuDomainDefPostParse(virDomainDefPtr def,
qemuDomainDefEnableDefaultFeatures(def, qemuCaps); qemuDomainDefEnableDefaultFeatures(def, qemuCaps);
qemuDomainRecheckInternalPaths(def, cfg, parseFlags); if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0)
goto cleanup;
if (virSecurityManagerVerify(driver->securityManager, def) < 0) if (virSecurityManagerVerify(driver->securityManager, def) < 0)
goto cleanup; goto cleanup;

View File

@ -29,7 +29,9 @@
<controller type='pci' index='0' model='pci-root'/> <controller type='pci' index='0' model='pci-root'/>
<input type='mouse' bus='ps2'/> <input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/> <graphics type='vnc' port='-1' autoport='yes'>
<listen type='address'/>
</graphics>
<video> <video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/> <model type='cirrus' vram='16384' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>