From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0hix-0006UA-Rb for qemu-devel@nongnu.org; Mon, 15 Dec 2014 21:18:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0hio-00070v-QR for qemu-devel@nongnu.org; Mon, 15 Dec 2014 21:18:55 -0500 Received: from ozlabs.org ([103.22.144.67]:42084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0hio-00070J-FI for qemu-devel@nongnu.org; Mon, 15 Dec 2014 21:18:46 -0500 Date: Tue, 16 Dec 2014 13:18:42 +1100 From: David Gibson Message-ID: <20141216021842.GJ23547@voom.fritz.box> References: <1418690628-20652-1-git-send-email-david@gibson.dropbear.id.au> <1418690628-20652-5-git-send-email-david@gibson.dropbear.id.au> <548F8531.3030009@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OfrWf2Fun5Ae4m0Y" Content-Disposition: inline In-Reply-To: <548F8531.3030009@suse.de> Subject: Re: [Qemu-devel] [PATCH 4/5] pseries: Export /machine "rtc-time" property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: aik@ozlabs.ru, paulus@samba.org, qemu-devel@nongnu.org, mdroth@us.ibm.com --OfrWf2Fun5Ae4m0Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 16, 2014 at 02:04:49AM +0100, Alexander Graf wrote: >=20 >=20 > On 16.12.14 01:43, David Gibson wrote: > > On x86, the guest's RTC can be read with QMP via the "rtc-time" property > > on the /machine object. This is due to an explicit QOM alias being set= up > > by the mc146818rtc driver, and doesn't work on other targets. > >=20 > > This extends the pseries RTAS RTC to populate that property, for improv= ed > > management compatibility with x86 guests. > >=20 > > Signed-off-by: David Gibson >=20 > Yeah, this really should happen inside an rtc device. >=20 > > --- > > hw/ppc/spapr_rtc.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++= +++ > > 1 file changed, 49 insertions(+) > >=20 > > diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c > > index fac0017..13e74f1 100644 > > --- a/hw/ppc/spapr_rtc.c > > +++ b/hw/ppc/spapr_rtc.c > > @@ -28,6 +28,7 @@ > > #include "cpu.h" > > #include "hw/ppc/spapr.h" > > #include "qapi-event.h" > > +#include "qapi/visitor.h" > > =20 > > void spapr_rtc_read(sPAPREnvironment *spapr, struct tm *tm, uint32_t *= ns) > > { > > @@ -87,10 +88,58 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, s= PAPREnvironment *spapr, > > rtas_st(rets, 0, RTAS_OUT_SUCCESS); > > } > > =20 > > +static void spapr_qom_rtc_time(Object *obj, Visitor *v, void *opaque, > > + const char *name, Error **errp) >=20 > Also this function is mostly copy&paste from the mc14foo driver. Do you > think you can share this somehow? I guess I can make a helper function. > I also think the alias should get created by the machine, not the device > itself. Again, I'm copying what mc146818rtc does. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --OfrWf2Fun5Ae4m0Y Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUj5aBAAoJEGw4ysog2bOSzxoP/1niomqPifyt1LUR3rAgAm/P F851VtYOarvZMPdGgV30ZV0ld7sg5r01EpzD4MZ4rIOTVascPRYQ/9WpMClAs8vu pED4sL49JMTs2h3K2k4lK23mN40BaMZJX0pO+TSwVwdSho43abkfVBnsI1Dy8dP1 Zw7894Bnva+B/O8ZyHlVcbDcs/Sy4xEzkPh8i3I8e3vKZqt6YUtAzIj8+og0E2Qn vGZOM2oZXuBH5Bv9u4H4hhyRmblK2DaxtqVAp+QKjfZVa+EbkEXOs6oT7wEXnRS8 r2H67+NJspYQnleUYI6GMg+cQIbnagqVXo+jrl+dx3E6RV/h6Hs5oJqHagHU0rKs qsMYIKb3u4IyANqSowEX5YNFNUpgwiUnZOx9vgjRLhXkSP5wQBWBHT2GZ/2HWF3l X0gaCSHop0kMJaMX9L/QIrNai3axoKSacf1V0eArPvo98yPoSDIQaaRuOEBy0wTr qlzvmzDO9rBZoQK/F3tQ93aeb6gUD+y9uUOa6S/PD+NPF25Um5QTxwdOjqQ4S2g8 sl+xhExOxD+P41+SwZXWBB9MsI58AZ5/+SqMWanM2uvOdN7uCJsvVULAdchSyKFu M5CevcG+PSvOBjLkjuxGr+1MT43QKcChqyDBfEjD/iJLaC96p+Za7u/G9wAzPjuO ij582oDurS9un7C0HSpq =KV1c -----END PGP SIGNATURE----- --OfrWf2Fun5Ae4m0Y--