fix multipath qemu-pr-helper

Update patch 1014 for new libmultipath/libmpathpersist API
Force build to fail if multipath is not available
This commit is contained in:
Paolo Bonzini 2017-10-17 19:31:38 +02:00
parent 66554ce0d3
commit bb046c0072
3 changed files with 35 additions and 8 deletions

View File

@ -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 <mpath_persist.h>
+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)

View File

@ -3,6 +3,7 @@ Description=Persistent Reservation Daemon for QEMU
[Socket]
ListenStream=/run/qemu-pr-helper.sock
SocketMode=0600
[Install]
WantedBy=multi-user.target

View File

@ -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: 4%{?rcrel}%{?dist}
Release: 5%{?rcrel}%{?dist}
Epoch: 2
License: GPLv2+ and LGPLv2+ and BSD
Group: Development/Tools
@ -1133,6 +1133,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"
@ -1173,6 +1174,7 @@ run_configure \
--disable-nettle \
--disable-cap-ng \
--disable-brlapi \
--disable-mpath \
--disable-libnfs
make V=1 %{?_smp_mflags} $buildldflags
@ -2016,6 +2018,11 @@ getent passwd qemu >/dev/null || \
%changelog
* Tue Oct 17 2017 Paolo Bonzini <pbonzini@redhat.com> - 2:2.10.0-5
- 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
* Thu Sep 28 2017 Paolo Bonzini <pbonzini@redhat.com> - 2:2.10.0-4
- Stop using tcmalloc, glibc got faster