[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context re
From: |
Eric Blake |
Subject: |
Re: [PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context requirements |
Date: |
Fri, 13 Dec 2019 14:59:33 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 12/9/19 10:06 AM, Kevin Wolf wrote:
Am 28.11.2019 um 11:41 hat Sergio Lopez geschrieben:
bdrv_try_set_aio_context() requires that the old context is held, and
the new context is not held. Fix all the occurrences where it's not
done this way.
Suggested-by: Max Reitz <address@hidden>
Signed-off-by: Sergio Lopez <address@hidden>
---
Or in fact, I think you need to hold the AioContext of a bs to
bdrv_unref() it, so maybe 'goto out' is right, but you need to unref
target_bs while you still hold old_context.
I suspect https://bugzilla.redhat.com/show_bug.cgi?id=1779036 is also a
symptom of this. The v5 patch did not fix this simple test case:
$ qemu-img create -f qcow2 f1 100m
$ qemu-img create -f qcow2 f2 100m
$ ./qemu-kvm -nodefaults -nographic -qmp stdio -object iothread,id=io0 \
-drive driver=qcow2,id=drive1,file=f1,if=none -device
virtio-scsi-pci,id=scsi0,iothread=io0 -device
scsi-hd,id=image1,drive=drive1 \
-drive driver=qcow2,id=drive2,file=f2,if=none -device
virtio-blk-pci,id=image2,drive=drive2,iothread=io0
{'execute':'qmp_capabilities'}
{'execute':'transaction','arguments':{'actions':[
{'type':'blockdev-snapshot-sync','data':{'device':'drive1',
'snapshot-file':'sn1','mode':'absolute-paths','format':'qcow2'}},
{'type':'blockdev-snapshot-sync','data':{'device':'drive2',
'snapshot-file':'/aa/sn1','mode':'absolute-paths','format':'qcow2'}}]}}
which is an aio context bug somewhere on the error path of
blockdev-snapshot-sync (the first one has to be rolled back because the
second part of the transaction fails early on a nonexistent directory)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
Re: [PATCH v5 4/4] blockdev: honor bdrv_try_set_aio_context() context requirements, Sergio Lopez, 2019/12/18