From nobody Tue Nov 4 15:31:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15300278821361014.770233095416; Tue, 26 Jun 2018 08:44:42 -0700 (PDT) Received: from localhost ([::1]:53492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXq8w-0002cY-Am for importer@patchew.org; Tue, 26 Jun 2018 11:44:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXq57-0008Ni-C8 for qemu-devel@nongnu.org; Tue, 26 Jun 2018 11:40:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXq54-0005db-A0 for qemu-devel@nongnu.org; Tue, 26 Jun 2018 11:40:37 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:45951) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXq54-0005dE-3y for qemu-devel@nongnu.org; Tue, 26 Jun 2018 11:40:34 -0400 Received: by mail-wr0-x241.google.com with SMTP id u7-v6so2464136wrn.12 for ; Tue, 26 Jun 2018 08:40:33 -0700 (PDT) Received: from donizetti.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id y129-v6sm2308490wmy.4.2018.06.26.08.40.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jun 2018 08:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=96biIez6FAxOL31AY4N49qv0/0Av9Z2JUgt5p2MySOM=; b=oEaXfg9mnxCK75Q0dkNfIMDG/8g5P4B/LzVmJAP8J8gW2XjfBkYaBT0vsLxTpLQDg8 knBSVuV39oz2fPY2ZJG5zrlboK66C/PQHC8jzVq0yQLTpJknfGaPI8bNtnqLOlYuqVbP Sqrjc/vUP8KU0nKRB+eaRjhsNXJdTwuhchhC8KtwSK68fjG6d3GtdnInk3XggKpN2mrS r3n5UJeiztqUFewosxC/5ashYqvojEP3SmPSFHuCm8iLQKC39kb2d0SQWN65UV8imktF BeWoPl4frdFFwfhG1MeSOm5ei08n2KCsZF+3Xur70UnUcTjZ0uPxz8djSEEhksLCVcXU 95/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=96biIez6FAxOL31AY4N49qv0/0Av9Z2JUgt5p2MySOM=; b=X0XI0A86WV6uvFm0kv28iNeGn/qTBYyoAt2s3QaYv84R/dfdVXo81IAMxXpLw1CYEQ TSNgFdytcNCkxDvBmtkH7hnkxucb+ycpffnfjeT4P8tJ06Wq8G0+lLZQLXsQsiaZ7FmM x6tV+TC8ygzU4kCGJLsi0WpbZVOewI0hmll3IgNF0WO8d9zmPhVLjS0ZfqN1EIKZ3Ji8 fA9WLUYDqE1ZSVJeN54nzstY8sCZxh3KsYrv9gy/74DGY5PbccnXft+LFI2OKy1DmshV IBEq+l8G6a1Woqv3W8ix/zaUmV1Z4SAsm1Dcz/d+UdIIwPp8+hjU+0l5pKdLhcjbbuOc KseQ== X-Gm-Message-State: APt69E3eUV9KtRAG5N8SF4g2cW98bM0uO3/cQcB4zcE81nj4ciwUSpmB 1V4XuJx0Hw4MPvyfQuUDRezzOXKy X-Google-Smtp-Source: AAOMgpe2j/z2NNPTqFeidV3bUd3TQXh/ORgIUoFEKMP75bsnUv3e3Jy17pbKAWQtmax8b1zQK6UqYQ== X-Received: by 2002:adf:f50f:: with SMTP id q15-v6mr1836607wro.241.1530027632758; Tue, 26 Jun 2018 08:40:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 26 Jun 2018 17:40:24 +0200 Message-Id: <20180626154028.11133-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626154028.11133-1-pbonzini@redhat.com> References: <20180626154028.11133-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH 1/5] pr-helper: fix --socket-path default in help X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mprivozn@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Currently --help shows "(default '(null)')" for the -k/--socket-path option. Fix it by getting the default path in /var/run. Signed-off-by: Paolo Bonzini Reviewed-by: Michal Privoznik Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scsi/qemu-pr-helper.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index d0f83176e1..4057cf355c 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -74,8 +74,16 @@ static int uid =3D -1; static int gid =3D -1; #endif =20 +static void compute_default_paths(void) +{ + if (!socket_path) { + socket_path =3D qemu_get_local_state_pathname("run/qemu-pr-helper.= sock"); + } +} + static void usage(const char *name) { + compute_default_paths(); (printf) ( "Usage: %s [OPTIONS] FILE\n" "Persistent Reservation helper program for QEMU\n" @@ -845,13 +853,6 @@ static const char *socket_activation_validate_opts(voi= d) return NULL; } =20 -static void compute_default_paths(void) -{ - if (!socket_path) { - socket_path =3D qemu_get_local_state_pathname("run/qemu-pr-helper.= sock"); - } -} - static void termsig_handler(int signum) { atomic_cmpxchg(&state, RUNNING, TERMINATE); --=20 2.17.1