qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/5] mc146818rtc: add "rtc" link to "/machine"


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 5/5] mc146818rtc: add "rtc" link to "/machine"
Date: Tue, 17 Jun 2014 16:12:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Il 17/06/2014 16:09, Peter Crosthwaite ha scritto:
> +
> +    object_property_add_alias(qdev_get_machine(), "rtc",
> +                              OBJECT(s), NULL, &error_abort);
This will fail if anyone wants to add two such devices to a machine
model. It seems a bit board specific to assume that this device is
only valid as a singleton. Perhaps s/&error_abort/local_err/ and
raising a warning explaining that only the first RTC in the system
gets the alias?

&error_warn? :) But then, /machine/rtc.tm is the only supported interface, and it should be the same for all RTC devices so perhaps a NULL error pointer is enough.

The other options is arrayification using your (hot off the press)
"[*]" proposal:

+    object_property_add_alias(qdev_get_machine(), "rtc[*]",
+                              OBJECT(s), NULL, &error_abort);

This could make sense, but would leave /machine/rtc[0] in the common case. I prefer raising a warning.

Paolo



reply via email to

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