All of lore.kernel.org
 help / color / mirror / Atom feed
* libvirt, libxl and QDISKs
@ 2013-04-24 14:22 David Scott
  2013-04-24 15:55 ` Stefano Stabellini
  2013-04-25  8:55 ` Ian Campbell
  0 siblings, 2 replies; 32+ messages in thread
From: David Scott @ 2013-04-24 14:22 UTC (permalink / raw)
  To: xen-devel

Hi,

Now that libxl + qemu's built-in disk backend for ceph/rbd is working 
nicely, I'm trying to get it all working through libvirt.

When libvirt's libxl driver creates a libxl_device_disk, it applies a 
few simple rules[1] covering specific file format types (qcow, qcow2, 
vhd). If none of these rules apply then it defers to libxl's best guess:

             * If driverName is not specified, default to raw as per
             * xl-disk-configuration.txt in the xen documentation and let
             * libxl pick a suitable backend.
             */
             x_disk->format = LIBXL_DISK_FORMAT_RAW;
             x_disk->backend = LIBXL_DISK_BACKEND_UNKNOWN;

The libxl code in libxl__device_disk_set_backend[2] tries to resolve 
'UNKNOWN' into something concrete by calling 'disk_try_backend':

             disk_try_backend(&a, LIBXL_DISK_BACKEND_PHY) ?:
             disk_try_backend(&a, LIBXL_DISK_BACKEND_TAP) ?:
             disk_try_backend(&a, LIBXL_DISK_BACKEND_QDISK);

Unfortunately for me and my quest, the case for LIBXL_DISK_BACKEND_TAP 
just checks for
  * lack of hotplug script
  * libxl__blktap_enabled
  * DISK_FORMAT_{RAW,VHD}
and so it selects TAP and then fails, because tapdisk doesn't know 
anything about this disk access protocol (yet at least). Unbeknownst to 
libxl, qemu would be able to handle the disk in this case.

I'm not sure what the best way to address this is. I could disable 
blktap on my system but it would be a shame to drop support for the 
stuff tapdisk does well (like .vhd handling)

On the other hand, having both tapdisk and qemu means having to choose
between them for disk protocols they could both handle. A choice would
either have to be coded in libxl (or libvirt's libxl driver), which 
seems like a bit of an annoying maintenance burden (i.e. update the list 
every time someone adds a driver somewhere); or it could be left to the 
sysadmin to choose via some kind of resolver script, which seems a bit 
complex.

A third possibility is to be able to ask tapdisk, "do you actually 
support this disk" and if yes, use it in preference to qemu, if no fall 
back to qemu.

Anyone got any thoughts? (Or perhaps I've missed something obvious! :-)

Cheers,
Dave

[1] 
http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/libxl/libxl_conf.c;h=7e0753a69ed4a0867d14843cbad20d1430a67f0c;hb=HEAD#l462

[2] 
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libxl/libxl_device.c;h=eeea9d9a023877a69ff2832c973e753629333356;hb=HEAD#l219

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2013-04-29 21:00 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 14:22 libvirt, libxl and QDISKs David Scott
2013-04-24 15:55 ` Stefano Stabellini
2013-04-25  8:55 ` Ian Campbell
2013-04-25 10:36   ` George Dunlap
2013-04-25 11:33     ` Ian Campbell
2013-04-25 11:55       ` Stefano Stabellini
2013-04-25 11:57         ` Ian Campbell
2013-04-25 12:12           ` David Scott
2013-04-25 12:43             ` Ian Campbell
2013-04-25 13:22               ` David Scott
2013-04-25 13:56                 ` Ian Campbell
2013-04-26  1:27                   ` Jim Fehlig
2013-04-26  4:50                     ` Jim Fehlig
2013-04-26 10:37                       ` David Scott
2013-04-26 23:44                         ` Jim Fehlig
     [not found]                         ` <517B1170.4020300@suse.com>
2013-04-29  9:41                           ` David Scott
2013-04-26  8:49                     ` Ian Campbell
2013-04-26 10:10                     ` Stefano Stabellini
2013-04-26 10:13                       ` Ian Campbell
2013-04-26 10:28                         ` Stefano Stabellini
2013-04-26 11:31                       ` Marek Marczykowski
2013-04-26 11:40                         ` Ian Campbell
2013-04-26 11:48                           ` Stefano Stabellini
2013-04-26 13:27                             ` Ian Campbell
2013-04-26 17:10                               ` Stefano Stabellini
2013-04-29  8:23                                 ` Ian Campbell
2013-04-29 10:07                                   ` Stefano Stabellini
2013-04-26 11:50                           ` Marek Marczykowski
2013-04-29 21:00                             ` Jim Fehlig
2013-04-26 11:45                         ` Stefano Stabellini
2013-04-26 14:36                       ` Roger Pau Monné
2013-04-25 18:26         ` Sylvain Munaut

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.