All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: agl@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com,
	abeekhof@redhat.com, marcel.mittelstaedt@de.ibm.com,
	qemu-devel@nongnu.org, aliguori@linux.vnet.ibm.com,
	ryanh@us.ibm.com, markus_mueller@de.ibm.com
Subject: [Qemu-devel] Re: [RFC][PATCH v6 03/23] Make qemu timers available for tools
Date: Fri, 21 Jan 2011 17:30:40 +0100	[thread overview]
Message-ID: <4D39B4B0.50207@redhat.com> (raw)
In-Reply-To: <1295270117-24760-4-git-send-email-mdroth@linux.vnet.ibm.com>

On 01/17/11 14:14, Michael Roth wrote:
> diff --git a/qemu-ioh.c b/qemu-ioh.c
> index cc71470..001e7a2 100644
> --- a/qemu-ioh.c
> +++ b/qemu-ioh.c
> @@ -22,7 +22,11 @@
>   * THE SOFTWARE.
>   */
>  #include "qemu-ioh.h"
> +#include "qemu-char.h"
>  #include "qlist.h"
> +#ifdef CONFIG_EVENTFD
> +#include <sys/eventfd.h>
> +#endif
>  
>  /* XXX: fd_read_poll should be suppressed, but an API change is
>     necessary in the character devices to suppress fd_can_read(). */
> @@ -113,3 +117,92 @@ void qemu_process_fd_handlers2(void *ioh_record_list, const fd_set *rfds,
>          }
>      }
>  }
> +
> +#ifndef _WIN32
> +void iothread_event_increment(int *io_thread_fd)

Please split the WIN32 stuff into it's own file, similar to oslib-posix
and oslib-win32.c etc.

> diff --git a/qemu-ioh.h b/qemu-ioh.h
> index 7c6e833..2c714a9 100644
> --- a/qemu-ioh.h
> +++ b/qemu-ioh.h
> @@ -31,4 +31,13 @@ void qemu_get_fdset2(void *ioh_record_list, int *nfds, fd_set *rfds,
>  void qemu_process_fd_handlers2(void *ioh_record_list, const fd_set *rfds,
>                                 const fd_set *wfds, const fd_set *xfds);
>  
> +
> +#ifndef _WIN32
> +void iothread_event_increment(int *io_thread_fd);
> +int iothread_event_init(int *io_thread_fd);
> +#else
> +int win32_event_init(HANDLE *qemu_event_handle);
> +void win32_event_increment(HANDLE *qemu_event_handle);
> +#endif

Can you not do something slightly nicer that allows for those to be the
same prototype for all users? Like define a event_handle_t?

> +
> +#ifndef _WIN32
> +static int io_thread_fd = -1;

Needs splitting into separate files too.

> diff --git a/qemu-tool.h b/qemu-tool.h
> new file mode 100644
> index 0000000..fd693cf
> --- /dev/null
> +++ b/qemu-tool.h
> @@ -0,0 +1,26 @@
> +#ifndef QEMU_TOOL_H
> +#define QEMU_TOOL_H
> +
> +#include "qemu-common.h"
> +
> +#ifdef CONFIG_EVENTFD
> +#include <sys/eventfd.h>
> +#endif
> +
> +typedef void VMStateDescription;
> +typedef int VMStateInfo;
> +
> +#ifndef _WIN32
> +void qemu_event_increment(void);
> +int qemu_event_init(void);
> +#else
> +int qemu_event_init(void);
> +void qemu_event_increment(void);
> +#endif

No matter how long I stare at those prototypes, I fail to see the
difference between the win32 and the posix version :)

Cheers,
Jes

  reply	other threads:[~2011-01-21 16:30 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17 13:14 [Qemu-devel] [RFC][PATCH v6 00/23] virtagent: host/guest RPC communication agent Michael Roth
2011-01-17 13:14 ` [Qemu-devel] [RFC][PATCH v6 01/23] Move code related to fd handlers into utility functions Michael Roth
2011-01-17 13:56   ` Gerd Hoffmann
2011-01-17 13:14 ` [Qemu-devel] [RFC][PATCH v6 02/23] Add qemu_set_fd_handler() wrappers to qemu-tools.c Michael Roth
2011-01-17 13:14 ` [Qemu-devel] [RFC][PATCH v6 03/23] Make qemu timers available for tools Michael Roth
2011-01-21 16:30   ` Jes Sorensen [this message]
2011-01-21 17:26     ` [Qemu-devel] " Michael Roth
2011-01-24  7:56       ` Jes Sorensen
2011-01-17 13:14 ` [Qemu-devel] [RFC][PATCH v6 04/23] virtagent: common code for managing client/server rpc jobs Michael Roth
2011-01-17 13:14 ` [Qemu-devel] [RFC][PATCH v6 05/23] virtagent: transport definitions read/send callback functions Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 06/23] virtagent: base client definitions Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 07/23] virtagent: base server definitions Michael Roth
2011-01-21 16:38   ` [Qemu-devel] " Jes Sorensen
2011-01-21 17:55     ` Michael Roth
2011-01-24 10:16       ` Jes Sorensen
2011-01-24 16:51         ` Michael Roth
2011-01-24 17:04           ` Jes Sorensen
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 08/23] virtagent: add va.getfile RPC Michael Roth
2011-01-21 16:40   ` [Qemu-devel] " Jes Sorensen
2011-01-21 17:20     ` Daniel P. Berrange
2011-01-21 18:23       ` Michael Roth
2011-01-24 22:08         ` Richard W.M. Jones
2011-01-24 22:20           ` Richard W.M. Jones
2011-01-24 22:26             ` Anthony Liguori
2011-01-24 22:48               ` Richard W.M. Jones
2011-01-24 23:40                 ` Anthony Liguori
2011-01-25  0:22                   ` Michael Roth
2011-01-25  0:25                     ` Anthony Liguori
2011-01-25  9:21                   ` Richard W.M. Jones
2011-01-25 15:12                     ` Anthony Liguori
2011-01-25 15:43                       ` Richard W.M. Jones
2011-01-26 13:01                         ` Richard W.M. Jones
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 09/23] virtagent: add agent_viewfile qmp/hmp command Michael Roth
2011-01-21 16:41   ` [Qemu-devel] " Jes Sorensen
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 10/23] virtagent: add va.getdmesg RPC Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 11/23] virtagent: add agent_viewdmesg qmp/hmp commands Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 12/23] virtagent: add va.shutdown RPC Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 13/23] virtagent: add agent_shutdown qmp/hmp commands Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 14/23] virtagent: add va.ping RPC Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 15/23] virtagent: add agent_ping qmp/hmp commands Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 16/23] virtagent: add agent_capabilities " Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 17/23] virtagent: add client capabilities init function Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 18/23] virtagent: add va.hello RPC Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 19/23] virtagent: add "hello" notification function for guest agent Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 20/23] virtagent: add va.capabilities RPC Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 21/23] virtagent: add virtagent guest daemon Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 22/23] virtagent: integrate virtagent server/client via chardev Michael Roth
2011-01-17 13:15 ` [Qemu-devel] [RFC][PATCH v6 23/23] virtagent: various bits to build QEMU with virtagent Michael Roth
2011-01-24 10:24   ` [Qemu-devel] " Jes Sorensen
2011-01-17 13:53 ` [Qemu-devel] [RFC][PATCH v6 00/23] virtagent: host/guest RPC communication agent Gerd Hoffmann
2011-01-17 14:53   ` Michael Roth
2011-01-18 14:02     ` Gerd Hoffmann
2011-01-18 14:13       ` Anthony Liguori
2011-01-31 14:41         ` Michael Roth
2011-02-01 22:18           ` Michael Roth
2011-02-14  9:49             ` Gerd Hoffmann
2011-02-16 16:04 ` Jes Sorensen
2011-02-16 17:22   ` Michael Roth
2011-02-17  8:26     ` Jes Sorensen
2011-02-17  9:08       ` Dor Laor
2011-02-17 14:39       ` Michael Roth
2011-02-18 12:45         ` Jes Sorensen
2011-02-18 14:07           ` Anthony Liguori
2011-02-18 14:30             ` Jes Sorensen
2011-02-18 14:57               ` Anthony Liguori
2011-02-21  8:32                 ` Jes Sorensen
2011-02-21 13:36                   ` Michael Roth
2011-02-21 13:38                     ` Jes Sorensen
2011-02-18 15:22             ` Gerd Hoffmann
2011-02-18 15:25               ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D39B4B0.50207@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=abeekhof@redhat.com \
    --cc=agl@linux.vnet.ibm.com \
    --cc=aliguori@linux.vnet.ibm.com \
    --cc=marcel.mittelstaedt@de.ibm.com \
    --cc=markus_mueller@de.ibm.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ryanh@us.ibm.com \
    --cc=stefanha@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.