|
From: | Paolo Bonzini |
Subject: | Re: [PULL 31/38] device-core: use RCU for list of children of a bus |
Date: | Tue, 27 Oct 2020 20:48:41 +0100 |
On 10/12/20 3:33 PM, Paolo Bonzini wrote:
> From: Maxim Levitsky <mlevitsk@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 <pbonzini@redhat.com>
> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Message-Id: <20200913160259.32145-5-mlevitsk@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 <pbonzini@redhat.com>
> Message-Id: <20201006123904.610658-9-mlevitsk@redhat.com" target="_blank" rel="noreferrer">20201006123904.610658-9-mlevitsk@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@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
[Prev in Thread] | Current Thread | [Next in Thread] |