From nobody Fri May 3 12:00:23 2024 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.zoho.com; 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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486511948360322.4695809165006; Tue, 7 Feb 2017 15:59:08 -0800 (PST) Received: from localhost ([::1]:56963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbFf9-0000VN-2s for importer@patchew.org; Tue, 07 Feb 2017 18:59:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbFeD-0000BZ-Cp for qemu-devel@nongnu.org; Tue, 07 Feb 2017 18:58:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbFeC-0007zP-8m for qemu-devel@nongnu.org; Tue, 07 Feb 2017 18:58:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42694) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cbFe6-0007uY-GL; Tue, 07 Feb 2017 18:58:02 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3BAB7804EB; Tue, 7 Feb 2017 23:58:02 +0000 (UTC) Received: from localhost (ovpn-204-42.brq.redhat.com [10.40.204.42]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v17Nw03G006627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 7 Feb 2017 18:58:01 -0500 From: Max Reitz To: qemu-block@nongnu.org Date: Wed, 8 Feb 2017 00:57:57 +0100 Message-Id: <20170207235757.2026-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 07 Feb 2017 23:58:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] progress: Show current progress on SIGINFO 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: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Currently we only print progress information on retrieval of SIGUSR1. Some systems have a dedicated SIGINFO for this, however, so it should be handled appropriately if it is available. Buglink: https://bugs.launchpad.net/qemu/+bug/1662468 Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- Can anyone test this on a BSD system? O:-) --- util/qemu-progress.c | 3 +++ qemu-img.texi | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/util/qemu-progress.c b/util/qemu-progress.c index f745233763..3c2223c1a2 100644 --- a/util/qemu-progress.c +++ b/util/qemu-progress.c @@ -88,6 +88,9 @@ static void progress_dummy_init(void) action.sa_handler =3D sigusr_print; action.sa_flags =3D 0; sigaction(SIGUSR1, &action, NULL); +#ifdef SIGINFO + sigaction(SIGINFO, &action, NULL); +#endif =20 /* * SIGUSR1 is SIG_IPI and gets blocked in qemu_init_main_loop(). In the diff --git a/qemu-img.texi b/qemu-img.texi index 174aae38b7..b7e849b22b 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -84,7 +84,8 @@ with or without a command shows help and lists the suppor= ted formats @item -p display progress bar (compare, convert and rebase commands only). If the @var{-p} option is not used for a command that supports it, the -progress is reported when the process receives a @code{SIGUSR1} signal. +progress is reported when the process receives a @code{SIGUSR1} or +@code{SIGINFO} signal. @item -q Quiet mode - do not print any output (except errors). There's no progress = bar in case both @var{-q} and @var{-p} options are used. --=20 2.11.0