From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206301299997.7907191458421; Tue, 8 Aug 2017 08:31:41 -0700 (PDT) Received: from localhost ([::1]:43201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6Ts-0002yt-0H for importer@patchew.org; Tue, 08 Aug 2017 11:31:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6S4-00016r-GE for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6S1-0006dd-CG for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41612) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S1-0006dB-32 for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DB766148D for ; Tue, 8 Aug 2017 15:29:44 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85A3370958 for ; Tue, 8 Aug 2017 15:29:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1DB766148D Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:33 +0200 Message-Id: <20170808152941.11247-2-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 08 Aug 2017 15:29:44 +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] [PULL 1/9] rcu: completely disable pthread_atfork callbacks as soon as possible 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: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Because of -daemonize, system mode QEMU sometimes needs to fork() and keep RCU enabled in the child. However, there is a possible deadlock with synchronize_rcu: - the CPU thread is inside a RCU critical section and wants to take the BQL in order to do MMIO - the monitor thread, which is owning the BQL, calls rcu_init_lock which tries to take the rcu_sync_lock - the call_rcu thread has taken rcu_sync_lock in synchronize_rcu, but synchronize_rcu needs the CPU thread to end the critical section before returning. This cannot happen for user-mode emulation, because it does not have a BQL. To fix it, assume that system mode QEMU only forks in preparation for exec (except when daemonizing) and disable pthread_atfork as soon as the double fork has happened. Reported-by: Dr. David Alan Gilbert Tested-by: Dr. David Alan Gilbert Signed-off-by: Paolo Bonzini --- include/qemu/rcu.h | 6 ++++++ util/rcu.c | 20 ++++++++++++++++++++ vl.c | 1 + 3 files changed, 27 insertions(+) diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h index 83ae2808be..c0da9907e8 100644 --- a/include/qemu/rcu.h +++ b/include/qemu/rcu.h @@ -105,6 +105,12 @@ extern void synchronize_rcu(void); */ extern void rcu_register_thread(void); extern void rcu_unregister_thread(void); + +/* + * Support for fork(). fork() support is enabled at startup. + */ +extern void rcu_enable_atfork(void); +extern void rcu_disable_atfork(void); extern void rcu_after_fork(void); =20 struct rcu_head; diff --git a/util/rcu.c b/util/rcu.c index 9adc5e4a36..2142ddd93b 100644 --- a/util/rcu.c +++ b/util/rcu.c @@ -318,15 +318,35 @@ static void rcu_init_complete(void) rcu_register_thread(); } =20 +static int atfork_depth =3D 1; + +void rcu_enable_atfork(void) +{ + atfork_depth++; +} + +void rcu_disable_atfork(void) +{ + atfork_depth--; +} + #ifdef CONFIG_POSIX static void rcu_init_lock(void) { + if (atfork_depth < 1) { + return; + } + qemu_mutex_lock(&rcu_sync_lock); qemu_mutex_lock(&rcu_registry_lock); } =20 static void rcu_init_unlock(void) { + if (atfork_depth < 1) { + return; + } + qemu_mutex_unlock(&rcu_registry_lock); qemu_mutex_unlock(&rcu_sync_lock); } diff --git a/vl.c b/vl.c index 99fcfa0442..8967115514 100644 --- a/vl.c +++ b/vl.c @@ -4121,6 +4121,7 @@ int main(int argc, char **argv, char **envp) set_memory_options(&ram_slots, &maxram_size, machine_class); =20 os_daemonize(); + rcu_disable_atfork(); =20 if (pid_file && qemu_create_pidfile(pid_file) !=3D 0) { error_report("could not acquire pid file: %s", strerror(errno)); --=20 2.13.3 From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206473142178.07472867794445; Tue, 8 Aug 2017 08:34:33 -0700 (PDT) Received: from localhost ([::1]:43210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6Wd-0005pT-OD for importer@patchew.org; Tue, 08 Aug 2017 11:34:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6S4-00016v-HY for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6S2-0006eF-BS for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47248) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S2-0006ds-5Q for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:46 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 218D278EC2 for ; Tue, 8 Aug 2017 15:29:45 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B68C7770E for ; Tue, 8 Aug 2017 15:29:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 218D278EC2 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:34 +0200 Message-Id: <20170808152941.11247-3-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 08 Aug 2017 15:29:45 +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] [PULL 2/9] Revert "rcu: do not create thread in pthread_atfork callback" 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: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This reverts commit a59629fcc6f603e19b516dc08f75334e5c480bd0. This is not needed anymore because the IOThread mutex is not "magic" anymore (need not kick the CPU thread)and also because fork callbacks are only enabled at the very beginning of QEMU's execution. Signed-off-by: Paolo Bonzini --- include/qemu/rcu.h | 1 - linux-user/syscall.c | 1 - os-posix.c | 2 -- util/rcu.c | 10 +++++++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/qemu/rcu.h b/include/qemu/rcu.h index c0da9907e8..f19413d649 100644 --- a/include/qemu/rcu.h +++ b/include/qemu/rcu.h @@ -111,7 +111,6 @@ extern void rcu_unregister_thread(void); */ extern void rcu_enable_atfork(void); extern void rcu_disable_atfork(void); -extern void rcu_after_fork(void); =20 struct rcu_head; typedef void RCUCBFunc(struct rcu_head *head); diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 54343c06be..9b6364a266 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6354,7 +6354,6 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, ret =3D fork(); if (ret =3D=3D 0) { /* Child Process. */ - rcu_after_fork(); cpu_clone_regs(env, newsp); fork_end(1); /* There is a race condition here. The parent process could diff --git a/os-posix.c b/os-posix.c index c6ddb7d830..92e9d85215 100644 --- a/os-posix.c +++ b/os-posix.c @@ -34,7 +34,6 @@ #include "sysemu/sysemu.h" #include "net/slirp.h" #include "qemu-options.h" -#include "qemu/rcu.h" #include "qemu/error-report.h" #include "qemu/log.h" #include "qemu/cutils.h" @@ -249,7 +248,6 @@ void os_daemonize(void) signal(SIGTSTP, SIG_IGN); signal(SIGTTOU, SIG_IGN); signal(SIGTTIN, SIG_IGN); - rcu_after_fork(); } } =20 diff --git a/util/rcu.c b/util/rcu.c index 2142ddd93b..ca5a63e36a 100644 --- a/util/rcu.c +++ b/util/rcu.c @@ -350,18 +350,22 @@ static void rcu_init_unlock(void) qemu_mutex_unlock(&rcu_registry_lock); qemu_mutex_unlock(&rcu_sync_lock); } -#endif =20 -void rcu_after_fork(void) +static void rcu_init_child(void) { + if (atfork_depth < 1) { + return; + } + memset(®istry, 0, sizeof(registry)); rcu_init_complete(); } +#endif =20 static void __attribute__((__constructor__)) rcu_init(void) { #ifdef CONFIG_POSIX - pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_unlock); + pthread_atfork(rcu_init_lock, rcu_init_unlock, rcu_init_child); #endif rcu_init_complete(); } --=20 2.13.3 From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206470825390.8172436531694; Tue, 8 Aug 2017 08:34:30 -0700 (PDT) Received: from localhost ([::1]:43209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6Wb-0005n0-DQ for importer@patchew.org; Tue, 08 Aug 2017 11:34:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6S4-00016x-Jh for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6S3-0006eo-Bz for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2113) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S3-0006eL-3a for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:47 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11BBF356FD; Tue, 8 Aug 2017 15:29:46 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DD227095B; Tue, 8 Aug 2017 15:29:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 11BBF356FD Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:35 +0200 Message-Id: <20170808152941.11247-4-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 08 Aug 2017 15:29:46 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 3/9] kvm: workaround build break on gcc-7.1.1 / fedora26 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: Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Greg Kurz Building QEMU on fedora26 with the latest gcc package fails: CC ppc64-softmmu/target/ppc/kvm.o In file included from include/sysemu/hw_accel.h:16:0, from target/ppc/kvm.c:31: target/ppc/kvm.c: In function =C3=A2=E2=82=AC=CB=9Ckvmppc_booke_watchdog_en= able=C3=A2=E2=82=AC=E2=84=A2: include/sysemu/kvm.h:449:35: error: =C3=A2=E2=82=AC=CB=9Cargs_tmp[i]=C3=A2= =E2=82=AC=E2=84=A2 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] cap.args[i] =3D args_tmp[i]; \ ^ target/ppc/kvm.c: In function =C3=A2=E2=82=AC=CB=9Ckvmppc_set_papr=C3=A2=E2= =82=AC=E2=84=A2: include/sysemu/kvm.h:449:35: error: =C3=A2=E2=82=AC=CB=9Cargs_tmp[i]=C3=A2= =E2=82=AC=E2=84=A2 may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] cc1: all warnings being treated as errors $ rpm -q gcc gcc-7.1.1-3.fc26.ppc64le The compiler should obviously optimize this code away when no extra agument is passed to kvm_vm_enable_cap() and kvm_vcpu_enable_cap(), but it doesn't. This bug should be fixed one day in gcc, but we can also change our code pattern so that we don't hit the issue anymore. We workaround this, by using memcpy() instead of open-coding the copy. Signed-off-by: Greg Kurz Message-Id: <150210580404.1343.7325713896658799315.stgit@bahia.lan> Acked-by: Cornelia Huck Signed-off-by: Paolo Bonzini --- include/sysemu/kvm.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 91fc07ee9a..3a458f50e9 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -428,11 +428,8 @@ int kvm_vm_check_extension(KVMState *s, unsigned int e= xtension); .flags =3D cap_flags, \ }; \ uint64_t args_tmp[] =3D { __VA_ARGS__ }; \ - int i; \ - for (i =3D 0; i < (int)ARRAY_SIZE(args_tmp) && \ - i < ARRAY_SIZE(cap.args); i++) { \ - cap.args[i] =3D args_tmp[i]; \ - } \ + size_t n =3D MIN(ARRAY_SIZE(args_tmp), ARRAY_SIZE(cap.args)); \ + memcpy(cap.args, args_tmp, n * sizeof(cap.args[0])); \ kvm_vm_ioctl(s, KVM_ENABLE_CAP, &cap); \ }) =20 @@ -443,11 +440,8 @@ int kvm_vm_check_extension(KVMState *s, unsigned int e= xtension); .flags =3D cap_flags, \ }; \ uint64_t args_tmp[] =3D { __VA_ARGS__ }; \ - int i; \ - for (i =3D 0; i < (int)ARRAY_SIZE(args_tmp) && \ - i < ARRAY_SIZE(cap.args); i++) { \ - cap.args[i] =3D args_tmp[i]; \ - } \ + size_t n =3D MIN(ARRAY_SIZE(args_tmp), ARRAY_SIZE(cap.args)); \ + memcpy(cap.args, args_tmp, n * sizeof(cap.args[0])); \ kvm_vcpu_ioctl(cpu, KVM_ENABLE_CAP, &cap); \ }) =20 --=20 2.13.3 From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206628562615.0474507158042; Tue, 8 Aug 2017 08:37:08 -0700 (PDT) Received: from localhost ([::1]:43230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6Z9-0008CH-3j for importer@patchew.org; Tue, 08 Aug 2017 11:37:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6S5-00017r-Is for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6S4-0006fZ-GU for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57892) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S4-0006f3-AE for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:48 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C5D837E67; Tue, 8 Aug 2017 15:29:47 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FF6670944; Tue, 8 Aug 2017 15:29:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C5D837E67 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:36 +0200 Message-Id: <20170808152941.11247-5-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 08 Aug 2017 15:29:47 +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] [PULL 4/9] scsi: clarify sense codes for LUN0 emulation 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: Hannes Reinecke , Hannes Reinecke 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" From: Hannes Reinecke The LUN0 emulation is just that, an emulation for a non-existing LUN0. So we should be returning LUN_NOT_SUPPORTED for any request coming from any other LUN. And we should be aborting unhandled commands with INVALID OPCODE, not LUN NOT SUPPORTED. Signed-off-by: Hannes Reinecke Message-Id: <1501835795-92331-4-git-send-email-hare@suse.de> Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 23c51de66a..e364410a23 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -517,6 +517,11 @@ static int32_t scsi_target_send_command(SCSIRequest *r= eq, uint8_t *buf) { SCSITargetReq *r =3D DO_UPCAST(SCSITargetReq, req, req); =20 + if (req->lun !=3D 0) { + scsi_req_build_sense(req, SENSE_CODE(LUN_NOT_SUPPORTED)); + scsi_req_complete(req, CHECK_CONDITION); + return 0; + } switch (buf[0]) { case REPORT_LUNS: if (!scsi_target_emulate_report_luns(r)) { @@ -542,7 +547,7 @@ static int32_t scsi_target_send_command(SCSIRequest *re= q, uint8_t *buf) case TEST_UNIT_READY: break; default: - scsi_req_build_sense(req, SENSE_CODE(LUN_NOT_SUPPORTED)); + scsi_req_build_sense(req, SENSE_CODE(INVALID_OPCODE)); scsi_req_complete(req, CHECK_CONDITION); return 0; illegal_request: --=20 2.13.3 From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206340071497.8770003746712; Tue, 8 Aug 2017 08:32:20 -0700 (PDT) Received: from localhost ([::1]:43204 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6UU-00044V-Dr for importer@patchew.org; Tue, 08 Aug 2017 11:32:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6S6-00018g-Pf for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6S5-0006gb-KH for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S5-0006fy-DL for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:49 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B9708123A; Tue, 8 Aug 2017 15:29:48 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A61D70944; Tue, 8 Aug 2017 15:29:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6B9708123A Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:37 +0200 Message-Id: <20170808152941.11247-6-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 08 Aug 2017 15:29:48 +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] [PULL 5/9] target/i386: set rip_offset for some SSE4.1 instructions 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: Joseph Myers 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" From: Joseph Myers When emulating various SSE4.1 instructions such as pinsrd, the address of a memory operand is computed without allowing for the 8-bit immediate operand located after the memory operand, meaning that the memory operand uses the wrong address in the case where it is rip-relative. This patch adds the required rip_offset setting for those instructions, so fixing some GCC test failures (13 in the gcc testsuite in my GCC 6-based testing) when testing with a default CPU setting enabling those instructions. Signed-off-by: Joseph Myers Message-Id: Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index cab9e32f91..5fdadf98cf 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4080,6 +4080,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s= , int b, if (sse_fn_eppi =3D=3D SSE_SPECIAL) { ot =3D mo_64_32(s->dflag); rm =3D (modrm & 7) | REX_B(s); + s->rip_offset =3D 1; if (mod !=3D 3) gen_lea_modrm(env, s, modrm); reg =3D ((modrm >> 3) & 7) | rex_r; --=20 2.13.3 From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206306782927.8175230866683; Tue, 8 Aug 2017 08:31:46 -0700 (PDT) Received: from localhost ([::1]:43203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6Tv-00033f-RC for importer@patchew.org; Tue, 08 Aug 2017 11:31:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6S8-00019y-2s for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6S6-0006hK-P1 for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56464) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S6-0006go-Fu for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8158A356EC for ; Tue, 8 Aug 2017 15:29:49 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id BAF5270944; Tue, 8 Aug 2017 15:29:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8158A356EC Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:38 +0200 Message-Id: <20170808152941.11247-7-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 08 Aug 2017 15:29:49 +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] [PULL 6/9] qemu-img: Sort sub-command names 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: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake 'amend' and 'create' were not listed alphabetically; hoist them earlier. Separate the @end table block to make it easier to copy-and-paste the addition of future sub-commands. Signed-off-by: Eric Blake Message-Id: <20170803163353.19558-2-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-img-cmds.hx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 3763f13625..b47d409665 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -1,3 +1,4 @@ +HXCOMM Keep the list of subcommands sorted by name. HXCOMM Use DEFHEADING() to define headings in both help text and texi HXCOMM Text between STEXI and ETEXI are copied to texi version and HXCOMM discarded from C version @@ -9,6 +10,12 @@ STEXI @table @option ETEXI =20 +DEF("amend", img_amend, + "amend [--object objectdef] [--image-opts] [-p] [-q] [-f fmt] [-t cach= e] -o options filename") +STEXI +@item amend [--object @var{objectdef}] [--image-opts] [-p] [-q] [-f @var{f= mt}] [-t @var{cache}] -o @var{options} @var{filename} +ETEXI + DEF("bench", img_bench, "bench [-c count] [-d depth] [-f fmt] [--flush-interval=3Dflush_interv= al] [-n] [--no-drain] [-o offset] [--pattern=3Dpattern] [-q] [-s buffer_siz= e] [-S step_size] [-t cache] [-w] [-U] filename") STEXI @@ -21,12 +28,6 @@ STEXI @item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] = [--output=3D@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{f= ilename} ETEXI =20 -DEF("create", img_create, - "create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backi= ng_fmt] [-u] [-o options] filename [size]") -STEXI -@item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backi= ng_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@v= ar{size}] -ETEXI - DEF("commit", img_commit, "commit [-q] [--object objectdef] [--image-opts] [-f fmt] [-t cache] [= -b base] [-d] [-p] filename") STEXI @@ -45,6 +46,12 @@ STEXI @item convert [--object @var{objectdef}] [--image-opts] [--target-image-op= ts] [-U] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_c= ache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-s= @var{snapshot_id_or_name}] [-l @var{snapshot_param}] [-S @var{sparse_size}= ] [-m @var{num_coroutines}] [-W] @var{filename} [@var{filename2} [...]] @va= r{output_filename} ETEXI =20 +DEF("create", img_create, + "create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backi= ng_fmt] [-u] [-o options] filename [size]") +STEXI +@item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backi= ng_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@v= ar{size}] +ETEXI + DEF("dd", img_dd, "dd [--image-opts] [-U] [-f fmt] [-O output_fmt] [bs=3Dblock_size] [co= unt=3Dblocks] [skip=3Dblocks] if=3Dinput of=3Doutput") STEXI @@ -87,9 +94,6 @@ STEXI @item resize [--object @var{objectdef}] [--image-opts] [-q] @var{filename}= [+ | -]@var{size} ETEXI =20 -DEF("amend", img_amend, - "amend [--object objectdef] [--image-opts] [-p] [-q] [-f fmt] [-t cach= e] -o options filename") STEXI -@item amend [--object @var{objectdef}] [--image-opts] [-p] [-q] [-f @var{f= mt}] [-t @var{cache}] -o @var{options} @var{filename} @end table ETEXI --=20 2.13.3 From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206473268363.74026197172327; Tue, 8 Aug 2017 08:34:33 -0700 (PDT) Received: from localhost ([::1]:43211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6We-0005pu-35 for importer@patchew.org; Tue, 08 Aug 2017 11:34:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6S8-0001B7-SM for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6S7-0006i6-SR for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47606) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S7-0006hV-Lz for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94E867C82F for ; Tue, 8 Aug 2017 15:29:50 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF29F7095C; Tue, 8 Aug 2017 15:29:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 94E867C82F Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:39 +0200 Message-Id: <20170808152941.11247-8-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 08 Aug 2017 15:29:50 +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] [PULL 7/9] qemu-io: Give more --version information 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: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake Include the package version information (useful for detecting builds from git or downstream backports), and the copyright notice. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange Acked-by: Kevin Wolf Message-Id: <20170803163353.19558-3-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qemu-io.c b/qemu-io.c index 4cfa41c8f9..ec175630a6 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -26,6 +26,7 @@ #include "block/block_int.h" #include "trace/control.h" #include "crypto/init.h" +#include "qemu-version.h" =20 #define CMD_NOFILE_OK 0x01 =20 @@ -522,7 +523,8 @@ int main(int argc, char **argv) trace_file =3D trace_opt_parse(optarg); break; case 'V': - printf("%s version %s\n", progname, QEMU_VERSION); + printf("%s version " QEMU_VERSION QEMU_PKGVERSION "\n" + QEMU_COPYRIGHT "\n", progname); exit(0); case 'h': usage(progname); --=20 2.13.3 From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206766436979.5973443301464; Tue, 8 Aug 2017 08:39:26 -0700 (PDT) Received: from localhost ([::1]:43242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6bN-0001bC-6x for importer@patchew.org; Tue, 08 Aug 2017 11:39:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6S9-0001CW-TZ for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6S8-0006ic-Ry for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34388) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S8-0006iE-LR for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:52 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A4EC5A792 for ; Tue, 8 Aug 2017 15:29:51 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3ABD70944; Tue, 8 Aug 2017 15:29:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A4EC5A792 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:40 +0200 Message-Id: <20170808152941.11247-9-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 08 Aug 2017 15:29:51 +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] [PULL 8/9] qga: Give more --version information 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: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake Include the package version information (useful for detecting builds from git or downstream backports), and the copyright notice. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange Message-Id: <20170803163353.19558-4-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- qga/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qga/main.c b/qga/main.c index 1b381d0bf3..b64c7ac2a2 100644 --- a/qga/main.c +++ b/qga/main.c @@ -29,6 +29,7 @@ #include "qemu/help_option.h" #include "qemu/sockets.h" #include "qemu/systemd.h" +#include "qemu-version.h" #ifdef _WIN32 #include "qga/service-win32.h" #include "qga/vss-win32.h" @@ -213,7 +214,8 @@ static void usage(const char *cmd) { printf( "Usage: %s [-m -p ] []\n" -"QEMU Guest Agent %s\n" +"QEMU Guest Agent " QEMU_VERSION QEMU_PKGVERSION "\n" +QEMU_COPYRIGHT "\n" "\n" " -m, --method transport method: one of unix-listen, virtio-serial,\= n" " isa-serial, or vsock-listen (virtio-serial is the def= ault)\n" @@ -248,7 +250,7 @@ static void usage(const char *cmd) " -h, --help display this help and exit\n" "\n" "Report bugs to \n" - , cmd, QEMU_VERSION, QGA_VIRTIO_PATH_DEFAULT, QGA_SERIAL_PATH_DEFAULT, + , cmd, QGA_VIRTIO_PATH_DEFAULT, QGA_SERIAL_PATH_DEFAULT, dfl_pathnames.pidfile, #ifdef CONFIG_FSFREEZE QGA_FSFREEZE_HOOK_DEFAULT, --=20 2.13.3 From nobody Sun Apr 28 10:09:56 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.zohomail.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 1502206511550552.450577024264; Tue, 8 Aug 2017 08:35:11 -0700 (PDT) Received: from localhost ([::1]:43212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6XG-0006Lf-0s for importer@patchew.org; Tue, 08 Aug 2017 11:35:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1df6SD-0001Iy-Vl for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1df6SA-0006kX-1w for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47798) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1df6S9-0006im-Mw for qemu-devel@nongnu.org; Tue, 08 Aug 2017 11:29:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B6AE178EC2 for ; Tue, 8 Aug 2017 15:29:52 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-116-237.ams2.redhat.com [10.36.116.237]) by smtp.corp.redhat.com (Postfix) with ESMTP id F2D5860A9D; Tue, 8 Aug 2017 15:29:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B6AE178EC2 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 8 Aug 2017 17:29:41 +0200 Message-Id: <20170808152941.11247-10-pbonzini@redhat.com> In-Reply-To: <20170808152941.11247-1-pbonzini@redhat.com> References: <20170808152941.11247-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 08 Aug 2017 15:29:52 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL 9/9] maint: Include bug-reporting info in --help output 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: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Eric Blake These days, many programs are including a bug-reporting address, or better yet, a link to the project web site, at the tail of their --help output. However, we were not very consistent at doing so: only qemu-nbd and qemu-qa mentioned anything, with the latter pointing to an individual person instead of the project. Add a new #define that sets up a uniform string, mentioning both bug reporting instructions and overall project details, and which a downstream vendor could tweak if they want bugs to go to a downstream database. Then use it in all of our binaries which have --help output. The canned text intentionally references http:// instead of https:// because our https website currently causes certificate errors in some browsers. That can be tweaked later once we have resolved the web site issued. Signed-off-by: Eric Blake Reviewed-by: Daniel P. Berrange Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20170803163353.19558-5-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- bsd-user/main.c | 2 ++ include/qemu-common.h | 5 +++++ linux-user/main.c | 4 +++- qemu-img.c | 2 +- qemu-io.c | 5 +++-- qemu-nbd.c | 2 +- qga/main.c | 2 +- vl.c | 4 +++- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 501e16f675..8a6706a1c8 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -686,6 +686,8 @@ static void usage(void) " -E var1=3Dval2 -E var2=3Dval2 -U LD_PRELOAD -U LD_DEBUG\n" "Note that if you provide several changes to single variable\n" "last change will stay in effect.\n" + "\n" + QEMU_HELP_BOTTOM "\n" , TARGET_NAME, interp_prefix, diff --git a/include/qemu-common.h b/include/qemu-common.h index b5adbfa5e9..0456c79df4 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -22,6 +22,11 @@ #define QEMU_COPYRIGHT "Copyright (c) 2003-2017 " \ "Fabrice Bellard and the QEMU Project developers" =20 +/* Bug reporting information for --help arguments, About dialogs, etc */ +#define QEMU_HELP_BOTTOM \ + "See for how to report bugs.= \n" \ + "More information on the QEMU project at ." + /* main function, renamed */ #if defined(CONFIG_COCOA) int qemu_main(int argc, char **argv, char **envp); diff --git a/linux-user/main.c b/linux-user/main.c index 2b38d39d87..03666ef657 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4136,7 +4136,9 @@ static void usage(int exitcode) " -E var1=3Dval2,var2=3Dval2 -U LD_PRELOAD,LD_DEBUG\n" " QEMU_SET_ENV=3Dvar1=3Dval2,var2=3Dval2 QEMU_UNSET_ENV=3DLD= _PRELOAD,LD_DEBUG\n" "Note that if you provide several changes to a single variable\= n" - "the last change will stay in effect.\n"); + "the last change will stay in effect.\n" + "\n" + QEMU_HELP_BOTTOM "\n"); =20 exit(exitcode); } diff --git a/qemu-img.c b/qemu-img.c index f4d5f0d77d..56ef49e214 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -201,7 +201,7 @@ static void QEMU_NORETURN help(void) =20 printf("%s\nSupported formats:", help_msg); bdrv_iterate_format(format_print, NULL); - printf("\n"); + printf("\n\n" QEMU_HELP_BOTTOM "\n"); exit(EXIT_SUCCESS); } =20 diff --git a/qemu-io.c b/qemu-io.c index ec175630a6..265445ad89 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -262,8 +262,9 @@ static void usage(const char *name) " -h, --help display this help and exit\n" " -V, --version output version information and exit\n" "\n" -"See '%s -c help' for information on available commands." -"\n", +"See '%s -c help' for information on available commands.\n" +"\n" +QEMU_HELP_BOTTOM "\n", name, name); } =20 diff --git a/qemu-nbd.c b/qemu-nbd.c index b8666bb575..27164b8205 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -123,7 +123,7 @@ static void usage(const char *name) " --detect-zeroes=3DMODE set detect-zeroes mode (off, on, unmap)\n" " --image-opts treat FILE as a full set of image options\n" "\n" -"Report bugs to \n" +QEMU_HELP_BOTTOM "\n" , name, NBD_DEFAULT_PORT, "DEVICE"); } =20 diff --git a/qga/main.c b/qga/main.c index b64c7ac2a2..62a62755bd 100644 --- a/qga/main.c +++ b/qga/main.c @@ -249,7 +249,7 @@ QEMU_COPYRIGHT "\n" " options / command-line parameters to stdout\n" " -h, --help display this help and exit\n" "\n" -"Report bugs to \n" +QEMU_HELP_BOTTOM "\n" , cmd, QGA_VIRTIO_PATH_DEFAULT, QGA_SERIAL_PATH_DEFAULT, dfl_pathnames.pidfile, #ifdef CONFIG_FSFREEZE diff --git a/vl.c b/vl.c index 8967115514..8e247cc2a2 100644 --- a/vl.c +++ b/vl.c @@ -1942,7 +1942,9 @@ static void help(int exitcode) "ctrl-alt-n switch to virtual console 'n'\n" "ctrl-alt toggle mouse and keyboard grab\n" "\n" - "When using -nographic, press 'ctrl-a h' to get some help.\n"); + "When using -nographic, press 'ctrl-a h' to get some help.\n" + "\n" + QEMU_HELP_BOTTOM "\n"); =20 exit(exitcode); } --=20 2.13.3