All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v11 03/17] libxl: convert libxl__device_disk_local_attach to an async op
Date: Tue, 24 Jul 2012 17:09:58 +0100	[thread overview]
Message-ID: <500EC8D6.4090403@citrix.com> (raw)
In-Reply-To: <20494.48390.888395.331926@mariner.uk.xensource.com>

Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH v11 03/17] libxl: convert libxl__device_disk_local_attach to an async op"):
>> This will be needed in future patches, when libxl__device_disk_add
>> becomes async also. Create a new status structure that defines the
>> local attach of a disk device and use it in
>> libxl__device_disk_local_attach.
> 
> Thanks.  Close...
> 
>> +void libxl__device_disk_local_initiate_detach(libxl__egc *egc,
>> +                                     libxl__disk_local_state *dls)
>>  {
>> +    STATE_AO_GC(dls->ao);
>>      int rc = 0;
>> +    libxl_device_disk *disk = &dls->disk;
>> +    libxl__device *device;
>> +    libxl__ao_device *aodev = &dls->aodev;
>> +    libxl__prepare_ao_device(ao, aodev);
>> +
>> +    if (!dls->diskpath) goto out;
>>
>>      switch (disk->backend) {
>>          case LIBXL_DISK_BACKEND_QDISK:
> ...
>> +                rc = libxl__device_from_disk(gc, LIBXL_TOOLSTACK_DOMID,
>> +                                             disk, device);
>> +                if (rc != 0) goto out;
> ...
>>          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;
>> +            goto out;
>>      }
>>
>> +out:
>> +    local_device_detach_cb(egc, aodev);
> 
> Doesn't this lose the rc ?  Since...
> 
> ...
>> +static void local_device_detach_cb(libxl__egc *egc, libxl__ao_device *aodev)
>> +{
>> +    STATE_AO_GC(aodev->ao);
>> +    libxl__disk_local_state *dls = CONTAINER_OF(aodev, *dls, aodev);
>> +    int rc;
>> +
>> +    if (aodev->rc) {
> 
> ... this picks the rc out of the aodev.  And you don't set aodev->rc.
> The general code in libxl__device_disk_local_initiate_detach expects
> (as is conventional) to set the local variable rc and `goto out'.  So
> I think you need
>   +    aodev->rc = rc;

Yes, that's right.

> 
>> @@ -2097,10 +2142,10 @@ struct libxl__bootloader_state {
>>      /* Should be zeroed by caller on entry.  Will be filled in by
>>       * bootloader machinery; represents the local attachment of the
>>       * disk for the benefit of the bootloader.  Must be detached by
>> -     * the caller using libxl__device_disk_local_detach, but only
>> +     * the caller using libxl__device_disk_local_initiate_detach, but only
>>       * after the domain's kernel and initramfs have been loaded into
>>       * memory and the file references disposed of. */
> 
> I queried this and you replied:
>> I didn't change this comment, but if you want I can do that in this
>> patch. The bootloader makes a copy of the kernel/initramfs to somewhere,
>> and that is what we load to the memory.
> 
> Right.  The comment is wrong, but you're not making it wronger, so
> this is something for me to fix up.

Thanks for the review, and for taking care of this last comment.

  reply	other threads:[~2012-07-24 16:09 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23 17:27 [PATCH v11 0/17] execute hotplug scripts from libxl Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 01/17] libxl: fix stubdom console destruction Roger Pau Monne
2012-07-24  7:50   ` Ian Campbell
2012-07-24  8:39     ` Roger Pau Monne
2012-07-24 10:16       ` Stefano Stabellini
2012-07-24 10:54         ` Roger Pau Monne
2012-07-24 10:57           ` Ian Campbell
2012-07-24 11:01             ` Roger Pau Monne
2012-07-24 11:58               ` Stefano Stabellini
2012-07-24 12:14                 ` Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 02/17] libxl: refactor disk addition to take a helper Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 03/17] libxl: convert libxl__device_disk_local_attach to an async op Roger Pau Monne
2012-07-24 15:19   ` Ian Jackson
2012-07-24 16:09     ` Roger Pau Monne [this message]
2012-07-23 17:27 ` [PATCH v11 04/17] libxl: rename vifs to nics Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 05/17] libxl: convert libxl_device_disk_add to an async op Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 06/17] libxl: convert libxl_device_nic_add to an async operation Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 07/17] libxl: add option to choose who executes hotplug scripts Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 08/17] libxl: rename _IOEMU nic type to VIF_IOEMU Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 09/17] libxl: set nic type of stub to PV instead of copying from the parent Roger Pau Monne
2012-07-24 15:27   ` Ian Jackson
2012-07-24 15:32     ` Ian Campbell
2012-07-24 16:05       ` Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 10/17] libxl: set correct nic type depending on the guest Roger Pau Monne
2012-07-24 15:28   ` Ian Jackson
2012-07-24 16:02     ` Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 11/17] libxl: use libxl__xs_path_cleanup on device_destroy Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 12/17] libxl: call hotplug scripts for disk devices from libxl Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 13/17] libxl: call hotplug scripts for nic " Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 14/17] libxl: convert libxl_device_vkb_add to an async operation Roger Pau Monne
2012-07-23 17:27 ` [PATCH v11 15/17] libxl: convert libxl_device_vfb_add " Roger Pau Monne
2012-07-24 15:20   ` Ian Jackson
2012-07-25 11:00     ` Roger Pau Monne
2012-07-26 14:26       ` Ian Jackson
2012-07-23 17:27 ` [PATCH v11 16/17] xl: main_blockdetach don't call destroy if remove succeeds Roger Pau Monne
2012-07-24 15:29   ` Ian Jackson
2012-07-23 17:27 ` [PATCH v11 17/17] libxl: libxl__xs_path_cleanup don't print error if ENOENT Roger Pau Monne

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=500EC8D6.4090403@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Stefano.Stabellini@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 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.