Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Maintenance:8074
xen.openSUSE_Leap_42.3_Update
5ae076d7-libxl-specify-format-of-inserted-cdrom...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5ae076d7-libxl-specify-format-of-inserted-cdrom.patch of Package xen.openSUSE_Leap_42.3_Update
# Commit d8f65e68a7c1047fad97206a6282c281247fadc2 # Date 2018-04-25 14:38:47 +0200 # Author Anthony PERARD <anthony.perard@citrix.com> # Committer Jan Beulich <jbeulich@suse.com> libxl: Specify format of inserted cdrom Without this extra parameter on the QMP command, QEMU will guess the format of the new file. This is XSA-258. Reported-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -426,6 +426,19 @@ char *libxl__device_disk_string_of_backe } } +const char *libxl__qemu_disk_format_string(libxl_disk_format format) +{ + switch (format) { + case LIBXL_DISK_FORMAT_QCOW: return "qcow"; + case LIBXL_DISK_FORMAT_QCOW2: return "qcow2"; + case LIBXL_DISK_FORMAT_VHD: return "vpc"; + case LIBXL_DISK_FORMAT_RAW: return "raw"; + case LIBXL_DISK_FORMAT_EMPTY: return NULL; + case LIBXL_DISK_FORMAT_QED: return "qed"; + default: return NULL; + } +} + int libxl__device_physdisk_major_minor(const char *physpath, int *major, int *minor) { struct stat buf; --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -669,19 +669,6 @@ static int libxl__build_device_model_arg return 0; } -static const char *qemu_disk_format_string(libxl_disk_format format) -{ - switch (format) { - case LIBXL_DISK_FORMAT_QCOW: return "qcow"; - case LIBXL_DISK_FORMAT_QCOW2: return "qcow2"; - case LIBXL_DISK_FORMAT_VHD: return "vpc"; - case LIBXL_DISK_FORMAT_RAW: return "raw"; - case LIBXL_DISK_FORMAT_EMPTY: return NULL; - case LIBXL_DISK_FORMAT_QED: return "qed"; - default: return NULL; - } -} - static char *dm_spice_options(libxl__gc *gc, const libxl_spice_info *spice) { @@ -1486,9 +1473,9 @@ static int libxl__build_device_model_arg * always raw */ if (disks[i].backend == LIBXL_DISK_BACKEND_QDISK) - format = qemu_disk_format_string(disks[i].format); + format = libxl__qemu_disk_format_string(disks[i].format); else - format = qemu_disk_format_string(LIBXL_DISK_FORMAT_RAW); + format = libxl__qemu_disk_format_string(LIBXL_DISK_FORMAT_RAW); if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY) { if (!disks[i].is_cdrom) { --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1192,6 +1192,7 @@ _hidden int libxl__domain_pvcontrol_writ /* from xl_device */ _hidden char *libxl__device_disk_string_of_backend(libxl_disk_backend backend); _hidden char *libxl__device_disk_string_of_format(libxl_disk_format format); +_hidden const char *libxl__qemu_disk_format_string(libxl_disk_format format); _hidden int libxl__device_disk_set_backend(libxl__gc*, libxl_device_disk*); _hidden int libxl__device_physdisk_major_minor(const char *physpath, int *major, int *minor); --- a/tools/libxl/libxl_qmp.c +++ b/tools/libxl/libxl_qmp.c @@ -982,6 +982,8 @@ int libxl__qmp_insert_cdrom(libxl__gc *g return qmp_run_command(gc, domid, "eject", args, NULL, NULL); } else { qmp_parameters_add_string(gc, &args, "target", disk->pdev_path); + qmp_parameters_add_string(gc, &args, "arg", + libxl__qemu_disk_format_string(disk->format)); return qmp_run_command(gc, domid, "change", args, NULL, NULL); } }
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