|
|
383d26 |
From ba4e622bc5d07daba8a63589124c944d6105e054 Mon Sep 17 00:00:00 2001
|
|
|
383d26 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
383d26 |
Date: Fri, 6 Jul 2018 17:56:51 +0200
|
|
|
383d26 |
Subject: [PATCH 17/89] pr-helper: fix --socket-path default in help
|
|
|
383d26 |
MIME-Version: 1.0
|
|
|
383d26 |
Content-Type: text/plain; charset=UTF-8
|
|
|
383d26 |
Content-Transfer-Encoding: 8bit
|
|
|
383d26 |
|
|
|
383d26 |
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
383d26 |
Message-id: <20180706175659.30615-2-pbonzini@redhat.com>
|
|
|
383d26 |
Patchwork-id: 81244
|
|
|
383d26 |
O-Subject: [RHEL7.6 qemu-kvm-rhev PATCH 1/9] pr-helper: fix --socket-path default in help
|
|
|
383d26 |
Bugzilla: 1533158
|
|
|
383d26 |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
383d26 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
383d26 |
RH-Acked-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
383d26 |
|
|
|
383d26 |
Currently --help shows "(default '(null)')" for the -k/--socket-path
|
|
|
383d26 |
option. Fix it by getting the default path in /var/run.
|
|
|
383d26 |
|
|
|
383d26 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
383d26 |
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
|
|
|
383d26 |
(cherry picked from commit 50fa332516d5e42695811f43396b749185e21b9c)
|
|
|
383d26 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
383d26 |
---
|
|
|
383d26 |
scsi/qemu-pr-helper.c | 15 ++++++++-------
|
|
|
383d26 |
1 file changed, 8 insertions(+), 7 deletions(-)
|
|
|
383d26 |
|
|
|
383d26 |
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
|
|
|
383d26 |
index 7a29e64..19887f5 100644
|
|
|
383d26 |
--- a/scsi/qemu-pr-helper.c
|
|
|
383d26 |
+++ b/scsi/qemu-pr-helper.c
|
|
|
383d26 |
@@ -74,8 +74,16 @@ static int uid = -1;
|
|
|
383d26 |
static int gid = -1;
|
|
|
383d26 |
#endif
|
|
|
383d26 |
|
|
|
383d26 |
+static void compute_default_paths(void)
|
|
|
383d26 |
+{
|
|
|
383d26 |
+ if (!socket_path) {
|
|
|
383d26 |
+ socket_path = qemu_get_local_state_pathname("run/qemu-pr-helper.sock");
|
|
|
383d26 |
+ }
|
|
|
383d26 |
+}
|
|
|
383d26 |
+
|
|
|
383d26 |
static void usage(const char *name)
|
|
|
383d26 |
{
|
|
|
383d26 |
+ compute_default_paths();
|
|
|
383d26 |
(printf) (
|
|
|
383d26 |
"Usage: %s [OPTIONS] FILE\n"
|
|
|
383d26 |
"Persistent Reservation helper program for QEMU\n"
|
|
|
383d26 |
@@ -834,13 +842,6 @@ static const char *socket_activation_validate_opts(void)
|
|
|
383d26 |
return NULL;
|
|
|
383d26 |
}
|
|
|
383d26 |
|
|
|
383d26 |
-static void compute_default_paths(void)
|
|
|
383d26 |
-{
|
|
|
383d26 |
- if (!socket_path) {
|
|
|
383d26 |
- socket_path = qemu_get_local_state_pathname("run/qemu-pr-helper.sock");
|
|
|
383d26 |
- }
|
|
|
383d26 |
-}
|
|
|
383d26 |
-
|
|
|
383d26 |
static void termsig_handler(int signum)
|
|
|
383d26 |
{
|
|
|
383d26 |
atomic_cmpxchg(&state, RUNNING, TERMINATE);
|
|
|
383d26 |
--
|
|
|
383d26 |
1.8.3.1
|
|
|
383d26 |
|