]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Introduce pr_helper to qemu.conf
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 15 Dec 2017 09:42:40 +0000 (10:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 11 May 2018 07:02:56 +0000 (09:02 +0200)
Just like we allow users overriding path to bridge-helper
detected at compile time we can allow them to override path to
qemu-pr-helper.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
m4/virt-driver-qemu.m4
src/qemu/libvirtd_qemu.aug
src/qemu/qemu.conf
src/qemu/qemu_conf.c
src/qemu/qemu_conf.h
src/qemu/test_libvirtd_qemu.aug.in

index b9bafdab90f1f00b2190eda1d14d622bfefa26de..80e1d3ad46d9d93782d1f04e91efa80b16c4a705 100644 (file)
@@ -57,6 +57,11 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [
                [/usr/libexec:/usr/lib/qemu:/usr/lib])
   AC_DEFINE_UNQUOTED([QEMU_BRIDGE_HELPER], ["$QEMU_BRIDGE_HELPER"],
                      [QEMU bridge helper])
+  AC_PATH_PROG([QEMU_PR_HELPER], [qemu-pr-helper],
+               [/usr/bin/qemu-pr-helper],
+               [/usr/bin:/usr/libexec])
+  AC_DEFINE_UNQUOTED([QEMU_PR_HELPER], ["$QEMU_PR_HELPER"],
+                     [QEMU PR helper])
 ])
 
 AC_DEFUN([LIBVIRT_DRIVER_RESULT_QEMU], [
index c19bf3a43ace747a89f708d25bc6ee8422faf6ea..2dc16e91fd8d6c1003721179873ae41ac8228e40 100644 (file)
@@ -86,6 +86,7 @@ module Libvirtd_qemu =
    let process_entry = str_entry "hugetlbfs_mount"
                  | bool_entry "clear_emulator_capabilities"
                  | str_entry "bridge_helper"
+                 | str_entry "pr_helper"
                  | bool_entry "set_process_name"
                  | int_entry "max_processes"
                  | int_entry "max_files"
index 34441857bd420515175abe8a1ecc7dd094a24cd7..31738ff19cfc61fde0bfb08fcf6aa9f5650a7151 100644 (file)
 # This directory is used for memoryBacking source if configured as file.
 # NOTE: big files will be stored here
 #memory_backing_dir = "/var/lib/libvirt/qemu/ram"
+
+# Path to the SCSI persistent reservations helper. This helper is
+# used whenever <reservations/> are enabled for SCSI LUN devices.
+#pr_helper = "/usr/bin/qemu-pr-helper"
index bfbb572f01cf231f73fa30bbd58c9d060b121e57..277ab833a88d0fee7a093f969ddaa8d0d6bd34b6 100644 (file)
@@ -302,7 +302,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
             goto error;
     }
 
-    if (VIR_STRDUP(cfg->bridgeHelperName, QEMU_BRIDGE_HELPER) < 0)
+    if (VIR_STRDUP(cfg->bridgeHelperName, QEMU_BRIDGE_HELPER) < 0 ||
+        VIR_STRDUP(cfg->prHelperName, QEMU_PR_HELPER) < 0)
         goto error;
 
     cfg->clearEmulatorCapabilities = true;
@@ -387,6 +388,7 @@ static void virQEMUDriverConfigDispose(void *obj)
     }
     VIR_FREE(cfg->hugetlbfs);
     VIR_FREE(cfg->bridgeHelperName);
+    VIR_FREE(cfg->prHelperName);
 
     VIR_FREE(cfg->saveImageFormat);
     VIR_FREE(cfg->dumpImageFormat);
@@ -754,6 +756,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
     if (virConfGetValueString(conf, "bridge_helper", &cfg->bridgeHelperName) < 0)
         goto cleanup;
 
+    if (virConfGetValueString(conf, "pr_helper", &cfg->prHelperName) < 0)
+        goto cleanup;
+
     if (virConfGetValueBool(conf, "mac_filter", &cfg->macFilter) < 0)
         goto cleanup;
 
index e1ad5463f3e0579276ddddad9dd4c2c1c1de068d..7a63780c481440b2cab40ae92dd478a637c87f6b 100644 (file)
@@ -153,6 +153,7 @@ struct _virQEMUDriverConfig {
     size_t nhugetlbfs;
 
     char *bridgeHelperName;
+    char *prHelperName;
 
     bool macFilter;
 
index 688e5b9fda3552fa37ee33c65b2f8f063b81f0ea..95885e9f06ae47d6dc591995851017901688d3c1 100644 (file)
@@ -100,3 +100,4 @@ module Test_libvirtd_qemu =
     { "1" = "mount" }
 }
 { "memory_backing_dir" = "/var/lib/libvirt/qemu/ram" }
+{ "pr_helper" = "/usr/bin/qemu-pr-helper" }