提交 be51dcb8 编写于 作者: P Pavel Hrdina

qemu_process: graphics: reserve port only if listen type is address or network

Ports are valid only for listen types 'address' and 'network', other listen
types doesn't use them so we should not try to reserve any ports.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 f6a8df41
...@@ -4011,6 +4011,17 @@ static int ...@@ -4011,6 +4011,17 @@ static int
qemuProcessGraphicsReservePorts(virQEMUDriverPtr driver, qemuProcessGraphicsReservePorts(virQEMUDriverPtr driver,
virDomainGraphicsDefPtr graphics) virDomainGraphicsDefPtr graphics)
{ {
virDomainGraphicsListenDefPtr glisten;
if (graphics->nListens <= 0)
return 0;
glisten = &graphics->listens[0];
if (glisten->type != VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS &&
glisten->type != VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK)
return 0;
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC && if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
!graphics->data.vnc.autoport) { !graphics->data.vnc.autoport) {
if (virPortAllocatorSetUsed(driver->remotePorts, if (virPortAllocatorSetUsed(driver->remotePorts,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册