Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
libvirt.10484
321a28c6-libxl-default-disk-format.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 321a28c6-libxl-default-disk-format.patch of Package libvirt.10484
commit 321a28c6aef6fb31b4ba309a1b3d252f7cd0f05c Author: Jim Fehlig <jfehlig@suse.com> Date: Tue Feb 7 11:00:33 2017 -0700 libxl: set default disk format in device post-parse When starting a domian, a libxl_domain_config object is created from virDomainDef. Any virDomainDiskDef devices with a format of VIR_STORAGE_FILE_NONE are mapped to LIBXL_DISK_FORMAT_RAW in the corresponding libxl_disk_device, but the virDomainDiskDef format is never updated to reflect the change. A better place to set a default format for disk devices is the device post-parse callback, ensuring the virDomainDiskDef object reflects the default format. Index: libvirt-1.2.18.4/src/libxl/libxl_conf.c =================================================================== --- libvirt-1.2.18.4.orig/src/libxl/libxl_conf.c +++ libvirt-1.2.18.4/src/libxl/libxl_conf.c @@ -968,8 +968,6 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk x_disk->format = LIBXL_DISK_FORMAT_VHD; x_disk->backend = LIBXL_DISK_BACKEND_TAP; break; - case VIR_STORAGE_FILE_NONE: - /* No subtype specified, default to raw/tap */ case VIR_STORAGE_FILE_RAW: x_disk->format = LIBXL_DISK_FORMAT_RAW; x_disk->backend = LIBXL_DISK_BACKEND_TAP; @@ -994,8 +992,6 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk case VIR_STORAGE_FILE_VHD: x_disk->format = LIBXL_DISK_FORMAT_VHD; break; - case VIR_STORAGE_FILE_NONE: - /* No subtype specified, default to raw */ case VIR_STORAGE_FILE_RAW: x_disk->format = LIBXL_DISK_FORMAT_RAW; break; @@ -1008,8 +1004,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk return -1; } } else if (STREQ(driver, "file")) { - if (format != VIR_STORAGE_FILE_NONE && - format != VIR_STORAGE_FILE_RAW) { + if (format != VIR_STORAGE_FILE_RAW) { virReportError(VIR_ERR_INTERNAL_ERROR, _("libxenlight does not support disk format %s " "with disk driver %s"), @@ -1020,8 +1015,7 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk x_disk->format = LIBXL_DISK_FORMAT_RAW; x_disk->backend = LIBXL_DISK_BACKEND_QDISK; } else if (STREQ(driver, "phy")) { - if (format != VIR_STORAGE_FILE_NONE && - format != VIR_STORAGE_FILE_RAW) { + if (format != VIR_STORAGE_FILE_RAW) { virReportError(VIR_ERR_INTERNAL_ERROR, _("libxenlight does not support disk format %s " "with disk driver %s"), Index: libvirt-1.2.18.4/src/libxl/libxl_domain.c =================================================================== --- libvirt-1.2.18.4.orig/src/libxl/libxl_domain.c +++ libvirt-1.2.18.4/src/libxl/libxl_domain.c @@ -334,6 +334,14 @@ libxlDomainDeviceDefPostParse(virDomainD } } + if (dev->type == VIR_DOMAIN_DEVICE_DISK) { + int format = virDomainDiskGetFormat(dev->data.disk); + + /* xl.cfg default format is raw. See xl-disk-configuration(5) */ + if (format == VIR_STORAGE_FILE_NONE) + virDomainDiskSetFormat(dev->data.disk, VIR_STORAGE_FILE_RAW); + } + if (virDomainDeviceDefCheckUnsupportedMemoryDevice(dev) < 0) return -1;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor