Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:GA
libguestfs
0001-test-whether-qemu-does-mandatory-locking.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-test-whether-qemu-does-mandatory-locking.patch of Package libguestfs
From 3d2b84231fca14b7e2beeeeab0e852f44dba0c21 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" <rjones@redhat.com> Date: Mon, 11 Sep 2017 17:38:08 +0100 Subject: [PATCH] lib: qemu: Add accessor to test if qemu does mandatory locking. QEMU >= 2.10 started to do mandatory locking. This checks the QMP schema to see if we are using that version of qemu. (Note it is sometimes disabled in downstream builds, and it was also enabled in upstream prereleases with version 2.9.9x, so we cannot just check the version number). --- lib/guestfs-internal.h | 1 + lib/qemu.c | 65 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) 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 @@ -68,6 +68,7 @@ static char *make_appliance_dev (guestfs static void print_qemu_command_line (guestfs_h *g, char **argv); static int qemu_supports (guestfs_h *g, struct backend_direct_data *, const char *option); static int qemu_supports_device (guestfs_h *g, struct backend_direct_data *, const char *device_name); +static int qemu_mandatory_locking (guestfs_h *g, const struct backend_direct_data *data); static int qemu_supports_virtio_scsi (guestfs_h *g, struct backend_direct_data *); static char *qemu_escape_param (guestfs_h *g, const char *param); @@ -1095,6 +1096,18 @@ qemu_supports_device (guestfs_h *g, stru return strstr (data->qemu_devices, device_name) != NULL; } +/** + * Test if the qemu binary uses mandatory file locking, added in + * QEMU >= 2.10 (but sometimes disabled). + */ +static int +qemu_mandatory_locking (guestfs_h *g, + const struct backend_direct_data *data) +{ + return data->qemu_version_major >= 2 || + (data->qemu_version_major == 2 && data->qemu_version_minor >= 10); +} + /* Check if a file can be opened. */ static int is_openable (guestfs_h *g, const char *path, int flags)
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