ppc/pnv: I2C controller is not user creatable
PATCH 1/1 ppc/pnv: I2C controller is not user creatable
The I2C controller is a subunit of the processor. Make it so and avoid QEMU crashes.
$ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed. Aborted (core dumped)
--- hw/ppc/pnv_i2c.c | 1 + 1 file changed, 1 insertion(+)
hw/ppc/pnv_i2c.c +1 -0
@@ -559,6 +559,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data) dc->desc ="PowerNV I2C" ; dc->realize = pnv_i2c_realize; + dc->user_creatable = false;device_class_set_props (dc, pnv_i2c_properties); }
Signature · 1 line
2.44.0
Quoted 19 lines · Cédric Le Goater
The I2C controller is a subunit of the processor. Make it so and avoid QEMU crashes.
$ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed. Aborted (core dumped)Cc Glenn Miles <[email protected]>Reported-by Thomas Huth <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>--- hw/ppc/pnv_i2c.c | 1 + 1 file changed, 1 insertion(+)hw/ppc/pnv_i2c.c +0
-0
hw/ppc/pnv_i2c.c static void pnv_i2c_class_init(ObjectClass *klass, void *data) · line 562
Quoted 4 lines
hw/ppc/pnv_i2c.c +1
-0@@ -559,6 +559,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data) dc->desc ="PowerNV I2C" ; dc->realize = pnv_i2c_realize; + dc->user_creatable = false;
Maybe add a comment in front of it (which is good style for setting user_creatable = false):
/* This device is part of the CPU and cannot be used separately */
or so.
Anyway:
Quoted 3 lines
hw/ppc/pnv_i2c.c +0
-0device_class_set_props (dc, pnv_i2c_properties); }
Quoted 6 lines · Cédric Le Goater
The I2C controller is a subunit of the processor. Make it so and avoid QEMU crashes.
$ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed. Aborted (core dumped)
and
Sorry for the noise,
C.
Quoted 19 lines
Cc Glenn Miles <[email protected]>Reported-by Thomas Huth <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>--- hw/ppc/pnv_i2c.c | 1 + 1 file changed, 1 insertion(+)hw/ppc/pnv_i2c.c +1
-0@@ -559,6 +559,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data) dc->desc ="PowerNV I2C" ; dc->realize = pnv_i2c_realize; + dc->user_creatable = false;device_class_set_props (dc, pnv_i2c_properties); }
Quoted 26 lines · Thomas Huth
Quoted 19 lines · Cédric Le Goater
The I2C controller is a subunit of the processor. Make it so and avoid QEMU crashes.
$ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed. Aborted (core dumped)Cc Glenn Miles <[email protected]>Reported-by Thomas Huth <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>---
hw/ppc/pnv_i2c.c| 1 +1 file changed, 1 insertion(+)hw/ppc/pnv_i2c.c +0
-0hw/ppc/pnv_i2c.c static void pnv_i2c_class_init(ObjectClass *klass, void *data) · line 561
Quoted 3 lines
hw/ppc/pnv_i2c.c +1
-0@@ -559,6 +559,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data) dc->desc = "PowerNV I2C"; dc->realize = pnv_i2c_realize; + dc->user_creatable = false;Maybe add a comment in front of it (which is good style for setting
user_creatable= false):
Quoted 3 lines
/* This device is part of the CPU and cannot be used separately */
or so.
ok. will resend.
Thanks,
C.
Quoted 7 lines
Anyway:
Reviewed-by Thomas Huth <[email protected]>Quoted 2 lines
hw/ppc/pnv_i2c.c +0
-0device_class_set_props(dc, pnv_i2c_properties); }