diff mbox

[3/3] mc146818rtc: add "rtc" link to "/machine" (v2)

Message ID 20140530215920.GA15410@amt.cnet
State New
Headers show

Commit Message

Marcelo Tosatti May 30, 2014, 9:59 p.m. UTC
v2: - fix changelog to mention "machine" not "machines
    - remove TARGET_I386 ifdef

-------------
    

Add a link to rtc under /machine providing a stable 
location for management apps to query "date" field.

{"execute":"qom-get","arguments":{"path":"/machine/rtc","property":"date"}}

Suggested by Paolo Bonzini.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Comments

Eric Blake May 30, 2014, 10:19 p.m. UTC | #1
On 05/30/2014 03:59 PM, Marcelo Tosatti wrote:

Your subject line is harder than necessary.  'git am' would put the
"(v2)" suffix into qemu.git (it only strips the [...] prefix).  The
proper way to generate a v2 is with 'git send-email -v2', which produces
[PATCH v2] as the subject line prefix.

> 
> v2: - fix changelog to mention "machine" not "machines
>     - remove TARGET_I386 ifdef
> 
> -------------

This information is useful to reviewers, but not to qemu.git.  As such,
it belongs...

>     
> 
> Add a link to rtc under /machine providing a stable 
> location for management apps to query "date" field.
> 
> {"execute":"qom-get","arguments":{"path":"/machine/rtc","property":"date"}}
> 
> Suggested by Paolo Bonzini.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

...

here, after a --- separator.  Again, using 'git send-email' will
automatically format a --- separator into your mail.  It appears that
you free-formed your patch; while it is not necessarily an automatic
rejection, it does make life harder for the maintainers, and may slow
down the inclusion of your patches.  There is a real benefit to using a
workflow that makes the maintainer's life easier. :)

Also, we generally prefer that when sending a v2 patch (or patch series)
that it be sent as a new top-level thread rather than buried In-Reply-To
an existing thread; not everyone looks in deeply nested threads for new
patches.
diff mbox

Patch

Index: qemu/hw/timer/mc146818rtc.c
===================================================================
--- qemu.orig/hw/timer/mc146818rtc.c
+++ qemu/hw/timer/mc146818rtc.c
@@ -63,6 +63,7 @@ 
 typedef struct RTCState {
     ISADevice parent_obj;
 
+    Object *rtc_object;
     MemoryRegion io;
     uint8_t cmos_data[128];
     uint8_t cmos_index;
@@ -856,6 +857,8 @@  static void rtc_realizefn(DeviceState *d
     RTCState *s = MC146818_RTC(dev);
     int base = 0x70;
 
+    s->rtc_object = OBJECT(s);
+
     s->cmos_data[RTC_REG_A] = 0x26;
     s->cmos_data[RTC_REG_B] = 0x02;
     s->cmos_data[RTC_REG_C] = 0x00;
@@ -908,6 +911,10 @@  static void rtc_realizefn(DeviceState *d
 
     object_property_add(OBJECT(s), "date", "struct tm",
                         rtc_get_date, NULL, NULL, s, NULL);
+
+    object_ref(s->rtc_object);
+    object_property_add_link(qdev_get_machine(), "rtc", TYPE_MC146818_RTC,
+                            (Object **)&s->rtc_object, NULL, 0, &error_abort);
 }
 
 ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)