All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@suse.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH 3/3] libxl: libxl__device_from_disk should retrieve backend from xenstore
Date: Wed, 11 Feb 2015 10:18:18 -0700	[thread overview]
Message-ID: <54DB8EDA.7010603@suse.com> (raw)
In-Reply-To: <20150210114950.GF27856@zion.uk.xensource.com>

Wei Liu wrote:
> On Tue, Feb 10, 2015 at 11:01:46AM +0000, Ian Jackson wrote:
>   
>> Wei Liu writes ("[PATCH 3/3] libxl: libxl__device_from_disk should retrieve backend from xenstore"):
>>     
>>> ... if backend is not set by caller.
>>>       
>> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
>>
>> as far as it goes, but I think you may want a more radical change -
>> see below.
>>
>>     
>>> Also change the function to use "goto" idiom while I was there.
>>>       
>> (Although usually it would be better to split this kind of thing into
>> a pre-patch, in this case it's small and easily reviewed.)
>>
>> Is the backend type the only missing or potentially-wrong
>> information ?  ISTM that perhaps the caller might not know the target,
>> either.
>>
>> What should happen if the caller specifies a different target in disk
>> to the one the device is actually using ?  The documentation should
>> specify which of the fields are important.
>>
>>     
>
> I'm not sure because it's not documented.
>
> We should take a step back to define the important fields first.
>
>   
>> Maybe libxl_device_disk_remove needs to call libxl_vdev_to_device_disk
>> and check that the supplied disk struct is plausible somehow.  In that
>> case it might be nice for the caller to be able to fill in only the
>> vdev.
>>
>>     
>
> If so we need to make clear in the documentation. I'm of course fine
> with this behaviour.
>
> Jim, does libvirt (as an example of libxl user) actually cares
> specifying every fields in that struct? The other user (xl) doesn't seem
> to care that much.
>   

At minimum, libvirt will populate the pdev_path, vdev, backend, and
format fields. If backend and format (which, in libvirt-speack
correspond to the 'name' and 'type' attributes on the optional <driver>
element) are not specified, they are set to LIBXL_DISK_BACKEND_UNKNOWN
and LIBXL_DISK_FORMAT_RAW respectively.

Regards,
Jim

  reply	other threads:[~2015-02-11 17:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 13:21 [PATCH 0/3] Misc patches for libxl_device_disk functions Wei Liu
2015-02-09 13:21 ` [PATCH 1/3] libxl, xl: don't init/dispose when not necessary Wei Liu
2015-02-09 13:23   ` Wei Liu
2015-02-09 14:36     ` Wei Liu
2015-02-10 10:54   ` Ian Jackson
2015-02-10 11:39     ` Wei Liu
2015-02-09 13:21 ` [PATCH 2/3] libxl: factor out libxl__disk_backend_from_xs_be Wei Liu
2015-02-10 10:56   ` Ian Jackson
2015-02-10 11:39     ` Wei Liu
2015-02-09 13:21 ` [PATCH 3/3] libxl: libxl__device_from_disk should retrieve backend from xenstore Wei Liu
2015-02-10 11:01   ` Ian Jackson
2015-02-10 11:49     ` Wei Liu
2015-02-11 17:18       ` Jim Fehlig [this message]
2015-02-12 18:35         ` Ian Jackson
2015-02-23 15:13         ` Wei Liu
2015-02-26 23:49           ` Jim Fehlig
2015-03-06 13:04             ` Wei Liu

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=54DB8EDA.7010603@suse.com \
    --to=jfehlig@suse.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=wei.liu2@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.