xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH v2 07/15] libxl: convert libxl_domain_destroy to an async op
Date: Tue, 22 May 2012 15:11:38 +0100	[thread overview]
Message-ID: <4FBB9E9A.6030107@citrix.com> (raw)
In-Reply-To: <1337695365-5142-8-git-send-email-roger.pau@citrix.com>

Roger Pau Monne wrote:
> This change introduces some new structures, and breaks the mutual
> dependency that libxl_domain_destroy and libxl__destroy_device_model
> had. This is done by checking if the domid passed to
> libxl_domain_destroy has a stubdom, and then having the bulk of the
> destroy machinery in a separate function (libxl__destroy_domid) that
> doesn't check for stubdom presence, since we check for it in the upper
> level function. The reason behind this change is the need to use
> structures for ao operations, and it was impossible to have two
> different self-referencing structs.
>
> All uses of libxl_domain_destroy have been changed, and either
> replaced by the new libxl_domain_destroy ao function or by the
> internal libxl__domain_destroy that can be used inside an already
> running ao.
>
> Cc: Ian Jackson<ian.jackson@eu.citrix.com>
> Signed-off-by: Roger Pau Monne<roger.pau@citrix.com>
> ---
>   tools/libxl/libxl.c          |  167 +++++++++++++++++++++++++++++++++---
>   tools/libxl/libxl.h          |    3 +-
>   tools/libxl/libxl_create.c   |   29 ++++++-
>   tools/libxl/libxl_device.c   |  192 ++++++++++++++++++++++++++++++++++--------
>   tools/libxl/libxl_dm.c       |   85 ++++++++++---------
>   tools/libxl/libxl_internal.h |   90 +++++++++++++++++++-
>   tools/libxl/xl_cmdimpl.c     |   12 ++--
>   7 files changed, 473 insertions(+), 105 deletions(-)

[ ...]

> @@ -413,30 +490,40 @@ int libxl__devices_destroy(libxl__gc *gc, uint32_t domid)
>               path = libxl__sprintf(gc, "/local/domain/%d/device/%s/%s/backend",
>                                     domid, kinds[i], devs[j]);
>               path = libxl__xs_read(gc, XBT_NULL, path);
> -            if (path&&  libxl__parse_backend_path(gc, path,&dev) == 0) {
> -                dev.domid = domid;
> -                dev.kind = kind;
> -                dev.devid = atoi(devs[j]);
> -
> -                libxl__device_destroy(gc,&dev);
> +            printf("device: %s\n", path);

This should not be here.

> +            GCNEW(dev);
> +            if (path&&  libxl__parse_backend_path(gc, path, dev) == 0) {
> +                dev->domid = domid;
> +                dev->kind = kind;
> +                dev->devid = atoi(devs[j]);
> +                drs->aorm[numdev].action = DEVICE_DISCONNECT;
> +                drs->aorm[numdev].dev = dev;
> +                drs->aorm[numdev].callback = device_remove_callback;
> +                drs->aorm[numdev].force = drs->force;
> +                libxl__initiate_device_remove(egc,&drs->aorm[numdev]);
> +                numdev++;
>               }
>           }
>       }
>
>       /* console 0 frontend directory is not under /local/domain/<domid>/device */
>       path = libxl__sprintf(gc, "/local/domain/%d/console/backend", domid);
> +    printf("frontend: %s\n", path);
>       path = libxl__xs_read(gc, XBT_NULL, path);
> +    printf("backend: %s\n", path);

Neither should this. I will resend without this printfs, but please 
ignore them for review.

[...]

  reply	other threads:[~2012-05-22 14:11 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 14:02 [PATCH v2 0/15] execute hotplug scripts from libxl Roger Pau Monne
2012-05-22 14:02 ` [PATCH v2 01/15] libxl: pass env vars to libxl__exec Roger Pau Monne
2012-05-22 14:02 ` [PATCH v2 02/15] libxl: fix libxl__xs_directory usage of transaction Roger Pau Monne
2012-05-22 14:02 ` [PATCH v2 03/15] libxl: add libxl__xs_path_cleanup Roger Pau Monne
2012-05-22 14:19   ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 04/15] libxl: reoder libxl_device unplug functions Roger Pau Monne
2012-05-22 14:21   ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 05/15] libxl: change libxl__ao_device_remove to libxl__ao_device Roger Pau Monne
2012-05-22 15:10   ` Ian Jackson
2012-05-22 15:27     ` Ian Campbell
2012-05-22 16:23       ` Ian Jackson
2012-05-22 15:34     ` Roger Pau Monne
2012-05-22 15:55     ` Roger Pau Monne
2012-05-22 16:32       ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 06/15] libxl: move device model creation prototypes Roger Pau Monne
2012-05-22 15:10   ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 07/15] libxl: convert libxl_domain_destroy to an async op Roger Pau Monne
2012-05-22 14:11   ` Roger Pau Monne [this message]
2012-05-22 17:01   ` Ian Jackson
2012-05-22 17:30     ` Roger Pau Monne
2012-05-22 17:48       ` Ian Jackson
2012-05-23  9:47     ` Roger Pau Monne
2012-05-23 10:45       ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 08/15] libxl: convert libxl_device_disk_add to an asyn op Roger Pau Monne
2012-05-22 17:04   ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 09/15] libxl: convert libxl_device_nic_add to an async operation Roger Pau Monne
2012-05-22 17:06   ` Ian Jackson
2012-05-23 10:24     ` Roger Pau Monne
2012-05-22 14:02 ` [PATCH v2 10/15] libxl: add option to choose who executes hotplug scripts Roger Pau Monne
2012-05-22 17:13   ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 11/15] libxl: set nic type to VIF by default Roger Pau Monne
2012-05-22 14:02 ` [PATCH v2 12/15] libxl: call hotplug scripts for disk devices from libxl Roger Pau Monne
2012-05-22 17:40   ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 13/15] libxl: call hotplug scripts for nic " Roger Pau Monne
2012-05-22 17:45   ` Ian Jackson
2012-05-23 15:14     ` Roger Pau Monne
2012-05-22 14:02 ` [PATCH v2 14/15] libxl: use libxl__xs_path_cleanup on device_destroy Roger Pau Monne
2012-05-22 17:46   ` Ian Jackson
2012-05-22 14:02 ` [PATCH v2 15/15] libxl: add dummy netbsd functions Roger Pau Monne
2012-05-22 17:47   ` Ian Jackson
2012-05-22 17:47   ` Ian Jackson
2012-05-23 15:05     ` Roger Pau Monne
2012-05-23 10:07 ` [PATCH v2 0/15] execute hotplug scripts from libxl Ian Campbell

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=4FBB9E9A.6030107@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Ian.Jackson@eu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).