Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:GA
libguestfs
0004-use-old-style-options-when-locking.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0004-use-old-style-options-when-locking.patch of Package libguestfs
From a30b51747fc6605f50a9d5d8095fd2b6d1473b1c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" <rjones@redhat.com> Date: Wed, 17 Jan 2018 10:11:53 +0000 Subject: [PATCH] launch: direct: Use old-style file= and format= parameters when not disabling locking (RHBZ#1503497). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ancient qemu 1.5 (in RHEL 7) does not understand the file.file.filename= and file.driver= parameters. Go back to using the old-style file= and format= parameters when we're not trying to set the file.backing.file.locking=off parameter. Fixes commit 9fe592808ccfd9ed184b88ca9c6cad2e1798dee3. Thanks: Yongkui Guo, Václav Kadlčík. --- lib/launch-direct.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) Index: libguestfs-1.32.4/src/launch-direct.c =================================================================== --- libguestfs-1.32.4.orig/src/launch-direct.c +++ libguestfs-1.32.4/src/launch-direct.c @@ -524,17 +524,31 @@ launch_direct (guestfs_h *g, void *datav else { /* Writable qcow2 overlay on top of read-only drive. */ escaped_file = qemu_escape_param (g, drv->overlay); - param = safe_asprintf - (g, "file.file.filename=%s,cache=unsafe,file.driver=qcow2%s%s%s,id=hd%zu", - escaped_file, - drv->disk_label ? ",serial=" : "", - drv->disk_label ? drv->disk_label : "", - /* Add the file-specific locking option only for files, as qemu - * won't accept options unknown to the block driver in use. - */ - (data->qemu_mandatory_locking && drv->src.protocol == drive_protocol_file) - ? ",file.backing.file.locking=off" : "", - i); + if (data->qemu_mandatory_locking && drv->src.protocol == drive_protocol_file) { + /* Add the file-specific locking option only for files, as + * qemu won't accept options unknown to the block driver in + * use. + * */ + param = safe_asprintf + (g, "file.file.filename=%s,cache=unsafe,file.driver=qcow2%s%s,file.backing.file.locking=off,id=hd%zu", + escaped_file, + drv->disk_label ? ",serial=" : "", + drv->disk_label ? drv->disk_label : "", + i); + } + else { + /* Ancient qemu (esp. qemu 1.5 in RHEL 7) didn't understand the + * file.file.filename= parameter, so use the safer old-style + * form of parameters unless we actually want to specify the + * locking flag above. + */ + param = safe_asprintf + (g, "file=%s,cache=unsafe,format=qcow2%s%s,id=hd%zu", + escaped_file, + drv->disk_label ? ",serial=" : "", + drv->disk_label ? drv->disk_label : "", + i); + } } /* If there's an explicit 'iface', use it. Otherwise default to
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