提交 446aebbc 编写于 作者: P Pavel Hrdina

qemu_process: separate graphics port reservation

Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 4a5f8669
......@@ -4348,12 +4348,10 @@ qemuProcessStartHook(virQEMUDriverPtr driver,
static int
qemuProcessSetupGraphics(virQEMUDriverPtr driver,
virDomainObjPtr vm)
qemuProcessGraphicsReservePorts(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
size_t i;
int ret = -1;
for (i = 0; i < vm->def->ngraphics; ++i) {
virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
......@@ -4362,7 +4360,7 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver,
if (virPortAllocatorSetUsed(driver->remotePorts,
graphics->data.vnc.port,
true) < 0)
goto cleanup;
return -1;
graphics->data.vnc.portReserved = true;
} else if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
......@@ -4371,7 +4369,7 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver,
if (virPortAllocatorSetUsed(driver->remotePorts,
graphics->data.spice.port,
true) < 0)
goto cleanup;
return -1;
graphics->data.spice.portReserved = true;
}
......@@ -4379,12 +4377,27 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver,
if (virPortAllocatorSetUsed(driver->remotePorts,
graphics->data.spice.tlsPort,
true) < 0)
goto cleanup;
return -1;
graphics->data.spice.tlsPortReserved = true;
}
}
}
return 0;
}
static int
qemuProcessSetupGraphics(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
size_t i;
int ret = -1;
if (qemuProcessGraphicsReservePorts(driver, vm) < 0)
goto cleanup;
for (i = 0; i < vm->def->ngraphics; ++i) {
virDomainGraphicsDefPtr graphics = vm->def->graphics[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册