aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-03-23 16:49:23 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-03-23 16:49:23 +0000
commitae3845efb306819f4c2693f64ed761c4ce5cd8e9 (patch)
tree235a854d4434ebe634a8a99a0e1a46d440cc602e
parent9950da284fa5e2ea9ab57d87e05b693fb60c79ce (diff)
parentb807ca3fa0ca29ec015adcf4045e716337cd3635 (diff)
Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20210323' into staging
Xen patch - Fix Xen backend block detach via xenstore. # gpg: Signature made Tue 23 Mar 2021 11:53:08 GMT # gpg: using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF # gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal] # gpg: aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 5379 2F71 024C 600F 778A 7161 D8D5 7199 DF83 42C8 # Subkey fingerprint: F80C 0063 08E2 2CFD 8A92 E798 0CF5 572F D7FB 55AF * remotes/aperard/tags/pull-xen-20210323: xen-block: Fix removal of backend instance via xenstore Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/block/xen-block.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index ac82d54063..83754a4344 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -972,6 +972,15 @@ static void xen_block_device_destroy(XenBackendInstance *backend,
object_unparent(OBJECT(xendev));
+ /*
+ * Drain all pending RCU callbacks as object_unparent() frees `xendev'
+ * in a RCU callback.
+ * And due to the property "drive" still existing in `xendev', we
+ * can't destroy the XenBlockDrive associated with `xendev' with
+ * xen_block_drive_destroy() below.
+ */
+ drain_call_rcu();
+
if (iothread) {
xen_block_iothread_destroy(iothread, errp);
if (*errp) {