All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH v3 6/7] xl/libxl: implement QDISK	libxl_device_disk_local_attach
Date: Tue, 17 Apr 2012 18:58:22 +0100	[thread overview]
Message-ID: <20365.44862.597858.180770@mariner.uk.xensource.com> (raw)
In-Reply-To: <1334601190-14187-6-git-send-email-stefano.stabellini@eu.citrix.com>

Stefano Stabellini writes ("[Xen-devel] [PATCH v3 6/7] xl/libxl: implement QDISK libxl_device_disk_local_attach"):
...
> +                    t = xs_transaction_start(ctx->xsh);

This transaction should be in the local variables block for the whole
function, and initialised to 0.

> +                    /* use 0 as the domid of the toolstack domain for now */
> +                    tmpdisk->vdev = libxl__alloc_vdev(gc, 0, blkdev_start, t);

Should this 0 be abstracted into a #define or a variable ?

> +                    if (tmpdisk->vdev == NULL) {
> +                        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
> +                                "libxl__alloc_vdev failed\n");
> +                        xs_transaction_end(ctx->xsh, t, 1);

And then all these xs_transaction_end calls turn into one call in the
exit path.

> +                dev = libxl__sprintf(gc, "/dev/%s", tmpdisk->vdev);

Perhaps you'd like to use GCSPRINTF now that we have it.

>              LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "locally attaching qdisk %s\n",
> -                       disk->pdev_path);

Perhaps you'd like to use LOG(DEBUG, ....") now that we have it ?

> -            dev = tmpdisk->pdev_path;
> +    switch (disk->backend) {
> +        case LIBXL_DISK_BACKEND_QDISK:
> +            if (disk->format != LIBXL_DISK_FORMAT_RAW) {

This replicates the logic earlier, which decided whether to use a
qdisk.  I think it would be better to remember whether we did use a
qdisk and detach it iff so.

Ian.

  reply	other threads:[~2012-04-17 17:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 18:32 [PATCH v3 0/7] qdisk local attach Stefano Stabellini
2012-04-16 18:33 ` [PATCH v3 1/7] libxl: libxl__device_disk_local_attach return a new libxl_device_disk Stefano Stabellini
2012-04-17 17:25   ` Ian Jackson
2012-04-18  8:34     ` Ian Campbell
2012-04-20 13:58     ` Stefano Stabellini
2012-04-16 18:33 ` [PATCH v3 2/7] libxl: add a transaction parameter to libxl__device_generic_add Stefano Stabellini
2012-04-17 17:27   ` Ian Jackson
2012-04-18  8:41   ` Ian Campbell
2012-04-20 15:13     ` Stefano Stabellini
2012-04-16 18:33 ` [PATCH v3 3/7] libxl: introduce libxl__device_disk_add_t Stefano Stabellini
2012-04-17 17:37   ` Ian Jackson
2012-04-20 14:00     ` Stefano Stabellini
2012-04-16 18:33 ` [PATCH v3 4/7] xl/libxl: add a blkdev_start parameter Stefano Stabellini
2012-04-17 17:47   ` Ian Jackson
2012-04-20 14:04     ` Stefano Stabellini
2012-04-20 14:08       ` Ian Campbell
2012-04-23 17:40         ` Stefano Stabellini
2012-04-24  9:20           ` Ian Campbell
2012-04-20 14:22       ` Ian Jackson
2012-04-16 18:33 ` [PATCH v3 5/7] libxl: introduce libxl__alloc_vdev Stefano Stabellini
2012-04-17 17:53   ` Ian Jackson
2012-04-20 14:14     ` Stefano Stabellini
2012-04-20 14:28       ` Ian Jackson
2012-04-23 17:40         ` Stefano Stabellini
2012-04-16 18:33 ` [PATCH v3 6/7] xl/libxl: implement QDISK libxl_device_disk_local_attach Stefano Stabellini
2012-04-17 17:58   ` Ian Jackson [this message]
2012-04-20 14:24     ` Stefano Stabellini
2012-04-20 14:37       ` Ian Jackson
2012-04-23 17:40         ` Stefano Stabellini
2012-04-16 18:33 ` [PATCH v3 7/7] libxl__device_disk_local_attach: wait for state "connected" Stefano Stabellini
2012-04-17 18:01   ` Ian Jackson
2012-04-20 14:35     ` Stefano Stabellini

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=20365.44862.597858.180770@mariner.uk.xensource.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=Ian.Campbell@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 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.