From: Roger Pau Monne <roger.pau@citrix.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] libxl: make libxl_device_{vkb, vfb}_add take a dummy ao
Date: Wed, 9 May 2012 09:46:52 +0100 [thread overview]
Message-ID: <4FAA2EFC.3030609@citrix.com> (raw)
In-Reply-To: <1334592052-7995-1-git-send-email-roger.pau@citrix.com>
Roger Pau Monne escribió:
> Add a dummy ao parameter to both functions, since they may become slow in the
> future.
>
> Signed-off-by: Roger Pau Monne<roger.pau@citrix.com>
This is completely wrong, please don't even review it.
> ---
>
> Requires Ian Jackson's "libxl: Allow AO_GC and EGC_GC even if not used"
>
> tools/libxl/libxl.c | 20 ++++++++++++--------
> tools/libxl/libxl.h | 6 ++++--
> tools/libxl/libxl_create.c | 6 +++---
> tools/libxl/libxl_dm.c | 4 ++--
> 4 files changed, 21 insertions(+), 15 deletions(-)
>
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 44a54cb..3fd8d5b 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -2208,9 +2208,10 @@ static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,
> return 0;
> }
>
> -int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb)
> +int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
> + const libxl_asyncop_how *ao_how)
> {
> - GC_INIT(ctx);
> + AO_CREATE(ctx, domid, ao_how);
> flexarray_t *front;
> flexarray_t *back;
> libxl__device device;
> @@ -2255,8 +2256,9 @@ out_free:
> flexarray_free(back);
> flexarray_free(front);
> out:
> - GC_FREE;
> - return rc;
> + /* Dummy ao */
> + libxl__ao_complete(egc, ao, rc);
> + return AO_INPROGRESS;
> }
>
> int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
> @@ -2339,9 +2341,10 @@ static int libxl__device_from_vfb(libxl__gc *gc, uint32_t domid,
> return 0;
> }
>
> -int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb)
> +int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb,
> + const libxl_asyncop_how *ao_how)
> {
> - GC_INIT(ctx);
> + AO_CREATE(ctx, domid, ao_how);
> flexarray_t *front;
> flexarray_t *back;
> libxl__device device;
> @@ -2399,8 +2402,9 @@ out_free:
> flexarray_free(front);
> flexarray_free(back);
> out:
> - GC_FREE;
> - return rc;
> + /* Dummy ao */
> + libxl__ao_complete(egc, ao, rc);
> + return AO_INPROGRESS;
> }
>
> int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 6da6107..ce89b31 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -563,14 +563,16 @@ int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
> libxl_device_nic *nic, libxl_nicinfo *nicinfo);
>
> /* Keyboard */
> -int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
> +int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb,
> + const libxl_asyncop_how *ao_how);
> int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
> libxl_device_vkb *vkb,
> const libxl_asyncop_how *ao_how);
> int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
>
> /* Framebuffer */
> -int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
> +int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb,
> + const libxl_asyncop_how *ao_how);
> int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
> libxl_device_vfb *vfb,
> const libxl_asyncop_how *ao_how);
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index a1f5731..39e9257 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -628,7 +628,7 @@ static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
> libxl__device_console_dispose(&console);
>
> libxl_device_vkb_init(&vkb);
> - libxl_device_vkb_add(ctx, domid,&vkb);
> + libxl_device_vkb_add(ctx, domid,&vkb, 0);
> libxl_device_vkb_dispose(&vkb);
>
> ret = libxl__create_device_model(gc, domid, d_config,
> @@ -646,8 +646,8 @@ static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config,
> libxl__device_console console;
>
> for (i = 0; i< d_config->num_vfbs; i++) {
> - libxl_device_vfb_add(ctx, domid,&d_config->vfbs[i]);
> - libxl_device_vkb_add(ctx, domid,&d_config->vkbs[i]);
> + libxl_device_vfb_add(ctx, domid,&d_config->vfbs[i], 0);
> + libxl_device_vkb_add(ctx, domid,&d_config->vkbs[i], 0);
> }
>
> ret = init_console_info(&console, 0);
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index 8dc588d..4a2b5c1 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -804,10 +804,10 @@ retry_transaction:
> if (ret)
> goto out_free;
> }
> - ret = libxl_device_vfb_add(ctx, dm_domid,&dm_config.vfbs[0]);
> + ret = libxl_device_vfb_add(ctx, dm_domid,&dm_config.vfbs[0], 0);
> if (ret)
> goto out_free;
> - ret = libxl_device_vkb_add(ctx, dm_domid,&dm_config.vkbs[0]);
> + ret = libxl_device_vkb_add(ctx, dm_domid,&dm_config.vkbs[0], 0);
> if (ret)
> goto out_free;
>
prev parent reply other threads:[~2012-05-09 8:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 16:00 [PATCH] libxl: make libxl_device_{vkb, vfb}_add take a dummy ao Roger Pau Monne
2012-05-09 8:46 ` Roger Pau Monne [this message]
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=4FAA2EFC.3030609@citrix.com \
--to=roger.pau@citrix.com \
--cc=xen-devel@lists.xen.org \
/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.