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(+)

diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
index 
4581cc5e5d4645ab3e358d983a633e33a214c425..37d7b3d68a98d88f201b9a297dbb18678ffdcec2
 100644
--- a/hw/ppc/pnv_i2c.c
+++ b/hw/ppc/pnv_i2c.c
@@ -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);
 }
 
-- 
2.44.0


Reply via email to