From 85a687c6b2498cfb08b88bcf766ed3ce35ff3c9d Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 18 Feb 2016 18:27:13 +0100 Subject: [PATCH] qemu_process: mark auto-generated spice ports as reserved In case you will specify graphics like this: or libvirt will automatically add autoport='no'. This leads to an issue that in qemuProcessStop() we don't release that port because we are releasing both port if autoport=yes or only port marked as reserved. If autoport=no but we request to generate port via '-1' we need to mark that port as reserved in order to release it. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1299696 Signed-off-by: Pavel Hrdina --- src/qemu/qemu_process.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c5b9f4e6b2..e760182438 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3688,6 +3688,9 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver, goto error; graphics->data.spice.port = port; + + if (!graphics->data.spice.autoport) + graphics->data.spice.portReserved = true; } if (needTLSPort || graphics->data.spice.tlsPort == -1) { @@ -3702,6 +3705,9 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver, goto error; graphics->data.spice.tlsPort = tlsPort; + + if (!graphics->data.spice.autoport) + graphics->data.spice.tlsPortReserved = true; } return 0;