On 10/12/20 3:33 PM, Paolo Bonzini wrote: > From: Maxim Levitsky <mlevi...@redhat.com> > > This fixes the race between device emulation code that tries to find > a child device to dispatch the request to (e.g a scsi disk), > and hotplug of a new device to that bus. > > Note that this doesn't convert all the readers of the list > but only these that might go over that list without BQL held. > > This is a very small first step to make this code thread safe. > > Suggested-by: Paolo Bonzini <pbonz...@redhat.com> > Signed-off-by: Maxim Levitsky <mlevi...@redhat.com> > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> > Message-Id: <20200913160259.32145-5-mlevi...@redhat.com> > [Use RCU_READ_LOCK_GUARD in more places, adjust testcase now that > the delay in DEVICE_DELETED due to RCU is more consistent. - Paolo] > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > Message-Id: <20201006123904.610658-9-mlevi...@redhat.com> > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
Git bisect lands on this commit as the reason that iotest 240 is failing: --- /home/eblake/qemu-tmp2/tests/qemu-iotests/240.out 2020-10-23 10:47:02.268392745 -0500 +++ /home/eblake/qemu-tmp2/build/tests/qemu-iotests/240.out.bad 2020-10-27 14:27:38.417188285 -0500 @@ -10,10 +10,10 @@ {"return": {}} {"return": {}} {"return": {}} +{"error": {"class": "GenericError", "desc": "Duplicate ID 'scsi-hd0' for device"}} +{"error": {"class": "DeviceNotFound", "desc": "Device 'scsi-hd0' not found"}} {"return": {}} -{"return": {}} -{"return": {}} -{"return": {}} +{"error": {"class": "GenericError", "desc": "Node hd0 is in use"}} {"return": {}} === Attach two SCSI disks using the same block device and the same iothread === @@ -29,7 +29,7 @@ {"return": {}} {"return": {}} {"return": {}} -{"return": {}} +{"error": {"class": "GenericError", "desc": "Node hd0 is in use"}} {"return": {}} === Attach two SCSI disks using the same block device but different iothreads === @@ -45,8 +45,8 @@ {"return": {}} {"error": {"class": "GenericError", "desc": "Cannot change iothread of active block backend"}} {"return": {}} -{"return": {}} -{"return": {}} +{"error": {"class": "GenericError", "desc": "Cannot change iothread of active block backend"}} +{"error": {"class": "DeviceNotFound", "desc": "Device 'scsi-hd1' not found"}} {"return": {}} {"return": {}} {"return": {}} Failures: 240 Failed 1 of 1 iotests -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org