xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Cedric Bosdonnat <cbosdonnat@suse.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH] libxl: QED disks support
Date: Thu, 8 Dec 2016 09:28:37 +0000	[thread overview]
Message-ID: <20161208092837.GK28069@citrix.com> (raw)
In-Reply-To: <1481115867.4542.4.camel@suse.com>

On Wed, Dec 07, 2016 at 02:04:27PM +0100, Cedric Bosdonnat wrote:
> On Wed, 2016-12-07 at 11:25 +0000, Wei Liu wrote:
> > On Mon, Nov 14, 2016 at 03:57:00PM +0100, Cédric Bosdonnat wrote:
> > > Qdisk supports qcow and qcow2, extend it to also support qed disk
> > > format.
> > > 
> > > Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
> > > ---
> > >  tools/libxl/libxl_device.c  |    1 +
> > >  tools/libxl/libxl_dm.c      |    1 +
> > >  tools/libxl/libxl_types.idl |    1 +
> > >  tools/libxl/libxl_utils.c   |    2 +
> > >  tools/libxl/libxlu_disk_l.c | 1018 ++++++++++++++++++++++---------------------
> > >  tools/libxl/libxlu_disk_l.h |   53 +--
> > >  tools/libxl/libxlu_disk_l.l |    3 +-
> > 
> > You would also need to patch docs/misc/xl-disk-configuration.txt and
> > possibly xl manpage.
> 
> Oh indeed, I forgot about those.
> 
> > You would also need to add a LIBXL_HAVE macro in libxl.h -- there are
> > quite a lot of examples there.
> 
> I pondered this too, but I managed to write a configure detection code detecting
> if the format is managed without it (just by trying to build a small sample of code
> using the new enum value). Do we really want to have a LIBXL_HAVE macro for every
> single disk format support we add?
> 

The new macro is to mark the change in LIBXL public APIs, so that user
can rely on the macro to do it, which seems to be a bit easier than
requiring everyone to write a small program to test if the enum exists.

The macro just needs to carry a certain semantics. It doesn't have to be
one macro per enum or thing. For example, you can add a batch of new
formats but only have one macro. But in this particular patch, it is
going to be one macro for this format.

> > Other than the things mentioned above, most code changes look rather
> > mechanical to me.
> > 
> > But what is not very satisfying (not your fault) is that we seem to need
> > to add every single disk format we want to support by hand. That's
> > rather repetitive. I wonder if there should be some sort of notation in
> > libxl for "all formats that QEMU supports".
> 
> Should I then check the docs for such a statement? Or should I try adding more
> qemu-supported disk formats?
> 

Neither.

I was vaguely thinking about some sort of mechanism to automatically
detect what QEMU supports and plumb relevant arguments to QEMU. But that
doesn't seem to be easy and doesn't fit into our existing model. I think
there will be security concern as well. We would need to think more
about this.

At the moment I think your approach is fine. We just add new formats as
they come along.

So, please update your patch to patch documents / libxl.h and resend.

Wei.

> --
> Cedric
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-12-08  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 14:57 [PATCH] libxl: QED disks support Cédric Bosdonnat
2016-12-06 14:41 ` Cedric Bosdonnat
2016-12-06 15:42   ` Wei Liu
2016-12-07 11:25 ` Wei Liu
2016-12-07 13:04   ` Cedric Bosdonnat
2016-12-08  9:28     ` Wei Liu [this message]
2016-12-08  9:34       ` Juergen Gross

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=20161208092837.GK28069@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=cbosdonnat@suse.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).