Blame SOURCES/kvm-hw-s390x-Mark-the-sclpquiesce-device-with-user_creat.patch

4a2fec
From b4f105203964676facfa604594dcae3e43ee7aa0 Mon Sep 17 00:00:00 2001
4a2fec
From: Thomas Huth <thuth@redhat.com>
4a2fec
Date: Mon, 9 Oct 2017 12:32:45 +0200
4a2fec
Subject: [PATCH 26/34] hw/s390x: Mark the "sclpquiesce" device with
4a2fec
 user_creatable = false
4a2fec
4a2fec
RH-Author: Thomas Huth <thuth@redhat.com>
4a2fec
Message-id: <1507552368-9245-10-git-send-email-thuth@redhat.com>
4a2fec
Patchwork-id: 77026
4a2fec
O-Subject: [RHEL-7.5 qemu-kvm-ma PATCH 09/12] hw/s390x: Mark the "sclpquiesce" device with user_creatable = false
4a2fec
Bugzilla: 1492033
4a2fec
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
4a2fec
RH-Acked-by: David Gibson <dgibson@redhat.com>
4a2fec
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
4a2fec
The "sclpquiesce" device is just an internal device that should not be
4a2fec
created by the user directly. Though it currently does not seem to cause
4a2fec
any obvious trouble when the user instantiates an additional device, let's
4a2fec
better mark it with user_creatable = false to avoid unexpected behavior,
4a2fec
e.g. because the quiesce notifier gets registered multiple times.
4a2fec
4a2fec
Signed-off-by: Thomas Huth <thuth@redhat.com>
4a2fec
Message-Id: <1507193105-15627-1-git-send-email-thuth@redhat.com>
4a2fec
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
4a2fec
Reviewed-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
4a2fec
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4a2fec
(cherry picked from commit b923ab3112ed5ab47c2ff35776f17ab54c60d651)
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 hw/s390x/sclpquiesce.c | 7 ++++++-
4a2fec
 1 file changed, 6 insertions(+), 1 deletion(-)
4a2fec
4a2fec
diff --git a/hw/s390x/sclpquiesce.c b/hw/s390x/sclpquiesce.c
4a2fec
index 762cb18..0241643 100644
4a2fec
--- a/hw/s390x/sclpquiesce.c
4a2fec
+++ b/hw/s390x/sclpquiesce.c
4a2fec
@@ -118,8 +118,13 @@ static void quiesce_class_init(ObjectClass *klass, void *data)
4a2fec
     dc->reset = quiesce_reset;
4a2fec
     dc->vmsd = &vmstate_sclpquiesce;
4a2fec
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
4a2fec
-    k->init = quiesce_init;
4a2fec
+    /*
4a2fec
+     * Reason: This is just an internal device - the notifier should
4a2fec
+     * not be registered multiple times in quiesce_init()
4a2fec
+     */
4a2fec
+    dc->user_creatable = false;
4a2fec
 
4a2fec
+    k->init = quiesce_init;
4a2fec
     k->get_send_mask = send_mask;
4a2fec
     k->get_receive_mask = receive_mask;
4a2fec
     k->can_handle_event = can_handle_event;
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec