[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC][PATCH v2 09/17] qmp proxy: core code for proxying
From: |
Jes Sorensen |
Subject: |
Re: [Qemu-devel] [RFC][PATCH v2 09/17] qmp proxy: core code for proxying qmp requests to guest |
Date: |
Thu, 21 Apr 2011 10:30:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 |
On 04/18/11 17:02, Michael Roth wrote:
> diff --git a/qmp-core.c b/qmp-core.c
> index 9f3d182..dab50a1 100644
> --- a/qmp-core.c
> +++ b/qmp-core.c
> @@ -937,7 +937,15 @@ void qmp_async_complete_command(QmpCommandState *cmd,
> QObject *retval, Error *er
> qemu_free(cmd);
> }
>
> +extern QmpProxy *qmp_proxy_default;
Please put this in a header file.
> +static void qmp_proxy_process_control_event(QmpProxy *p, const QDict *evt)
> +{
> + const char *cmd;
> + int host_sid, guest_sid;
> +
> + cmd = qdict_get_try_str(evt, "_control_event");
> + if (!cmd) {
> + fprintf(stderr, "received NULL control event\n");
> + } else if (strcmp(cmd, "guest_ack") == 0) {
> + host_sid = qdict_get_try_int(evt, "_control_arg_host_sid", 0);
> + if (!host_sid) {
> + fprintf(stderr, "invalid guest_ack: wrong host sid\n");
> + return;
> + }
> + /* guest responded to host_init, return a host_ack */
> + /* reset outstanding requests, then send an ack with the
> + * session id they passed us
> + */
> + guest_sid = qdict_get_try_int(evt, "_control_arg_guest_sid", 0);
I am wondering if it would make sense to put these arguments in a header
file as #define's to make sure you don't have to chase down a typo on
one side at some point? Just an idea, dunno if it is worth it.
Cheers,
Jes
- [Qemu-devel] [RFC][PATCH v2 00/11] QEMU Guest Agent: QMP-based host/guest communication (virtagent), Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 04/17] qapi: fix function name typo in qmp-gen.py, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 09/17] qmp proxy: core code for proxying qmp requests to guest, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 10/17] qmp proxy: add qmp_proxy chardev, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 06/17] qapi: fix memory leak for async marshalling code, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 07/17] qapi: qmp-gen.py, use basename of path for guard/core prefix, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 02/17] json-streamer: add handling for JSON_ERROR token/state, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 01/17] json-lexer: make lexer error-recovery more deterministic, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 05/17] qapi: fix handling for null-return async callbacks, Michael Roth, 2011/04/18
- [Qemu-devel] [RFC][PATCH v2 03/17] json-parser: add handling for NULL token list, Michael Roth, 2011/04/18