From nobody Sun May 19 06:04:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598352069; cv=none; d=zohomail.com; s=zohoarc; b=KJuMagiAWVi5IJihon3IEnEzg2n4An2R6QJ6C4eCuo/2GHAs3s3eW5vhH5TOXquTM2XwhHdzHMzVFcuJuKn99xdQVUclqyL82HAHKW4VV0jB+q0V6Id6+Ynt8DKJwOkNe2F4X24e5IXfUV2J5MKsINSuVaTP2pKuskSZDqEBkHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598352069; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MpcHxk8758d3DgHfyNyPjIbcobjL0YHSZ/QxOyHXdiQ=; b=AhrqdfLafixg9+la10HMguTPRIe9hvIyB+Jei8OjkMyzXO1174hBT4XjlYRUC8PUFw1pmZrHL5oyowWMR2dAOy/Rs2R70uMAGcVUwYpiKwZazmx2Nfc+8/I0CzXTrEbVi6oSFGtV8JUr+JJ8vUClNLw31P8560RUx1pZpTUk0e4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598352069970656.6643425012621; Tue, 25 Aug 2020 03:41:09 -0700 (PDT) Received: from localhost ([::1]:37064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAWO4-0005oh-Jx for importer@patchew.org; Tue, 25 Aug 2020 06:41:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAWM0-0002Kl-Lq for qemu-devel@nongnu.org; Tue, 25 Aug 2020 06:39:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kAWLy-0007KQ-FC for qemu-devel@nongnu.org; Tue, 25 Aug 2020 06:39:00 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-445-9dK0jJ_TOd2KG_PWW0lSbA-1; Tue, 25 Aug 2020 06:38:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA86C805EE3; Tue, 25 Aug 2020 10:38:54 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-114-231.ams2.redhat.com [10.36.114.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4800A5C1CF; Tue, 25 Aug 2020 10:38:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598351937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MpcHxk8758d3DgHfyNyPjIbcobjL0YHSZ/QxOyHXdiQ=; b=GOyf9IJ/pJujjOPYXj5+65CtGfzCt3mtjKnXS2DXg/Og4sEtNwCPL0f1gY6k6UTb3dMb8G t5Y5TqMgJfBR0LagDAWMF2dL7I3eQpXHkxFs93F0odiZsswvHdJnaOMrRFrpsV9Oam7lH/ RVJJCdh9DYxZJ/Sd62nS8b9EJZN9rA0= X-MC-Unique: 9dK0jJ_TOd2KG_PWW0lSbA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 1/3] block: add missing socket_init() calls to tools Date: Tue, 25 Aug 2020 11:38:48 +0100 Message-Id: <20200825103850.119911-2-berrange@redhat.com> In-Reply-To: <20200825103850.119911-1-berrange@redhat.com> References: <20200825103850.119911-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 02:03:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.956, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Any tool that uses sockets needs to call socket_init() in order to work on the Windows platform. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrang=C3=A9 --- qemu-img.c | 2 ++ qemu-io.c | 2 ++ qemu-nbd.c | 1 + 3 files changed, 5 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index 5308773811..eb2fc1f862 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -41,6 +41,7 @@ #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/module.h" +#include "qemu/sockets.h" #include "qemu/units.h" #include "qom/object_interfaces.h" #include "sysemu/block-backend.h" @@ -5410,6 +5411,7 @@ int main(int argc, char **argv) signal(SIGPIPE, SIG_IGN); #endif =20 + socket_init(); error_init(argv[0]); module_call_init(MODULE_INIT_TRACE); qemu_init_exec_dir(argv[0]); diff --git a/qemu-io.c b/qemu-io.c index 3adc5a7d0d..7cc832b3d6 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -25,6 +25,7 @@ #include "qemu/config-file.h" #include "qemu/readline.h" #include "qemu/log.h" +#include "qemu/sockets.h" #include "qapi/qmp/qstring.h" #include "qapi/qmp/qdict.h" #include "qom/object_interfaces.h" @@ -542,6 +543,7 @@ int main(int argc, char **argv) signal(SIGPIPE, SIG_IGN); #endif =20 + socket_init(); error_init(argv[0]); module_call_init(MODULE_INIT_TRACE); qemu_init_exec_dir(argv[0]); diff --git a/qemu-nbd.c b/qemu-nbd.c index d2657b8db5..b102874f0f 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -599,6 +599,7 @@ int main(int argc, char **argv) signal(SIGPIPE, SIG_IGN); #endif =20 + socket_init(); error_init(argv[0]); module_call_init(MODULE_INIT_TRACE); qcrypto_init(&error_fatal); --=20 2.26.2 From nobody Sun May 19 06:04:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598351999; cv=none; d=zohomail.com; s=zohoarc; b=PLwM0ZlGAMqVMiFI+RSqdhL02+h/aw7q5aO5XRLm9bFTDUql2KDN1xJciBwP/SgwkjILnfZ7nc6m1qTPAb5U62gDCTr+8J2wgE3+ChSe8lnyCTYFA7RpNM0aUTFf38Iyy2lyOQNxlGAQ6UkvhGoo5hTz19HOcIAUMfeXd4KvhBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598351999; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=arnG0ivEP7v5x89slX1na5RDOaxnf6UbNLXqzU+IsTE=; b=SZ7u4EebYjB/EAQWsOczLcRQwceiKnph2y1txZTg9H6E76Ahd+oonwxHC2MaOaVvtGDKY3ybtaZDTIfWWgRT03hhzgJYQn54T6S5DpX954b1Nzh0jtDx0ucsee22cHC7XiVKOvjcoRjPTR1jcNU8klrY4+nena2dxCbQ3+v2r04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598351999448237.9486450332638; Tue, 25 Aug 2020 03:39:59 -0700 (PDT) Received: from localhost ([::1]:60222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAWMv-0003gc-6M for importer@patchew.org; Tue, 25 Aug 2020 06:39:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAWM2-0002OB-C3 for qemu-devel@nongnu.org; Tue, 25 Aug 2020 06:39:02 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:38892 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kAWM0-0007Ku-Nv for qemu-devel@nongnu.org; Tue, 25 Aug 2020 06:39:02 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-338-dR8VrAxVNMmMYngqpsOuFA-1; Tue, 25 Aug 2020 06:38:57 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC07F1DE08; Tue, 25 Aug 2020 10:38:56 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-114-231.ams2.redhat.com [10.36.114.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53CC85C1CF; Tue, 25 Aug 2020 10:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598351939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=arnG0ivEP7v5x89slX1na5RDOaxnf6UbNLXqzU+IsTE=; b=RaW1sgEDHf89o1+HMO9hku9aHH5PNxYwF4vbbst273LsRHqPF6/nMMfpDs0CSe+CCPu+Gm 4XBXmYM5ifzbb40DIolEZHMU+urEBvs5rWyC7vq9trK9jWIopmacYZ14lKmD+9/maglzg3 h1WJbOUWj/liUeI/civKDmXP7PtqMYU= X-MC-Unique: dR8VrAxVNMmMYngqpsOuFA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 2/3] nbd: skip SIGTERM handler if NBD device support is not built Date: Tue, 25 Aug 2020 11:38:49 +0100 Message-Id: <20200825103850.119911-3-berrange@redhat.com> In-Reply-To: <20200825103850.119911-1-berrange@redhat.com> References: <20200825103850.119911-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 01:35:36 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.956, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The termsig_handler function is used by the client thread handling the host NBD device connection to do a graceful shutdown. IOW, if we have disabled NBD device support at compile time, we don't need the SIGTERM handler. This fixes a build issue for Windows. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake --- qemu-nbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index b102874f0f..dc6ef089af 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -155,12 +155,13 @@ QEMU_COPYRIGHT "\n" , name); } =20 +#if HAVE_NBD_DEVICE static void termsig_handler(int signum) { atomic_cmpxchg(&state, RUNNING, TERMINATE); qemu_notify_event(); } - +#endif /* HAVE_NBD_DEVICE */ =20 static int qemu_nbd_client_list(SocketAddress *saddr, QCryptoTLSCreds *tls, const char *hostname) @@ -587,6 +588,7 @@ int main(int argc, char **argv) unsigned socket_activation; const char *pid_file_name =3D NULL; =20 +#if HAVE_NBD_DEVICE /* The client thread uses SIGTERM to interrupt the server. A signal * handler ensures that "qemu-nbd -v -c" exits with a nice status code. */ @@ -594,6 +596,7 @@ int main(int argc, char **argv) memset(&sa_sigterm, 0, sizeof(sa_sigterm)); sa_sigterm.sa_handler =3D termsig_handler; sigaction(SIGTERM, &sa_sigterm, NULL); +#endif /* HAVE_NBD_DEVICE */ =20 #ifdef CONFIG_POSIX signal(SIGPIPE, SIG_IGN); --=20 2.26.2 From nobody Sun May 19 06:04:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598352031; cv=none; d=zohomail.com; s=zohoarc; b=cM1VrRzX5Xk3k68j0OC/jdkFETg0FT0q4KM2bUY+z6TFh27M7xaZ7OJdERg1yK9B/CK4qpv/kP224gDPuRQipMXXuo355Rb2t+UfMTq7qB6mCgLpnYZwnO0HAMtghClf8cFM0ZeBV76X1YWx9lKPxQZuYONVhw5Vj3T+mk2gluc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598352031; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8rs4O5WDQdaLYpdEr+vncfMb2NC49pMpaugYuqYsPek=; b=WiXYopiFQ8nwiGEo9pKSHAAHkMsv89uoof7v1ngL/y0DpB3ja9z5NXth1cBzA2Z6+/aY0BTvrbQyKgNxRbV/TRazVgLqeMLg64M9efo37JL8b1fJt+AhU/nOdvn3xX/VMyBSXfOyXnw/GMgXSfMPRluyfGT0jq9YT+QiD0AfCSA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159835203187573.91596717917355; Tue, 25 Aug 2020 03:40:31 -0700 (PDT) Received: from localhost ([::1]:35106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAWNS-0004zx-Ks for importer@patchew.org; Tue, 25 Aug 2020 06:40:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAWM4-0002Rk-3J for qemu-devel@nongnu.org; Tue, 25 Aug 2020 06:39:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kAWM2-0007LL-BW for qemu-devel@nongnu.org; Tue, 25 Aug 2020 06:39:03 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185--xxK4bjCM6aOKgE2VofByA-1; Tue, 25 Aug 2020 06:38:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF54180732F; Tue, 25 Aug 2020 10:38:58 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-114-231.ams2.redhat.com [10.36.114.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46FBB5C1CF; Tue, 25 Aug 2020 10:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598351941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8rs4O5WDQdaLYpdEr+vncfMb2NC49pMpaugYuqYsPek=; b=csWdgNlOMsHiSw2zyHxmrIRiM/ncEKRnJx2/eomXwpgonHn7pt73AKYhS+d7aRFowtdnYs tjB838IsiNm1JhuCd+BGuE2hS2DYqqSiOAvlaibX+7biD7ND+E03N3k0rNJh+7SlCI4YZP pSp6sZe/Z8KGb8p+QyIYdAkjA07vvks= X-MC-Unique: -xxK4bjCM6aOKgE2VofByA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 3/3] nbd: disable signals and forking on Windows builds Date: Tue, 25 Aug 2020 11:38:50 +0100 Message-Id: <20200825103850.119911-4-berrange@redhat.com> In-Reply-To: <20200825103850.119911-1-berrange@redhat.com> References: <20200825103850.119911-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/25 02:03:58 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.956, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Disabling these parts are sufficient to get the qemu-nbd program compiling in a Windows build. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake --- meson.build | 7 ++----- qemu-nbd.c | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index df5bf728b5..1071871605 100644 --- a/meson.build +++ b/meson.build @@ -1074,12 +1074,9 @@ if have_tools dependencies: [authz, block, crypto, io, qom, qemuutil], inst= all: true) qemu_io =3D executable('qemu-io', files('qemu-io.c'), dependencies: [block, qemuutil], install: true) - qemu_block_tools +=3D [qemu_img, qemu_io] - if targetos =3D=3D 'linux' or targetos =3D=3D 'sunos' or targetos.endswi= th('bsd') - qemu_nbd =3D executable('qemu-nbd', files('qemu-nbd.c'), + qemu_nbd =3D executable('qemu-nbd', files('qemu-nbd.c'), dependencies: [block, qemuutil], install: true) - qemu_block_tools +=3D [qemu_nbd] - endif + qemu_block_tools +=3D [qemu_img, qemu_io, qemu_nbd] =20 subdir('storage-daemon') subdir('contrib/rdmacm-mux') diff --git a/qemu-nbd.c b/qemu-nbd.c index dc6ef089af..33476a1000 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -899,6 +899,7 @@ int main(int argc, char **argv) #endif =20 if ((device && !verbose) || fork_process) { +#ifndef WIN32 int stderr_fd[2]; pid_t pid; int ret; @@ -962,6 +963,10 @@ int main(int argc, char **argv) */ exit(errors); } +#else /* WIN32 */ + error_report("Unable to fork into background on Windows hosts"); + exit(EXIT_FAILURE); +#endif /* WIN32 */ } =20 if (device !=3D NULL && sockpath =3D=3D NULL) { --=20 2.26.2