
On Tue, Jan 19, 2016 at 01:39:41PM +0000, Richard W.M. Jones wrote: [...]
The problem with this theory is we are passing the VIR_DOMAIN_DESTROY_GRACEFUL flag, so that would indicate that this flag is buggy.
I think what we need is a test case, so here goes. Note you must run these steps as *non-root*.
(1) Download the attachment to /var/tmp
(2) chmod +x /var/tmp/qemu.sh
(3) killall libvirtd ;# kills the session libvirtd
(4) LIBGUESTFS_HV=/var/tmp/qemu.sh guestfish -N fs exit -vx
You should see at the end of the output:
libguestfs: calling virDomainDestroy "guestfs-q94hsiz89t8jp418" flags=VIR_DOMAIN_DESTROY_GRACEFUL [pause of a few seconds] libguestfs: error: could not destroy libvirt domain: Failed to terminate process 11412 with SIGTERM: Device or resource busy [code=38 domain=0]
If someone else can reproduce this, then I will file a bug.
Yep, I could perfectly reproduce your test case (thanks for constructing that): $ LIBGUESTFS_HV=/var/tmp/qemu.sh guestfish -N fs exit -vx [...] fsync /dev/sda guestfsd: main_loop: proc 282 (internal_autosync) took 0.00 seconds libguestfs: trace: internal_autosync = 0 libguestfs: calling virDomainDestroy "guestfs-liimlnged1e23l0l" flags=VIR_DOMAIN_DESTROY_GRACEFUL libguestfs: error: could not destroy libvirt domain: Failed to terminate process 27718 with SIGTERM: Device or resource busy [code=38 domain=0] libguestfs: trace: shutdown = -1 (error) libguestfs: trace: close [...] Upstream OpenStack Nova employs a similar suggestion (calling the virDomainDestroy() API about 3 more times) proposed by Dan in this thread: http://git.openstack.org/cgit/openstack/nova/commit/?id=3907867 -- libvirt: handle code=38 + sigkill (ebusy) in destroy() -- /kashyap