From: Laine Stump Date: Sat, 22 Aug 2020 21:43:24 +0000 (-0400) Subject: qemu: remove unreachable code in qemuProcessStart() X-Git-Tag: v6.7.0-rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cad64ec0300a3b8995bb6bf98b5845436a46187;p=thirdparty%2Flibvirt.git qemu: remove unreachable code in qemuProcessStart() Back when the original version of this chunk of code was added (commit 41b087198 in libvirt-0.8.1 in April 2010), we used virExecDaemonize() to start the qemu process, and would continue on in the function (which at that time was called qemudStartVMDaemon()) even if a -1 was returned. So it was possible to get to this code with rv == -1 (it was called "ret" in that version of the code). In modern libvirt code, qemu is started with virCommandRun(); then we call virPidFileReadPath(); those are the only two ways of setting "rv" prior to this code being removed, and in either case if the new value of rv < 0, then we immediately skip over the rest of the code to the cleanup: label. This means that the code being removed by this patch is unreachable. Signed-off-by: Laine Stump Reviewed-by: Daniel Henrique Barboza --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 126fabf5ef..832b2e6870 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6907,12 +6907,6 @@ qemuProcessLaunch(virConnectPtr conn, goto cleanup; VIR_DEBUG("Handshake complete, child running"); - if (rv == -1) { - /* The VM failed to start; tear filters before taps */ - virDomainConfVMNWFilterTeardown(vm); - goto cleanup; - } - if (qemuDomainObjStartWorker(vm) < 0) goto cleanup;