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

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