From b0a7742ccd494ee6d91778a8d452717bddb46f5c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 17 Oct 2017 19:31:38 +0200 Subject: [PATCH] fix multipath qemu-pr-helper Update patch 1014 for new libmultipath/libmpathpersist API Force build to fail if multipath is not available --- ...-multipath-support-to-qemu-pr-helper.patch | 33 +++++++++++++++---- qemu-pr-helper.socket | 1 + qemu.spec | 9 ++++- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/1014-scsi-add-multipath-support-to-qemu-pr-helper.patch b/1014-scsi-add-multipath-support-to-qemu-pr-helper.patch index 252ef14..b1de8c1 100644 --- a/1014-scsi-add-multipath-support-to-qemu-pr-helper.patch +++ b/1014-scsi-add-multipath-support-to-qemu-pr-helper.patch @@ -65,7 +65,7 @@ index becc21a0fe..f6edc2a33f 100755 xen xen backend driver support xen-pci-passthrough brlapi BrlAPI (Braile) -@@ -3300,6 +3306,30 @@ else +@@ -3300,6 +3306,38 @@ else fi ########################################## @@ -77,9 +77,17 @@ index becc21a0fe..f6edc2a33f 100755 +#include +unsigned mpath_mx_alloc_len = 1024; +int logsink; ++static struct config *multipath_conf; ++extern struct udev *udev; ++extern struct config *get_multipath_config(void); ++extern void put_multipath_config(struct config *conf); ++struct udev *udev; ++struct config *get_multipath_config(void) { return multipath_conf; } ++void put_multipath_config(struct config *conf) { } ++ +int main(void) { -+ struct udev *udev = udev_new(); -+ mpath_lib_init(udev); ++ udev = udev_new(); ++ multipath_conf = mpath_lib_init(); + return 0; +} +EOF @@ -225,7 +233,7 @@ index e39efbd529..5f77c873e1 100644 static int verbose; #ifdef CONFIG_LIBCAP -@@ -204,9 +211,316 @@ static int do_sgio(int fd, const uint8_t *cdb, uint8_t *sense, +@@ -204,9 +211,327 @@ static int do_sgio(int fd, const uint8_t *cdb, uint8_t *sense, return r; } @@ -294,15 +302,26 @@ index e39efbd529..5f77c873e1 100644 + +/* Variables required by libmultipath and libmpathpersist. */ +QEMU_BUILD_BUG_ON(PR_HELPER_DATA_SIZE > MPATH_MAX_PARAM_LEN); ++static struct config *multipath_conf; +unsigned mpath_mx_alloc_len = PR_HELPER_DATA_SIZE; +int logsink; ++struct udev *udev; ++ ++extern struct config *get_multipath_config(void); ++struct config *get_multipath_config(void) ++{ ++ return multipath_conf; ++} ++ ++extern void put_multipath_config(struct config *conf); ++void put_multipath_config(struct config *conf) ++{ ++} + +static void multipath_pr_init(void) +{ -+ static struct udev *udev; -+ + udev = udev_new(); -+ mpath_lib_init(udev); ++ multipath_conf = mpath_lib_init(); +} + +static int is_mpath(int fd) diff --git a/qemu-pr-helper.socket b/qemu-pr-helper.socket index 6391c3d..9d7c3e5 100644 --- a/qemu-pr-helper.socket +++ b/qemu-pr-helper.socket @@ -3,6 +3,7 @@ Description=Persistent Reservation Daemon for QEMU [Socket] ListenStream=/run/qemu-pr-helper.sock +SocketMode=0600 [Install] WantedBy=multi-user.target diff --git a/qemu.spec b/qemu.spec index d7bd739..e87fbb0 100644 --- a/qemu.spec +++ b/qemu.spec @@ -107,7 +107,7 @@ Requires: %{name}-block-ssh = %{epoch}:%{version}-%{release} Summary: QEMU is a FAST! processor emulator Name: qemu Version: 2.10.0 -Release: 6%{?rcrel}%{?dist} +Release: 7%{?rcrel}%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1144,6 +1144,7 @@ run_configure \ --enable-modules \ --audio-drv-list=pa,sdl,alsa,oss \ --tls-priority=@QEMU,SYSTEM \ + --enable-mpath \ %{spiceflag} \ --with-sdlabi="2.0" \ --with-gtkabi="3.0" @@ -1184,6 +1185,7 @@ run_configure \ --disable-nettle \ --disable-cap-ng \ --disable-brlapi \ + --disable-mpath \ --disable-libnfs make V=1 %{?_smp_mflags} $buildldflags @@ -2027,6 +2029,11 @@ getent passwd qemu >/dev/null || \ %changelog +* Tue Oct 17 2017 Paolo Bonzini - 2:2.10.0-7 +- Update patch 1014 for new libmultipath/libmpathpersist API +- Force build to fail if multipath is not available +- Tighten permissions on the qemu-pr-helper socket + * Mon Oct 9 2017 Daniel P. Berrange - 2:2.10.0-6 - Rebuild for libiscsi changed soname again