Blame SOURCES/kvm-vl-Fix-drive-blockdev-persistent-reservation-managem.patch

7711c0
From 4e62b63ba343036417b227a36a28f9cbf94bdf0c Mon Sep 17 00:00:00 2001
7711c0
From: Markus Armbruster <armbru@redhat.com>
7711c0
Date: Thu, 6 Jun 2019 12:12:44 +0200
7711c0
Subject: [PATCH 9/9] vl: Fix -drive / -blockdev persistent reservation
7711c0
 management
7711c0
7711c0
RH-Author: Markus Armbruster <armbru@redhat.com>
7711c0
Message-id: <20190606121244.23738-2-armbru@redhat.com>
7711c0
Patchwork-id: 88604
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 1/1] vl: Fix -drive / -blockdev persistent reservation management
7711c0
Bugzilla: 1714160
7711c0
RH-Acked-by: John Snow <jsnow@redhat.com>
7711c0
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
7711c0
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
7711c0
7711c0
qemu-system-FOO's main() acts on command line arguments in its own
7711c0
idiosyncratic order.  There's not much method to its madness.
7711c0
Whenever we find a case where one kind of command line argument needs
7711c0
to refer to something created for another kind later, we rejigger the
7711c0
order.
7711c0
7711c0
Recent commit cda4aa9a5a "vl: Create block backends before setting
7711c0
machine properties" was such a rejigger.  Block backends are now
7711c0
created before "delayed" objects.  This broke persistent reservation
7711c0
management.  Reproducer:
7711c0
7711c0
    $ qemu-system-x86_64 -object pr-manager-helper,id=pr-helper0,path=/tmp/pr-helper0.sock-drive -drive file=/dev/mapper/crypt,file.pr-manager=pr-helper0,format=raw,if=none,id=drive-scsi0-0-0-2
7711c0
    qemu-system-x86_64: -drive file=/dev/mapper/crypt,file.pr-manager=pr-helper0,format=raw,if=none,id=drive-scsi0-0-0-2: No persistent reservation manager with id 'pr-helper0'
7711c0
7711c0
The delayed pr-manager-helper object is created too late for use by
7711c0
-drive or -blockdev.  Normal objects are still created in time.
7711c0
7711c0
pr-manager-helper has always been a delayed object (commit 7c9e527659
7711c0
"scsi, file-posix: add support for persistent reservation
7711c0
management").  Turns out there's no real reason for that.  Make it a
7711c0
normal object.
7711c0
7711c0
Fixes: cda4aa9a5a08777cf13e164c0543bd4888b8adce
7711c0
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7711c0
Message-Id: <20190604151251.9903-2-armbru@redhat.com>
7711c0
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7711c0
Cc: qemu-stable@nongnu.org
7711c0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
7711c0
(cherry picked from commit 9ea18ed25a36527167e9676f25d983df5e7f76e6)
7711c0
[Straightforward conflict resolved]
7711c0
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 vl.c | 3 +--
7711c0
 1 file changed, 1 insertion(+), 2 deletions(-)
7711c0
7711c0
diff --git a/vl.c b/vl.c
7711c0
index 61247eb..5b337e1 100644
7711c0
--- a/vl.c
7711c0
+++ b/vl.c
7711c0
@@ -2926,8 +2926,7 @@ static int machine_set_property(void *opaque,
7711c0
  */
7711c0
 static bool object_create_initial(const char *type)
7711c0
 {
7711c0
-    if (g_str_equal(type, "rng-egd") ||
7711c0
-        g_str_has_prefix(type, "pr-manager-")) {
7711c0
+    if (g_str_equal(type, "rng-egd")) {
7711c0
         return false;
7711c0
     }
7711c0
 
7711c0
-- 
7711c0
1.8.3.1
7711c0