From nobody Tue Nov 4 15:31:24 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530217891691718.8731229794247; Thu, 28 Jun 2018 13:31:31 -0700 (PDT) Received: from localhost ([::1]:38422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdZi-0003bB-Tz for importer@patchew.org; Thu, 28 Jun 2018 16:31:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdAp-0007RC-9Y for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYdAo-0000mx-FC for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:47 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:46660) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYdAo-0000lb-8u for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:46 -0400 Received: by mail-wr0-x243.google.com with SMTP id t6-v6so6665863wrq.13 for ; Thu, 28 Jun 2018 13:05:46 -0700 (PDT) Received: from 640k.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id 127-v6sm6211110wmd.18.2018.06.28.13.05.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LEJpmGTR1sh04RSAdXZRZhe7n//wduG1WmzvBNmdzrg=; b=pmghTR3NdlMvs0XgCem5jUVjHJOlVaR7q8FGHyQHYZBdVTAoqHTLQUiUlfckjJLA/G 4ZmQ+voUMTu9O1cDBadQoT09GL/pjh/rCI0xXPUaRnkEOzDg4coWV/Gio/C4U/r9s6YU IXJ2jywM7IFx3LGELm5U9y/LfXmy2E8suxaCLGQvuLyeCXXxkS7WfrJ3aPW/ux14lGXr aHAULnExWhjsWCcsOWscPi4Q4x/GX+qM+gsvwVpOqBKdeTiYOfVLynJXBlc2tMLduUxE kozaZeI+ZqhWdHcaUrWYALt3mxvz1oLx1gvPMDcoU0uzOBbDC1aEv6j3HPmgjoebIje5 Yjlg== 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:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LEJpmGTR1sh04RSAdXZRZhe7n//wduG1WmzvBNmdzrg=; b=ALucBT07cSFJj9QiUM5Mj//l85isOO2TMdocE+0bIRsjcWz6oJcuhoohfDbkZzdsFl ldwoWdiXDY83Lhjy6STTw8c1yue/nzA//M2o/HRucTQMXHTIgiWNrN35A6rVoUN230MB sW34mBuyx1OSXakvQBpTfQApVGbjlXecMxKVRiOLdF7vd57Gbq4NWgWaOjIWZdjc1e+L F9sDd0GUeg4OXw42gxp6sI7c6y1DRFoKjpRTPd8E/5IGOwc4GyDrF9ZWYSBlUKaZ3HA0 rOECxeseiut4dAVzvD99KD+FE2SH5Dto2wnqLk6wmmbYwzkPkrdmGdhK4N+qOfnngwQ5 LFFw== X-Gm-Message-State: APt69E0pHjV8vAYH1VPqOlU698KONIghrBpxo+u2+yeVzBroB1hs3tuE a/CqM9XhgrVqde7PLwwi3ADkGa5Q X-Google-Smtp-Source: AAOMgpcshmBAB6domDX6ckZM0d9ZqTwAIK3SRq5/Q7V/RWlaPKSIRT8E/pdZtj1PWP8jaKEMDluNYw== X-Received: by 2002:adf:c377:: with SMTP id e52-v6mr9514204wrg.257.1530216345026; Thu, 28 Jun 2018 13:05:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2018 22:04:42 +0200 Message-Id: <1530216310-52873-33-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> References: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 32/60] 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: , 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 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: 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 d0f8317..4057cf3 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 1.8.3.1