[libvirt] [PATCH V2 1/2] libxl: set default disk format in device post-parse

Michal Privoznik mprivozn at redhat.com
Thu Feb 9 07:18:49 UTC 2017


On 02/07/2017 08:46 PM, Jim Fehlig wrote:
> 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.
> 
> Signed-off-by: Jim Fehlig <jfehlig at suse.com>
> ---
>  src/libxl/libxl_conf.c   | 10 ++--------
>  src/libxl/libxl_domain.c |  7 ++++++-
>  2 files changed, 8 insertions(+), 9 deletions(-)

ACK.

BTW looks like you forgot about one other location:

src/libxl/libxl_driver.c=5452=libxlDomainBlockStatsGatherSingle(virDomainObjPtr vm,
--
src/libxl/libxl_driver.c-5469-
src/libxl/libxl_driver.c-5470-    if (STREQ(disk_drv, "phy")) {
src/libxl/libxl_driver.c-5471-        if (disk_fmt != VIR_STORAGE_FILE_RAW &&
src/libxl/libxl_driver.c:5472:            disk_fmt != VIR_STORAGE_FILE_NONE) {
src/libxl/libxl_driver.c-5473-            virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
src/libxl/libxl_driver.c-5474-                           _("unsupported format %s"),
src/libxl/libxl_driver.c-5475-                           virStorageFileFormatTypeToString(disk_fmt));


Michal




More information about the libvir-list mailing list