Skip to content

Commit

Permalink
s390x/s390-stattrib: Mark the storage attribute as not user_creatable
Browse files Browse the repository at this point in the history
The storage attribute devices are only meant to be instantiated one
time, internally. They can not be used by the user, so mark them with
user_creatable = false.

Suggested-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1503576029-24264-1-git-send-email-thuth@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
  • Loading branch information
huth authored and cohuck committed Aug 30, 2017
1 parent c862bdd commit 3ea6d20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hw/s390x/s390-stattrib-kvm.c
Expand Up @@ -164,6 +164,7 @@ static int kvm_s390_stattrib_get_active(S390StAttribState *sa)
static void kvm_s390_stattrib_class_init(ObjectClass *oc, void *data)
{
S390StAttribClass *sac = S390_STATTRIB_CLASS(oc);
DeviceClass *dc = DEVICE_CLASS(oc);

sac->get_stattr = kvm_s390_stattrib_get_stattr;
sac->peek_stattr = kvm_s390_stattrib_peek_stattr;
Expand All @@ -172,6 +173,9 @@ static void kvm_s390_stattrib_class_init(ObjectClass *oc, void *data)
sac->get_dirtycount = kvm_s390_stattrib_get_dirtycount;
sac->synchronize = kvm_s390_stattrib_synchronize;
sac->get_active = kvm_s390_stattrib_get_active;

/* Reason: Can only be instantiated one time (internally) */
dc->user_creatable = false;
}

static const TypeInfo kvm_s390_stattrib_info = {
Expand Down
4 changes: 4 additions & 0 deletions hw/s390x/s390-stattrib.c
Expand Up @@ -306,6 +306,7 @@ static int qemu_s390_get_active(S390StAttribState *sa)
static void qemu_s390_stattrib_class_init(ObjectClass *oc, void *data)
{
S390StAttribClass *sa_cl = S390_STATTRIB_CLASS(oc);
DeviceClass *dc = DEVICE_CLASS(oc);

sa_cl->synchronize = qemu_s390_synchronize_stub;
sa_cl->get_stattr = qemu_s390_get_stattr_stub;
Expand All @@ -314,6 +315,9 @@ static void qemu_s390_stattrib_class_init(ObjectClass *oc, void *data)
sa_cl->set_migrationmode = qemu_s390_set_migrationmode_stub;
sa_cl->get_dirtycount = qemu_s390_get_dirtycount_stub;
sa_cl->get_active = qemu_s390_get_active;

/* Reason: Can only be instantiated one time (internally) */
dc->user_creatable = false;
}

static const TypeInfo qemu_s390_stattrib_info = {
Expand Down

0 comments on commit 3ea6d20

Please sign in to comment.