[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/29] qemu-pr-helper: use new libmultipath API
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 25/29] qemu-pr-helper: use new libmultipath API |
Date: |
Wed, 18 Oct 2017 18:12:17 +0200 |
libmultipath has recently changed its API. The new API supports multi-threaded
clients better. Unfortunately there is no backwards-compatibility, so we just
switch to the new one. Running QEMU compiled with the new library on the old
library will likely crash, while doing the opposite will cause QEMU not to
start at all (because udev, get_multipath_config and put_multipath_config
are undefined).
Signed-off-by: Paolo Bonzini <address@hidden>
---
configure | 12 ++++++++++--
scsi/qemu-pr-helper.c | 17 ++++++++++++++---
2 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
index 6587e80..7766e74 100755
--- a/configure
+++ b/configure
@@ -3312,9 +3312,17 @@ if test "$mpath" != "no" ; then
#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
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
index d581848..dd97851 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -276,15 +276,26 @@ static void dm_init(void)
/* 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;
-static void multipath_pr_init(void)
+extern struct config *get_multipath_config(void);
+struct config *get_multipath_config(void)
{
- static struct udev *udev;
+ return multipath_conf;
+}
+extern void put_multipath_config(struct config *conf);
+void put_multipath_config(struct config *conf)
+{
+}
+
+static void multipath_pr_init(void)
+{
udev = udev_new();
- mpath_lib_init(udev);
+ multipath_conf = mpath_lib_init();
}
static int is_mpath(int fd)
--
1.8.3.1
- [Qemu-devel] [PULL 15/29] target/i386: trap on instructions longer than >15 bytes, (continued)
- [Qemu-devel] [PULL 15/29] target/i386: trap on instructions longer than >15 bytes, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 12/29] docs/devel/loads-stores.rst: Document our various load and store APIs, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 14/29] target/i386: introduce x86_ld*_code, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 19/29] kvm: fix error message when failing to unregister slot, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 16/29] memory: call log_start after region_add, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 18/29] kvm: tolerate non-existing slot for log_start/log_stop/log_sync, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 22/29] memory: reuse section_from_flat_range(), Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 21/29] kvm: simplify kvm_align_section(), Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 20/29] kvm: region_add and region_del is not called on updates, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 24/29] watch_mem_write: implement 8-byte accesses, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 25/29] qemu-pr-helper: use new libmultipath API,
Paolo Bonzini <=
- [Qemu-devel] [PULL 27/29] Revert "qdev: Free QemuOpts when the QOM path goes away", Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 29/29] scsi: reject configurations with logical block size > physical block size, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 26/29] qdev: store DeviceState's canonical path to use when unparenting, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 23/29] notdirty_mem_write: implement 8-byte accesses, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 28/29] qdev: defer DEVICE_DEL event until instance_finalize(), Paolo Bonzini, 2017/10/18
- Re: [Qemu-devel] [PULL 00/29] Misc patches for 2017-10-18, no-reply, 2017/10/18
- Re: [Qemu-devel] [PULL 00/29] Misc patches for 2017-10-18, Peter Maydell, 2017/10/19