Blame SOURCES/kvm-s390x-s390-stattrib-Mark-the-storage-attribute-as-no.patch

4a2fec
From 69504b264f7272d31814d928ffbd9d01661ec62a Mon Sep 17 00:00:00 2001
4a2fec
From: Thomas Huth <thuth@redhat.com>
4a2fec
Date: Mon, 9 Oct 2017 12:32:41 +0200
4a2fec
Subject: [PATCH 22/34] s390x/s390-stattrib: Mark the storage attribute as not
4a2fec
 user_creatable
4a2fec
4a2fec
RH-Author: Thomas Huth <thuth@redhat.com>
4a2fec
Message-id: <1507552368-9245-6-git-send-email-thuth@redhat.com>
4a2fec
Patchwork-id: 77022
4a2fec
O-Subject: [RHEL-7.5 qemu-kvm-ma PATCH 05/12] s390x/s390-stattrib: Mark the storage attribute as not user_creatable
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 storage attribute devices are only meant to be instantiated one
4a2fec
time, internally. They can not be used by the user, so mark them with
4a2fec
user_creatable = false.
4a2fec
4a2fec
Suggested-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
4a2fec
Signed-off-by: Thomas Huth <thuth@redhat.com>
4a2fec
Message-Id: <1503576029-24264-1-git-send-email-thuth@redhat.com>
4a2fec
Reviewed-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
4a2fec
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
4a2fec
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4a2fec
(cherry picked from commit 3ea6d20e0baacb4a1211ed0ea57db14e2fc927ce)
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 hw/s390x/s390-stattrib-kvm.c | 4 ++++
4a2fec
 hw/s390x/s390-stattrib.c     | 4 ++++
4a2fec
 2 files changed, 8 insertions(+)
4a2fec
4a2fec
diff --git a/hw/s390x/s390-stattrib-kvm.c b/hw/s390x/s390-stattrib-kvm.c
4a2fec
index ff3f89f..bc0274d 100644
4a2fec
--- a/hw/s390x/s390-stattrib-kvm.c
4a2fec
+++ b/hw/s390x/s390-stattrib-kvm.c
4a2fec
@@ -163,6 +163,7 @@ static int kvm_s390_stattrib_get_active(S390StAttribState *sa)
4a2fec
 static void kvm_s390_stattrib_class_init(ObjectClass *oc, void *data)
4a2fec
 {
4a2fec
     S390StAttribClass *sac = S390_STATTRIB_CLASS(oc);
4a2fec
+    DeviceClass *dc = DEVICE_CLASS(oc);
4a2fec
 
4a2fec
     sac->get_stattr = kvm_s390_stattrib_get_stattr;
4a2fec
     sac->peek_stattr = kvm_s390_stattrib_peek_stattr;
4a2fec
@@ -171,6 +172,9 @@ static void kvm_s390_stattrib_class_init(ObjectClass *oc, void *data)
4a2fec
     sac->get_dirtycount = kvm_s390_stattrib_get_dirtycount;
4a2fec
     sac->synchronize = kvm_s390_stattrib_synchronize;
4a2fec
     sac->get_active = kvm_s390_stattrib_get_active;
4a2fec
+
4a2fec
+    /* Reason: Can only be instantiated one time (internally) */
4a2fec
+    dc->user_creatable = false;
4a2fec
 }
4a2fec
 
4a2fec
 static const TypeInfo kvm_s390_stattrib_info = {
4a2fec
diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c
4a2fec
index d14923f..f75548e 100644
4a2fec
--- a/hw/s390x/s390-stattrib.c
4a2fec
+++ b/hw/s390x/s390-stattrib.c
4a2fec
@@ -306,6 +306,7 @@ static int qemu_s390_get_active(S390StAttribState *sa)
4a2fec
 static void qemu_s390_stattrib_class_init(ObjectClass *oc, void *data)
4a2fec
 {
4a2fec
     S390StAttribClass *sa_cl = S390_STATTRIB_CLASS(oc);
4a2fec
+    DeviceClass *dc = DEVICE_CLASS(oc);
4a2fec
 
4a2fec
     sa_cl->synchronize = qemu_s390_synchronize_stub;
4a2fec
     sa_cl->get_stattr = qemu_s390_get_stattr_stub;
4a2fec
@@ -314,6 +315,9 @@ static void qemu_s390_stattrib_class_init(ObjectClass *oc, void *data)
4a2fec
     sa_cl->set_migrationmode = qemu_s390_set_migrationmode_stub;
4a2fec
     sa_cl->get_dirtycount = qemu_s390_get_dirtycount_stub;
4a2fec
     sa_cl->get_active = qemu_s390_get_active;
4a2fec
+
4a2fec
+    /* Reason: Can only be instantiated one time (internally) */
4a2fec
+    dc->user_creatable = false;
4a2fec
 }
4a2fec
 
4a2fec
 static const TypeInfo qemu_s390_stattrib_info = {
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec