xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [PATCH v8 08/11] xl/libxl: implement QDISK libxl_device_disk_local_attach
Date: Thu, 7 Jun 2012 19:56:35 +0200	[thread overview]
Message-ID: <4FD0EB53.2040603@citrix.com> (raw)
In-Reply-To: <1338287956-24691-8-git-send-email-stefano.stabellini@eu.citrix.com>

Stefano Stabellini wrote:
>   int libxl__device_disk_local_detach(libxl__gc *gc, libxl_device_disk *disk)
>   {
> -    /* Nothing to do for PHYSTYPE_PHY. */
> +    int rc = 0;
>
> -    /*
> -     * For other device types assume that the blktap2 process is
> -     * needed by the soon to be started domain and do nothing.
> -     */
> +    switch (disk->backend) {
> +        case LIBXL_DISK_BACKEND_QDISK:
> +            if (disk->vdev != NULL) {
> +                libxl_device_disk_remove(gc->owner, LIBXL_TOOLSTACK_DOMID,
> +                        disk, 0);

I was just looking at this code, and I have the feeling this could be 
dangerous, since you call libxl__device_disk_local_detach from an 
already running ao (the bootloader ao), and libxl_device_disk_remove 
will initiate another ao, and set it to completed inside of an already 
running ao.

> +                rc = libxl_device_disk_destroy(gc->owner,
> +                        LIBXL_TOOLSTACK_DOMID, disk);
> +            }
> +            break;
> +        default:
> +            /*
> +             * Nothing to do for PHYSTYPE_PHY.
> +             * For other device types assume that the blktap2 process is
> +             * needed by the soon to be started domain and do nothing.
> +             */
> +            break;
> +    }
>
>       free(disk->pdev_path);
>       free(disk->script);
> -    return 0;
> +
> +    return rc;
>   }
>
>   /******************************************************************************/

  reply	other threads:[~2012-06-07 17:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29 10:38 [PATCH v8 0/11] qdisk local attach Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 01/11] libxl: make libxl_device_disk_local_attach/detach internal functions Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 02/11] libxl: libxl__device_disk_local_attach return a new libxl_device_disk Stefano Stabellini
2012-05-29 14:10   ` Ian Campbell
2012-05-29 14:29     ` Stefano Stabellini
2012-05-29 14:48       ` Stefano Stabellini
2012-05-29 15:03         ` Ian Campbell
2012-05-29 15:10           ` Stefano Stabellini
2012-05-29 15:23         ` Ian Jackson
2012-05-29 15:25         ` Ian Jackson
2012-05-29 15:32           ` Ian Campbell
2012-05-29 10:39 ` [PATCH v8 03/11] libxl: add a transaction parameter to libxl__device_generic_add Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 04/11] libxl: export libxl__device_from_disk Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 05/11] libxl: introduce libxl__device_disk_add Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 06/11] xl/libxl: add a blkdev_start parameter Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 07/11] libxl: introduce libxl__alloc_vdev Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 08/11] xl/libxl: implement QDISK libxl_device_disk_local_attach Stefano Stabellini
2012-06-07 17:56   ` Roger Pau Monne [this message]
2012-06-07 18:27     ` Ian Jackson
2012-05-29 10:39 ` [PATCH v8 09/11] libxl__device_disk_local_attach: wait for state "connected" Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 10/11] libxl_string_to_backend: add qdisk Stefano Stabellini
2012-05-29 10:39 ` [PATCH v8 11/11] main_blockdetach: destroy the disk on successful removal Stefano Stabellini
2012-05-29 15:37 ` [PATCH v8 0/11] qdisk local attach 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=4FD0EB53.2040603@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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 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).