On 8/24/20 6:30 PM, Daniel Henrique Barboza wrote:
On 8/23/20 1:51 AM, Laine Stump wrote:
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.
(NB: anyway, attempting to fend off accidental removal of some other
guest's nwfilter rules by carefully ordering all nwfilter teardowns to
happen "before tap device deletion" is a fruitless pursuit, because a
tap device could be deleted by the qemu process being terminated
external to libvirt, i.e. we must instead avoid re-using tap device
names. That is coming.)
Is it better for this patch to be pushed after "conf: properly clear out
autogenerated macvtap ..." then?
Nah, it's unreachable code in any case, so its removal is independent of
anything else.
Signed-off-by: Laine Stump <la...@redhat.com>
---
Reviewed-by: Daniel Henrique Barboza <danielhb...@gmail.com>
Thanks!