aboutsummaryrefslogtreecommitdiff
path: root/scsi/qemu-pr-helper.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-10-17 20:11:58 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2017-10-18 10:15:09 +0200
commitb3f1c8c413bc83e4a2cc7a63e4eddf9fe6449052 (patch)
treea50eb0230fb954e63e5d4f85a3a1d2ad68947fd5 /scsi/qemu-pr-helper.c
parent306526b5de6984a164548572fd04d898dd6adbaa (diff)
downloadqemu-b3f1c8c413bc83e4a2cc7a63e4eddf9fe6449052.zip
qemu-b3f1c8c413bc83e4a2cc7a63e4eddf9fe6449052.tar.gz
qemu-b3f1c8c413bc83e4a2cc7a63e4eddf9fe6449052.tar.bz2
qemu-pr-helper: use new libmultipath API
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 <pbonzini@redhat.com>
Diffstat (limited to 'scsi/qemu-pr-helper.c')
-rw-r--r--scsi/qemu-pr-helper.c17
1 files changed, 14 insertions, 3 deletions
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)