qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH] hw/misc/auxbus.c: Mark the aux-to-i2c-bridge devi


From: KONRAD Frederic
Subject: Re: [Qemu-arm] [PATCH] hw/misc/auxbus.c: Mark the aux-to-i2c-bridge device as non-hotpluggable
Date: Tue, 22 Aug 2017 20:15:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Hi Thomas,

Looking to this seems there is a second issue:
The aux-to-i2c-bridge device should connect on a TYPE_AUX_BUS.

I don't think there isn't any on integratorcp..

Anyway the patch you sent fix this issue indirectly and as far as
I remember I wasn't able to make this I2C bridge an
TYPE_AUX_DEVICE as it's a special device and it is internal (only instantiated at the bus creation).

Thanks,
Fred

On 08/22/2017 05:06 PM, Thomas Huth wrote:
QEMU currently aborts if the user tries to do something like this:

$ aarch64-softmmu/qemu-system-aarch64 -S -M integratorcp -nographic
QEMU 2.9.93 monitor - type 'help' for more information
(qemu) device_add aux-to-i2c-bridge,id=x
(qemu) device_del x
**
ERROR:qemu/qdev-monitor.c:872:qdev_unplug: assertion failed: (hotplug_ctrl)
Aborted (core dumped)

Looks like the device is not hot-pluggable, so let's mark it
accordingly.

Signed-off-by: Thomas Huth <address@hidden>
---
  hw/misc/auxbus.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c
index 8a90ddd..2c62515 100644
--- a/hw/misc/auxbus.c
+++ b/hw/misc/auxbus.c
@@ -222,9 +222,17 @@ static inline I2CBus *aux_bridge_get_i2c_bus(AUXTOI2CState 
*bridge)
      return bridge->i2c_bus;
  }
+static void aux_bridge_class_init(ObjectClass *oc, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(oc);
+
+    dc->hotpluggable = false;
+}
+
  static const TypeInfo aux_to_i2c_type_info = {
      .name = TYPE_AUXTOI2C,
      .parent = TYPE_DEVICE,
+    .class_init = aux_bridge_class_init,
      .instance_size = sizeof(AUXTOI2CState),
      .instance_init = aux_bridge_init
  };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]