[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 07/14] libxl: disks: Make LIBXL_DISK_BACKEND_UNKNOWN work
On Thu, 2011-05-12 at 15:36 +0100, Ian Jackson wrote: > libxl callers should not be required to specify the backend if they > don't want to. So LIBXL_DISK_BACKEND_UNKNOWN should instruct libxl to > choose the backend for itself. I guess the selection of LIBXL_DISK_BACKEND_TAP was chosen to give the greatest coverage as a stop gap measure until more smarts arrive? (It'll fall back to QDISK as necessary too, which is nice). > > More thorough fixes for the disk handling will follow. > > Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> > --- > tools/libxl/libxl.c | 15 +++++++++++++++ > 1 files changed, 15 insertions(+), 0 deletions(-) > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index fe012cb..73fc3e9 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -989,6 +989,21 @@ int libxl_device_disk_add(libxl_ctx *ctx, uint32_t > domid, libxl_device_disk *dis > device.domid = domid; > device.kind = DEVICE_VBD; > > + > + /* > + * Fixing the incoming backend type to try to decide on which > + * backend to use. Unfortunately at the moment this code is > + * utterly broken, but it more or less works. > + */ > + > + /* > + * Backend type UNKNOWN should mean "caller does not want to specify", > + * not "break pointlessely". (Callers should not be required to > + * specify the backend if they don't want to.) > + */ > + if (disk->backend == LIBXL_DISK_BACKEND_UNKNOWN) > + disk->backend = LIBXL_DISK_BACKEND_TAP; > + > /* If blktap is not available then fallback to qdisk */ > if (disk->backend == LIBXL_DISK_BACKEND_TAP && > !libxl__blktap_enabled(&gc)) > disk->backend = LIBXL_DISK_BACKEND_QDISK; _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |