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: Pavel Hrdina <phrdina@redhat.com>
qemuProcessGraphicsReservePorts(virQEMUDriverPtr driver,
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 &&
!graphics->data.vnc.autoport) {
if (virPortAllocatorSetUsed(driver->remotePorts,