]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: remove unreachable code in qemuProcessStart()
authorLaine Stump <laine@redhat.com>
Sat, 22 Aug 2020 21:43:24 +0000 (17:43 -0400)
committerLaine Stump <laine@redhat.com>
Tue, 25 Aug 2020 03:46:51 +0000 (23:46 -0400)
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 <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/qemu/qemu_process.c

index 126fabf5ef83b59d56109fb7cc9b31bbf1eab53c..832b2e68708c4bd34ac03b5ddffc5d8bf77df4bf 100644 (file)
@@ -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;