From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB8mS-0003vv-M8 for qemu-devel@nongnu.org; Tue, 04 Oct 2011 13:27:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RB8mR-000651-Kv for qemu-devel@nongnu.org; Tue, 04 Oct 2011 13:27:48 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:35862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB8mR-00064t-9p for qemu-devel@nongnu.org; Tue, 04 Oct 2011 13:27:47 -0400 Message-ID: <4E8B4203.8040207@web.de> Date: Tue, 04 Oct 2011 19:27:31 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1317739882-4809-1-git-send-email-anthony.perard@citrix.com> <1317739882-4809-3-git-send-email-anthony.perard@citrix.com> In-Reply-To: <1317739882-4809-3-git-send-email-anthony.perard@citrix.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig41F18BA10AEDDB315626B8FD" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH RFC V1 02/11] qemu-timer: Introduce qemu_run_one_timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony PERARD Cc: Alex Williamson , Xen Devel , QEMU-devel , Stefano Stabellini This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig41F18BA10AEDDB315626B8FD Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-10-04 16:51, Anthony PERARD wrote: > Used by the Xen PCI Passthrough code to run the timer about the power > state transition. >=20 > Signed-off-by: Anthony PERARD > --- > qemu-timer.c | 15 +++++++++++++++ > qemu-timer.h | 3 +++ > 2 files changed, 18 insertions(+), 0 deletions(-) >=20 > diff --git a/qemu-timer.c b/qemu-timer.c > index 46dd483..15e659b 100644 > --- a/qemu-timer.c > +++ b/qemu-timer.c > @@ -1163,3 +1163,18 @@ int qemu_calculate_timeout(void) > return 1000; > } > =20 > +/* run the specified timer */ > +void qemu_run_one_timer(QEMUTimer *ts) > +{ > + uint64_t current_time; > + > + /* remove timer from the list before calling the callback */ > + qemu_del_timer(ts); > + > + while ((current_time =3D qemu_get_clock_ms(rt_clock)) < ts->expire= _time) > + /* sleep until the expire time */ > + usleep((ts->expire_time - current_time) * 1000); > + > + /* run the callback */ > + ts->cb(ts->opaque); > +} This looks funny. I can't imagine that this could ever fit into the standard (asynchronous) QEMU execution model for I/O. Keep it private to Xen? Jan --------------enig41F18BA10AEDDB315626B8FD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6LQgMACgkQitSsb3rl5xQHdgCeJDzINaF6x3j72pUtgFZ5Qp0n ltoAnA82lDcMdOoK70Ixb0OyPMSwyqmF =x+Jm -----END PGP SIGNATURE----- --------------enig41F18BA10AEDDB315626B8FD-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH RFC V1 02/11] qemu-timer: Introduce qemu_run_one_timer Date: Tue, 04 Oct 2011 19:27:31 +0200 Message-ID: <4E8B4203.8040207@web.de> References: <1317739882-4809-1-git-send-email-anthony.perard@citrix.com> <1317739882-4809-3-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig41F18BA10AEDDB315626B8FD" Return-path: In-Reply-To: <1317739882-4809-3-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Anthony PERARD Cc: Alex Williamson , Xen Devel , QEMU-devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig41F18BA10AEDDB315626B8FD Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-10-04 16:51, Anthony PERARD wrote: > Used by the Xen PCI Passthrough code to run the timer about the power > state transition. >=20 > Signed-off-by: Anthony PERARD > --- > qemu-timer.c | 15 +++++++++++++++ > qemu-timer.h | 3 +++ > 2 files changed, 18 insertions(+), 0 deletions(-) >=20 > diff --git a/qemu-timer.c b/qemu-timer.c > index 46dd483..15e659b 100644 > --- a/qemu-timer.c > +++ b/qemu-timer.c > @@ -1163,3 +1163,18 @@ int qemu_calculate_timeout(void) > return 1000; > } > =20 > +/* run the specified timer */ > +void qemu_run_one_timer(QEMUTimer *ts) > +{ > + uint64_t current_time; > + > + /* remove timer from the list before calling the callback */ > + qemu_del_timer(ts); > + > + while ((current_time =3D qemu_get_clock_ms(rt_clock)) < ts->expire= _time) > + /* sleep until the expire time */ > + usleep((ts->expire_time - current_time) * 1000); > + > + /* run the callback */ > + ts->cb(ts->opaque); > +} This looks funny. I can't imagine that this could ever fit into the standard (asynchronous) QEMU execution model for I/O. Keep it private to Xen? Jan --------------enig41F18BA10AEDDB315626B8FD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6LQgMACgkQitSsb3rl5xQHdgCeJDzINaF6x3j72pUtgFZ5Qp0n ltoAnA82lDcMdOoK70Ixb0OyPMSwyqmF =x+Jm -----END PGP SIGNATURE----- --------------enig41F18BA10AEDDB315626B8FD--