hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false
PATCH 1/1 hw/s390x/s390-skeys: Mark the storage key devices with user_creatable = false
QEMU currently aborts if the user tries to create a skey device:
$ s390x-softmmu/qemu-system-s390x -nographic -device s390-skeys-qemu qemu-system-s390x: hw/s390x/s390-skeys.c:30: s390_get_skeys_device: Assertion `ss' failed. Aborted (core dumped)
The storage key 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.
--- hw/s390x/s390-skeys-kvm.c | 4 ++++ hw/s390x/s390-skeys.c | 4 ++++ 2 files changed, 8 insertions(+)
hw/s390x/s390-skeys-kvm.c +4 -0
@@ -54,10 +54,14 @@ static int kvm_s390_skeys_set(S390SKeysState *ss, uint64_t start_gfn,static void kvm_s390_skeys_class_init (ObjectClass *oc,void *data) {S390SKeysClass *skeyclass =S390_SKEYS_CLASS (oc); +DeviceClass *dc =DEVICE_CLASS (oc); skeyclass->skeys_enabled = kvm_s390_skeys_enabled; skeyclass->get_skeys = kvm_s390_skeys_get; skeyclass->set_skeys = kvm_s390_skeys_set; + +/* Reason: Internal device (only one skeys device for the whole memory) */ + dc->user_creatable = false; }static const TypeInfo kvm_s390_skeys_info = {
hw/s390x/s390-skeys.c +4 -0
@@ -229,10 +229,14 @@ static int qemu_s390_skeys_get(S390SKeysState *ss, uint64_t start_gfn,static void qemu_s390_skeys_class_init (ObjectClass *oc,void *data) {S390SKeysClass *skeyclass =S390_SKEYS_CLASS (oc); +DeviceClass *dc =DEVICE_CLASS (oc); skeyclass->skeys_enabled = qemu_s390_skeys_enabled; skeyclass->get_skeys = qemu_s390_skeys_get; skeyclass->set_skeys = qemu_s390_skeys_set; + +/* Reason: Internal device (only one skeys device for the whole memory) */ + dc->user_creatable = false; }static const TypeInfo qemu_s390_skeys_info = {
Signature · 1 line
1.8.3.1
Quoted 56 lines · On Thu, 24 Aug 2017 12:08:48 +0200 Thomas Huth <[email protected]> wrote:
QEMU currently aborts if the user tries to create a skey device:
$ s390x-softmmu/qemu-system-s390x -nographic -device s390-skeys-qemu qemu-system-s390x: hw/s390x/s390-skeys.c:30: s390_get_skeys_device: Assertion `ss' failed. Aborted (core dumped)The storage key 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.Signed-off-by Thomas Huth <[email protected]>--- hw/s390x/s390-skeys-kvm.c | 4 ++++ hw/s390x/s390-skeys.c | 4 ++++ 2 files changed, 8 insertions(+)hw/s390x/s390-skeys-kvm.c +0
-0@@ -54,10 +54,14 @@ static int kvm_s390_skeys_set(S390SKeysState *ss,
uint64_tstart_gfn, static void kvm_s390_skeys_class_init(ObjectClass*oc, void *data) { S390SKeysClass *skeyclass = S390_SKEYS_CLASS(oc);hw/s390x/s390-skeys-kvm.c +3
-0+DeviceClass *dc =DEVICE_CLASS (oc); skeyclass->skeys_enabled = kvm_s390_skeys_enabled; skeyclass->get_skeys = kvm_s390_skeys_get; skeyclass->set_skeys = kvm_s390_skeys_set; + +/* Reason: Internal device (only one skeys device for the whole memory) */
hw/s390x/s390-skeys-kvm.c +1
-0+ dc->user_creatable = false; }static const TypeInfo kvm_s390_skeys_info = {hw/s390x/s390-skeys.c +3
-0@@ -229,10 +229,14 @@ static int qemu_s390_skeys_get(S390SKeysState *ss, uint64_t start_gfn, static voidqemu_s390_skeys_class_init (ObjectClass *oc,void *data) {S390SKeysClass *skeyclass =S390_SKEYS_CLASS (oc); +DeviceClass *dc =DEVICE_CLASS (oc); skeyclass->skeys_enabled = qemu_s390_skeys_enabled; skeyclass->get_skeys = qemu_s390_skeys_get; skeyclass->set_skeys = qemu_s390_skeys_set; + +/* Reason: Internal device (only one skeys device for the whole memory) */
+dc->user_creatable= false;
}
Quoted 1 line
static const TypeInfo
qemu_s390_skeys_info= {
we probably need something like this for the storage attributes device too
Quoted 46 lines · Thomas Huth
QEMU currently aborts if the user tries to create a skey device:
$ s390x-softmmu/qemu-system-s390x -nographic -device s390-skeys-qemu qemu-system-s390x: hw/s390x/s390-skeys.c:30: s390_get_skeys_device: Assertion `ss' failed. Aborted (core dumped)The storage key 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.Signed-off-by Thomas Huth <[email protected]>--- hw/s390x/s390-skeys-kvm.c | 4 ++++ hw/s390x/s390-skeys.c | 4 ++++ 2 files changed, 8 insertions(+)hw/s390x/s390-skeys-kvm.c +4
-0@@ -54,10 +54,14 @@ static int kvm_s390_skeys_set(S390SKeysState *ss, uint64_t start_gfn,static void kvm_s390_skeys_class_init (ObjectClass *oc,void *data) {S390SKeysClass *skeyclass =S390_SKEYS_CLASS (oc); +DeviceClass *dc =DEVICE_CLASS (oc); skeyclass->skeys_enabled = kvm_s390_skeys_enabled; skeyclass->get_skeys = kvm_s390_skeys_get; skeyclass->set_skeys = kvm_s390_skeys_set; + +/* Reason: Internal device (only one skeys device for the whole memory) */ + dc->user_creatable = false; }static const TypeInfo kvm_s390_skeys_info = {hw/s390x/s390-skeys.c +1
-0@@ -229,10 +229,14 @@ static int qemu_s390_skeys_get(S390SKeysState *ss, uint64_t start_gfn,static void qemu_s390_skeys_class_init (ObjectClass *oc,void *data) {S390SKeysClass *skeyclass =S390_SKEYS_CLASS (oc); +DeviceClass *dc =DEVICE_CLASS (oc);
hw/s390x/s390-skeys.c static int qemu_s390_skeys_get(S390SKeysState *ss, uint64_t start_gfn, · line 242
Quoted 10 lines
hw/s390x/s390-skeys.c +3
-0skeyclass->skeys_enabled = qemu_s390_skeys_enabled; skeyclass->get_skeys = qemu_s390_skeys_get; skeyclass->set_skeys = qemu_s390_skeys_set; + +/* Reason: Internal device (only one skeys device for the whole memory) */ + dc->user_creatable = false; }static const TypeInfo qemu_s390_skeys_info = {
Cornelia Huck
AppliedQuoted 11 lines · On Thu, 24 Aug 2017 12:08:48 +0200 Thomas Huth <[email protected]> wrote:
QEMU currently aborts if the user tries to create a skey device:
$ s390x-softmmu/qemu-system-s390x -nographic -device s390-skeys-qemu qemu-system-s390x: hw/s390x/s390-skeys.c:30: s390_get_skeys_device: Assertion `ss' failed. Aborted (core dumped)The storage key 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.
Quoted 5 lines
Signed-off-by Thomas Huth <[email protected]>--- hw/s390x/s390-skeys-kvm.c | 4 ++++ hw/s390x/s390-skeys.c | 4 ++++ 2 files changed, 8 insertions(+)
Thanks, applied.