[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [RFC][PATCH v7 03/16] Make qemu timers available for to
From: |
Jes Sorensen |
Subject: |
[Qemu-devel] Re: [RFC][PATCH v7 03/16] Make qemu timers available for tools |
Date: |
Wed, 09 Mar 2011 11:33:51 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 |
On 03/07/11 21:10, Michael Roth wrote:
> To be able to use qemu_mod_timer() and friends to register timeout
> events for virtagent's qemu-va tool, we need to do the following:
>
> Move several blocks of code out of cpus.c that handle initialization
> of qemu's io_thread_fd and working with it via
> qemu_notify_event()/qemu_event_read()/etc, and make them accessible
> as backend functions to both the emulator code and qemu-tool.c via
> wrapper functions within cpus.c and qemu-tool.c, respectively. These
> have been added to qemu-ioh.c, where similar treatment was given to
> qemu_set_fd_handler() and friends.
>
> Some of these wrapper functions lack declarations when being
> built into tools, so we add those via qemu-tool.h, which can be included
> by a tool to access them. With these changes we can drive timers in a
> tool linking it against qemu-timer.o and then implementing something
> similar to the main i/o loop in vl.c:
>
[snip]
> diff --git a/qemu-ioh.c b/qemu-ioh.c
> index cc71470..5c3f94c 100644
> --- a/qemu-ioh.c
> +++ b/qemu-ioh.c
> @@ -113,3 +117,94 @@ void qemu_process_fd_handlers2(void *ioh_record_list,
> const fd_set *rfds,
> }
> }
> }
> +
> +#ifndef _WIN32
> +void iothread_event_increment(int *io_thread_fd)
Please move these functions into posix/w32 specific files so we don't
get anymore ugly #ifdefs. It would be good if we could use a wrapper
struct as well to hide the different data types so we don't need #ifdefs
in the calling code as well.
Cheers,
Jes
- [Qemu-devel] [RFC][PATCH v7 14/16] virtagent: add virtagent chardev, (continued)
- [Qemu-devel] [RFC][PATCH v7 14/16] virtagent: add virtagent chardev, Michael Roth, 2011/03/07
- [Qemu-devel] [RFC][PATCH v7 07/16] virtagent: base RPC client definitions, Michael Roth, 2011/03/07
- [Qemu-devel] [RFC][PATCH v7 08/16] virtagnet: base RPC server definitions, Michael Roth, 2011/03/07
- [Qemu-devel] [RFC][PATCH v7 04/16] virtagent: bi-directional RPC handling logic, Michael Roth, 2011/03/07
- [Qemu-devel] [RFC][PATCH v7 05/16] virtagent: common helpers and init routines, Michael Roth, 2011/03/07
- [Qemu-devel] [RFC][PATCH v7 03/16] Make qemu timers available for tools, Michael Roth, 2011/03/07
- [Qemu-devel] Re: [RFC][PATCH v7 03/16] Make qemu timers available for tools,
Jes Sorensen <=
- [Qemu-devel] Re: [RFC][PATCH v7 00/16] virtagent: host/guest communication agent, Anthony Liguori, 2011/03/07