Signed-off-by: Mark Cave-Ayland <[email protected]>
---
include/hw/i386/pc.h | 1 +
hw/i386/pc.c | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 843a5a9e1f..309de2eda1 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -39,6 +39,7 @@ typedef struct PCMachineState {
BusState *idebus[MAX_IDE_BUS];
Object *alias_pcspk;
+ Object *alias_rtc_time;
/* Configuration options: */
uint64_t max_ram_below_4g;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index b049c9f880..b3d4a26c94 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1094,8 +1094,7 @@ void pc_basic_device_init(struct PCMachineState *pcms,
qdev_connect_gpio_out(DEVICE(rtc_state), 0, rtc_irq);
}
- object_property_add_alias(OBJECT(pcms), "rtc-time", OBJECT(rtc_state),
- "date");
+ object_property_set_alias(OBJECT(pcms), "rtc-time", OBJECT(rtc_state));
#ifdef CONFIG_XEN_EMU
if (xen_mode == XEN_EMULATE) {
@@ -1754,6 +1753,10 @@ static void pc_machine_class_init(ObjectClass *oc, const
void *data)
offsetof(PCMachineState, alias_pcspk),
TYPE_PC_SPEAKER,
"audiodev");
+ object_class_property_add_alias(oc, "rtc-time",
+ offsetof(PCMachineState, alias_rtc_time),
+ TYPE_MC146818_RTC,
+ "date");
}
static const TypeInfo pc_machine_info = {
--
2.43.0