[Top][All Lists]

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

Re: [Qemu-ppc] [Qemu-devel] [PATCH] hw/misc/macio: Mark the macio device

From: Mark Cave-Ayland
Subject: Re: [Qemu-ppc] [Qemu-devel] [PATCH] hw/misc/macio: Mark the macio devices with user_creatable = false
Date: Wed, 7 Mar 2018 18:47:37 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 07/03/18 14:22, Thomas Huth wrote:

The macio devices currently cause a crash when the user tries to
instantiate them on a different machine:

$ ppc64-softmmu/qemu-system-ppc64 -device macio-newworld
Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:222:
qemu-system-ppc64: -device macio-newworld: Device 'serial0' is in use
Aborted (core dumped)

These devices are clearly not intended to be creatable by the user
since they are using serial_hds[] directly in their instance_init
function. So let's mark them with user_creatable = false.

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

diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index af1bd46..454244f 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -406,6 +406,8 @@ static void macio_class_init(ObjectClass *klass, void *data)
      k->class_id = PCI_CLASS_OTHERS << 8;
      dc->props = macio_properties;
      set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
+    /* Reason: Uses serial_hds in macio_instance_init */
+    dc->user_creatable = false;
static const TypeInfo macio_oldworld_type_info = {

Looks like both Daniel and Peter also agree this is the correct approach, so:

Reviewed-by: Mark Cave-Ayland <address@hidden>



reply via email to

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