]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Move qemuExtDevicesStop() before removing the pidfiles
authorMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Wed, 11 Nov 2020 13:35:24 +0000 (08:35 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 11 Nov 2020 14:20:12 +0000 (15:20 +0100)
commit5cde9dee8c70b17c458d031ab6cf71dce476eea2
tree4399fbf14e56dca2114892d74b3d847a0bfe54bf
parentbd154804b2ac25c430271dffc4c53cbc0076bfa0
qemu: Move qemuExtDevicesStop() before removing the pidfiles

A qemu guest which has virtiofs config fails to start if the previous
starting failed because of invalid option or something.

That's because the virtiofsd isn't killed by virPidFileForceCleanupPath()
on the former failure because the pidfile was already removed by
virFileDeleteTree(priv->libDir) in qemuProcessStop(), so
virPidFileForceCleanupPath() just returned.

Move qemuExtDevicesStop() before virFileDeleteTree(priv->libDir) so that
virPidFileForceCleanupPath() can kill virtiofsd correctly.

For example of the reproduction:

  # virsh start guest
  error: Failed to start domain guest
  error: internal error: process exited while connecting to monitor: qemu-system-x86_64: -foo: invalid option

  ... fix the option ...

  # virsh start guest
  error: Failed to start domain guest
  error: Cannot open log file: '/var/log/libvirt/qemu/guest-fs0-virtiofsd.log': Device or resource busy
  #

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c