From nobody Sat May 18 21:45:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671268149; cv=none; d=zohomail.com; s=zohoarc; b=DJRInbZBA+IhN9TzfC6jRcrz7YVO1d+hobA2cjCJAUewOwFBXVAsOP9wAbepW212gm+A5healqPPBL8zJ5l6esMlMV8ylvYh+S3N0ox6bXipFoJnyTCjcxsm9NAq21ZnEJAerYbgF6ofznfGccIYB0AMaiDWsDGYTh4SZyooulk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671268149; h=Content-Type:Content-Transfer-Encoding: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=/wOWldWggDOZ4kHuElNJ+XnNwGIEx2lMU/r1D8mviZE=; b=aKowm0s1FEleT1fskY3MnrnoML/Rt3IsQFb/AB3pXMusOgeTbKh8iPGNdSuZ1k+CRAs4SUoRyXnW1XSUiLF+kovdZfzwqCEy9WWCoiFwjYBj6OHRvQLSoaxxXRSt+qy/kafd1dLPzX0biHZYRhA6xtIePmT+Om/4fB4Hf6wryHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671268149520877.0111002155987; Sat, 17 Dec 2022 01:09:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6TAh-0005sN-Vb; Sat, 17 Dec 2022 04:07:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAf-0005rE-Cb for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAd-0006cY-Kv for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:52 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-650--0DXhi0UN5uTgHHPdlDyLg-1; Sat, 17 Dec 2022 04:07:45 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ABA00802C1C; Sat, 17 Dec 2022 09:07:45 +0000 (UTC) Received: from kostyanf14nb.lan (ovpn-192-10.brq.redhat.com [10.40.192.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A282440BC781; Sat, 17 Dec 2022 09:07:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671268069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/wOWldWggDOZ4kHuElNJ+XnNwGIEx2lMU/r1D8mviZE=; b=eCk2nVo+4cY8c7/aKKIyRVFvhXlwbUCsH4m+6cAedyNerhT2IAsxvxWZGgrtfuFqHdnNw3 B6A4vK2GHlSIqgkmTMcunuYt29bcaxjn+Lxt3kDnyxO79fVfsjQCdsnTQUmxLrex9X/Vhm /WMTS3Us5Kl7V1AI5IW+cPrUVrSFmLE= X-MC-Unique: -0DXhi0UN5uTgHHPdlDyLg-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org, Peter Maydell , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL v2 1/6] qga:/qga-win: adding a empty PCI address creation function Date: Sat, 17 Dec 2022 11:07:35 +0200 Message-Id: <20221217090740.522093-2-kkostiuk@redhat.com> In-Reply-To: <20221217090740.522093-1-kkostiuk@redhat.com> References: <20221217090740.522093-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H2=-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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671268149722100002 From: Kfir Manor Refactoring code to avoid duplication of creating an empty PCI address code. Signed-off-by: Kfir Manor Reviewed-by: Konstantin Kostiuk Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Konstantin Kostiuk --- qga/commands-win32.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 4df50ea710..bd0f3cccfe 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -596,6 +596,18 @@ static void get_pci_address_for_device(GuestPCIAddress= *pci, } } =20 +static GuestPCIAddress *get_empty_pci_address(void) +{ + GuestPCIAddress *pci =3D NULL; + + pci =3D g_malloc0(sizeof(*pci)); + pci->domain =3D -1; + pci->slot =3D -1; + pci->function =3D -1; + pci->bus =3D -1; + return pci; +} + static GuestPCIAddress *get_pci_info(int number, Error **errp) { HDEVINFO dev_info =3D INVALID_HANDLE_VALUE; @@ -605,13 +617,7 @@ static GuestPCIAddress *get_pci_info(int number, Error= **errp) SP_DEVICE_INTERFACE_DATA dev_iface_data; HANDLE dev_file; int i; - GuestPCIAddress *pci =3D NULL; - - pci =3D g_malloc0(sizeof(*pci)); - pci->domain =3D -1; - pci->slot =3D -1; - pci->function =3D -1; - pci->bus =3D -1; + GuestPCIAddress *pci =3D get_empty_pci_address(); =20 dev_info =3D SetupDiGetClassDevs(&GUID_DEVINTERFACE_DISK, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); --=20 2.25.1 From nobody Sat May 18 21:45:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671268130; cv=none; d=zohomail.com; s=zohoarc; b=FO3zr2Np/ppQviSNSo60CkzSakMaqi0P+5WOHTlGKlWEjBnXrnLFj+O8bmEeNej/5+kjGMBvuMo/VH23zTCEWozDOOBPWz7Sr/8fif4p9VnCaQT34QrZQtKEIC/PKNPKVkUNVeLIYJZPs5fEUuQLpuAnzTdC1Cx/ZXNHzKCvHyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671268130; h=Content-Type:Content-Transfer-Encoding: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=RoglSNHRStA7iusp7Ok/OG6eExg60+j4uM7vv5xGEmg=; b=Hnori5vtfeYgWQXTq3xIzXBYrw6mYiEsCJgMRurzIAVxRtxXJNnaEzQ87C/z/sChIBCvpmY34ugsDkcrcGN2G2hYStUjnULWmtUpxxjrUaBWr4tact4b+IeictBZ1OxJRsZNORDABEgFnXhWjxOojKT7cKVA+x4FfTYbji26nQA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671268130667134.99379501384612; Sat, 17 Dec 2022 01:08:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6TAh-0005ru-Px; Sat, 17 Dec 2022 04:07:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAg-0005ra-8o for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAe-0006ck-MZ for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:54 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-4sxiopuEO1mLzkrp7Jd0jw-1; Sat, 17 Dec 2022 04:07:47 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6756D1C068DE; Sat, 17 Dec 2022 09:07:47 +0000 (UTC) Received: from kostyanf14nb.lan (ovpn-192-10.brq.redhat.com [10.40.192.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 749CB40C6EC4; Sat, 17 Dec 2022 09:07:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671268072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RoglSNHRStA7iusp7Ok/OG6eExg60+j4uM7vv5xGEmg=; b=TN4pXHC1jKRD8OcYRrSnD3O53zHHID21lZUVA3q6+IBIWyUxfMJMttBz+Xx3U1v/9b6ftc HxC9LCuQfngr6ONoU+dC8a4X7mhdwVccdhsfqYxtWWcpWRBXUD9sCIo7izLQUSBDww7DiQ D1n2Qzj1dTchrjuOW2LPTZAE/WfTZOg= X-MC-Unique: 4sxiopuEO1mLzkrp7Jd0jw-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org, Peter Maydell , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL v2 2/6] qga:/qga-win: skip getting pci info for USB disks Date: Sat, 17 Dec 2022 11:07:36 +0200 Message-Id: <20221217090740.522093-3-kkostiuk@redhat.com> In-Reply-To: <20221217090740.522093-1-kkostiuk@redhat.com> References: <20221217090740.522093-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.129.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H2=-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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671268131901100002 From: Kfir Manor Skip getting PCI info from disks type USB and give them an empty PCI addres= s instead. Signed-off-by: Kfir Manor Reviewed-by: Konstantin Kostiuk Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Konstantin Kostiuk --- qga/commands-win32.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index bd0f3cccfe..b5fee6a2cd 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -874,10 +874,14 @@ static void get_single_disk_info(int disk_number, * if that doesn't hold since that suggests some other unexpected * breakage */ - disk->pci_controller =3D get_pci_info(disk_number, &local_err); - if (local_err) { - error_propagate(errp, local_err); - goto err_close; + if (disk->bus_type =3D=3D GUEST_DISK_BUS_TYPE_USB) { + disk->pci_controller =3D get_empty_pci_address(); + } else { + disk->pci_controller =3D get_pci_info(disk_number, &local_err); + if (local_err) { + error_propagate(errp, local_err); + goto err_close; + } } if (disk->bus_type =3D=3D GUEST_DISK_BUS_TYPE_SCSI || disk->bus_type =3D=3D GUEST_DISK_BUS_TYPE_IDE --=20 2.25.1 From nobody Sat May 18 21:45:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671268185; cv=none; d=zohomail.com; s=zohoarc; b=Y3QED8sY5V3X1N75HRYAEeH3f6O25TyWelwZnyGHlH/ZqYq6LoQvvHE3t3kEj+e3lpuBzZjKhse8vPSRGOTfa8BncdDp49FiJf8K7LTSfJ6KN4Y4F7Ahp8pzp+4Kwa8FAmG/KXH8SfkYrCn1OEMnb3HSZj8zmKjgkxYh0py8X/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671268185; h=Content-Type:Content-Transfer-Encoding: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=VBNyMX+OlU77yDDpbKs/c0cqbxMQdPVs0W/gqD71INU=; b=izS+xp4AuJJ0VXG7Bpt11b774CVrZJfI7bm5u4sxFOrJCCDFBW0NimFxHwuJnSlV0AIges2+2BVuS3CUBNaO9c5LtBrGkkud2kbvSrGxcnuXQ1GkrjZ1P792GGF845n9sLCM8SL+GsoDvEQ9zOL/VJ20+W+k+HP7Orb3JDwnze4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671268185449740.2660956093162; Sat, 17 Dec 2022 01:09:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6TAi-0005t3-DR; Sat, 17 Dec 2022 04:07:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAg-0005rc-Ch for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAd-0006cc-Kv for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:54 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-116-hUiVucbVPBSNiv7mxBOdig-1; Sat, 17 Dec 2022 04:07:49 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE4A6185A794; Sat, 17 Dec 2022 09:07:48 +0000 (UTC) Received: from kostyanf14nb.lan (ovpn-192-10.brq.redhat.com [10.40.192.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2A5040C6EC4; Sat, 17 Dec 2022 09:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671268070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VBNyMX+OlU77yDDpbKs/c0cqbxMQdPVs0W/gqD71INU=; b=FN+71AhhG7f49umG7MzCmVOm7T/a+2Y26jd/aHoIbrRM1rQTAV8oHb+kJmNRnLZ3gqhQXW NSAn91WhG+wFiEliH3kDykiUkEAgSAUxt5VmclGFGGKCFLhzXmiHR54WD71+VI+9XQiW5J 5EQAFLqlHKPhfseWA+6Kf9X2SCbLP0Q= X-MC-Unique: hUiVucbVPBSNiv7mxBOdig-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org, Peter Maydell , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL v2 3/6] qga: Add initial OpenBSD and NetBSD support Date: Sat, 17 Dec 2022 11:07:37 +0200 Message-Id: <20221217090740.522093-4-kkostiuk@redhat.com> In-Reply-To: <20221217090740.522093-1-kkostiuk@redhat.com> References: <20221217090740.522093-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H2=-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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671268186039100003 From: Brad Smith qga: Add initial OpenBSD and NetBSD support Signed-off-by: Brad Smith Reviewed-by: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Konstantin Kostiuk --- meson.build | 2 +- qga/commands-bsd.c | 5 +++++ qga/commands-posix.c | 9 +++++++-- qga/main.c | 6 +++--- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 5c6b5a1c75..4c6f8a674a 100644 --- a/meson.build +++ b/meson.build @@ -75,7 +75,7 @@ have_tools =3D get_option('tools') \ .allowed() have_ga =3D get_option('guest_agent') \ .disable_auto_if(not have_system and not have_tools) \ - .require(targetos in ['sunos', 'linux', 'windows', 'freebsd'], + .require(targetos in ['sunos', 'linux', 'windows', 'freebsd', 'netbsd', = 'openbsd'], error_message: 'unsupported OS for QEMU guest agent') \ .allowed() have_block =3D have_system or have_tools diff --git a/qga/commands-bsd.c b/qga/commands-bsd.c index 15cade2d4c..17bddda1cf 100644 --- a/qga/commands-bsd.c +++ b/qga/commands-bsd.c @@ -21,7 +21,12 @@ #include #include #include +#if defined(__NetBSD__) || defined(__OpenBSD__) +#include +#include +#else #include +#endif #include =20 #if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 1a28326ec7..b19b9c5d18 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -45,7 +45,12 @@ #include #include #include +#if defined(__NetBSD__) || defined(__OpenBSD__) +#include +#include +#else #include +#endif #include #ifdef CONFIG_SOLARIS #include @@ -2872,7 +2877,7 @@ static int guest_get_network_stats(const char *name, return -1; } =20 -#ifndef __FreeBSD__ +#ifndef CONFIG_BSD /* * Fill "buf" with MAC address by ifaddrs. Pointer buf must point to a * buffer with ETHER_ADDR_LEN length at least. @@ -2921,7 +2926,7 @@ bool guest_get_hw_addr(struct ifaddrs *ifa, unsigned = char *buf, close(sock); return true; } -#endif /* __FreeBSD__ */ +#endif /* CONFIG_BSD */ =20 /* * Build information about guest interfaces diff --git a/qga/main.c b/qga/main.c index b3580508fa..0865c992f0 100644 --- a/qga/main.c +++ b/qga/main.c @@ -40,11 +40,11 @@ #include "commands-common.h" =20 #ifndef _WIN32 -#ifdef __FreeBSD__ +#ifdef CONFIG_BSD #define QGA_VIRTIO_PATH_DEFAULT "/dev/vtcon/org.qemu.guest_agent.0" -#else /* __FreeBSD__ */ +#else /* CONFIG_BSD */ #define QGA_VIRTIO_PATH_DEFAULT "/dev/virtio-ports/org.qemu.guest_agent.0" -#endif /* __FreeBSD__ */ +#endif /* CONFIG_BSD */ #define QGA_SERIAL_PATH_DEFAULT "/dev/ttyS0" #define QGA_STATE_RELATIVE_DIR "run" #else --=20 2.25.1 From nobody Sat May 18 21:45:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671268171; cv=none; d=zohomail.com; s=zohoarc; b=D5oqjKkcZjHF3Lz8Y5hUW1tET2Kyqn7O/S9yoCyBVYpuC5MG2WFt7X99NDdH9QYYEzpYTfrgv8CtUUqQS8uUNMg73EvMf6oQcoeQ4XEfguSaNfCZq7uEElfrQ4m4d6rhzwVckraPn9rzV7dA/TK+ECshtyslGMCRh6gJ1CYhuy4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671268171; h=Content-Type:Content-Transfer-Encoding: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=+dvu3PwRp9nXDZpaHwqhXJZiUfzTfH22zxnf3jMIle0=; b=kUD2DfsLDDXKQ+8fA0OYPDgy54sWwCcF2wV6+r4FJemrEgLmzY2XC44SjO6LUwd5y78XspCHBszhFcyRXp+xwdcZM6S2sLwInNXvPaC+E7iJhuuh7aqnFKWBmM1aBA3y5Fj/TZBjC/G0I+bxw366s9HQcKV/Ajal9BbOnDez3nQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671268171947419.024620122128; Sat, 17 Dec 2022 01:09:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6TAk-0005tO-7M; Sat, 17 Dec 2022 04:07:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAi-0005sW-2O for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAg-0006d4-2y for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:55 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-408-tXhs0lZDOtuCPDfopX1OrA-1; Sat, 17 Dec 2022 04:07:50 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 66A471C068DE; Sat, 17 Dec 2022 09:07:50 +0000 (UTC) Received: from kostyanf14nb.lan (ovpn-192-10.brq.redhat.com [10.40.192.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A7F540C6EC4; Sat, 17 Dec 2022 09:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671268073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+dvu3PwRp9nXDZpaHwqhXJZiUfzTfH22zxnf3jMIle0=; b=fEtwNnQFAVvOBgVp3CKJQLPF0HKpc5JaBWErlFs7n0TnfbILYh5sr9QAVxAc3G9HvQONZ4 4XvwVHeUUdMO6B3ALFuHujfSObrvtzpWD1a4FbR2G+W3lwtrulTAELfp1Kwt9T2oMvfMZS 3VaiVbl1+75N8UgAhVdnTvfD0JJOG4Y= X-MC-Unique: tXhs0lZDOtuCPDfopX1OrA-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org, Peter Maydell , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL v2 4/6] qga-win: add logging to Windows event log Date: Sat, 17 Dec 2022 11:07:38 +0200 Message-Id: <20221217090740.522093-5-kkostiuk@redhat.com> In-Reply-To: <20221217090740.522093-1-kkostiuk@redhat.com> References: <20221217090740.522093-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H2=-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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671268173924100003 From: Andrey Drobyshev via This commit allows QGA to write to Windows event log using Win32 API's ReportEvent() [1], much like syslog() under *nix guests. In order to generate log message definitions we use a very basic message text file [2], so that every QGA's message gets ID 1. The tools "windmc" and "windres" respectively are used to generate ".rc" file and COFF object file, and then the COFF file is linked into qemu-ga.exe. [1] https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-= reporteventa [2] https://learn.microsoft.com/en-us/windows/win32/eventlog/message-text-f= iles Originally-by: Yuri Pudgorodskiy Signed-off-by: Andrey Drobyshev Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Konstantin Kostiuk Tested-by: Konstantin Kostiuk Signed-off-by: Konstantin Kostiuk --- configure | 3 +++ qga/installer/qemu-ga.wxs | 5 +++++ qga/main.c | 16 +++++++++++++--- qga/meson.build | 19 ++++++++++++++++++- qga/messages-win32.mc | 9 +++++++++ 5 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 qga/messages-win32.mc diff --git a/configure b/configure index 26c7bc5154..789a4f6cc9 100755 --- a/configure +++ b/configure @@ -372,6 +372,7 @@ smbd=3D"$SMBD" strip=3D"${STRIP-${cross_prefix}strip}" widl=3D"${WIDL-${cross_prefix}widl}" windres=3D"${WINDRES-${cross_prefix}windres}" +windmc=3D"${WINDMC-${cross_prefix}windmc}" pkg_config_exe=3D"${PKG_CONFIG-${cross_prefix}pkg-config}" query_pkg_config() { "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" @@ -2561,6 +2562,7 @@ if test "$skip_meson" =3D no; then echo "strip =3D [$(meson_quote $strip)]" >> $cross echo "widl =3D [$(meson_quote $widl)]" >> $cross echo "windres =3D [$(meson_quote $windres)]" >> $cross + echo "windmc =3D [$(meson_quote $windmc)]" >> $cross if test "$cross_compile" =3D "yes"; then cross_arg=3D"--cross-file config-meson.cross" echo "[host_machine]" >> $cross @@ -2667,6 +2669,7 @@ preserve_env SMBD preserve_env STRIP preserve_env WIDL preserve_env WINDRES +preserve_env WINDMC =20 printf "exec" >>config.status for i in "$0" "$@"; do diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs index 813d1c6ca6..e344c38e74 100644 --- a/qga/installer/qemu-ga.wxs +++ b/qga/installer/qemu-ga.wxs @@ -110,6 +110,11 @@ + + + + diff --git a/qga/main.c b/qga/main.c index 0865c992f0..1463a1c170 100644 --- a/qga/main.c +++ b/qga/main.c @@ -83,6 +83,7 @@ struct GAState { #ifdef _WIN32 GAService service; HANDLE wakeup_event; + HANDLE event_log; #endif bool delimit_response; bool frozen; @@ -324,13 +325,14 @@ static void ga_log(const gchar *domain, GLogLevelFlag= s level, } =20 level &=3D G_LOG_LEVEL_MASK; -#ifndef _WIN32 if (g_strcmp0(domain, "syslog") =3D=3D 0) { +#ifndef _WIN32 syslog(LOG_INFO, "%s: %s", level_str, msg); - } else if (level & s->log_level) { #else - if (level & s->log_level) { + ReportEvent(s->event_log, EVENTLOG_INFORMATION_TYPE, + 0, 1, NULL, 1, 0, &msg, NULL); #endif + } else if (level & s->log_level) { g_autoptr(GDateTime) now =3D g_date_time_new_now_utc(); g_autofree char *nowstr =3D g_date_time_format(now, "%s.%f"); fprintf(s->log_file, "%s: %s: %s\n", nowstr, level_str, msg); @@ -1286,6 +1288,13 @@ static GAState *initialize_agent(GAConfig *config, i= nt socket_activation) g_debug("Guest agent version %s started", QEMU_FULL_VERSION); =20 #ifdef _WIN32 + s->event_log =3D RegisterEventSource(NULL, "qemu-ga"); + if (!s->event_log) { + g_autofree gchar *errmsg =3D g_win32_error_message(GetLastError()); + g_critical("unable to register event source: %s", errmsg); + return NULL; + } + /* On win32 the state directory is application specific (be it the def= ault * or a user override). We got past the command line parsing; let's cr= eate * the directory (with any intermediate directories). If we run into an @@ -1377,6 +1386,7 @@ static void cleanup_agent(GAState *s) { #ifdef _WIN32 CloseHandle(s->wakeup_event); + CloseHandle(s->event_log); #endif if (s->command_state) { ga_command_state_cleanup_all(s->command_state); diff --git a/qga/meson.build b/qga/meson.build index 3cfb9166e5..1ff159edc1 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -98,7 +98,24 @@ if targetos =3D=3D 'windows' endif endif =20 -qga =3D executable('qemu-ga', qga_ss.sources(), +qga_objs =3D [] +if targetos =3D=3D 'windows' + windmc =3D find_program('windmc', required: true) + windres =3D find_program('windres', required: true) + + msgrc =3D custom_target('messages-win32.rc', + input: 'messages-win32.mc', + output: ['messages-win32.rc', 'MSG00409.bin', 'mes= sages-win32.h'], + command: [windmc, '-h', '@OUTDIR@', '-r', '@OUTDIR= @', '@INPUT@']) + msgobj =3D custom_target('messages-win32.o', + input: msgrc[0], + output: 'messages-win32.o', + command: [windres, '-I', '@OUTDIR@', '-o', '@OUTP= UT@', '@INPUT@']) + + qga_objs =3D [msgobj] +endif + +qga =3D executable('qemu-ga', qga_ss.sources() + qga_objs, link_args: qga_libs, dependencies: [qemuutil, libudev], install: true) diff --git a/qga/messages-win32.mc b/qga/messages-win32.mc new file mode 100644 index 0000000000..e21019cebe --- /dev/null +++ b/qga/messages-win32.mc @@ -0,0 +1,9 @@ +LanguageNames=3D( + English=3D0x409:MSG00409 +) + +MessageId=3D1 +SymbolicName=3DQEMU_GA_EVENTLOG_GENERAL +Language=3DEnglish +%1 +. --=20 2.25.1 From nobody Sat May 18 21:45:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671268150; cv=none; d=zohomail.com; s=zohoarc; b=CxmTtuOe70z8EZF1b6QVd0GSnlNpyAq7DY9JBP7KjGlVwzt8zDkjN8L61v0K0Ozhieh1FgPqeZ9gDfpm9mguu2kQNlCQYsMpnCMVfPAevu1/ms5NmNl2AXdNCeYREANxI2+UbI6oEoWig+AITHOFQLIO8jPFxTWBNK3j7aapelI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671268150; h=Content-Type:Content-Transfer-Encoding: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=H+jI9Ae1kOlyAm872IZ+HvpAvtNVj7WGf3+Zm313HZ4=; b=EuiilnujsY/ib8d7gESZvbfLWIo1u5XwsETHsbUuKoClaOEH762hsN2uUSpGeWPPMBzVUdp0DVcFo6qD+kzTpi4eVLw8UY4KOE8cABM6PFyH/3uG7lm43RxxtTxbyZeYFBpZz5rUr+mksdNwYM8TZebXiTegq8Gig0ASSj575vY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671268150684411.40864142456076; Sat, 17 Dec 2022 01:09:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6TAk-0005ts-SS; Sat, 17 Dec 2022 04:07:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAh-0005sC-RM for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAg-0006d9-D3 for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:55 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-164-krBcsFUXOz2RAspbvwD8Mw-1; Sat, 17 Dec 2022 04:07:52 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1A46811E6E; Sat, 17 Dec 2022 09:07:51 +0000 (UTC) Received: from kostyanf14nb.lan (ovpn-192-10.brq.redhat.com [10.40.192.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5BE140C6EC4; Sat, 17 Dec 2022 09:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671268073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H+jI9Ae1kOlyAm872IZ+HvpAvtNVj7WGf3+Zm313HZ4=; b=fr64IUmGvln6HOeUx3ZsZGHfZwUxXvUdFQBiBI+CynZaTRY/Ix6PXMxx7jbOe32Y5Q2gsv 1owoK8MBYTnywz/ov7jVq7b0YwzhhqNAZxpXudZxUod7GYMfqNdnNHNSrMlFNUfHg4IxoH mRnrnXUMlR0jsezhQ3TnT4nqGBFqsLg= X-MC-Unique: krBcsFUXOz2RAspbvwD8Mw-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org, Peter Maydell , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL v2 5/6] qga: map GLib log levels to system levels Date: Sat, 17 Dec 2022 11:07:39 +0200 Message-Id: <20221217090740.522093-6-kkostiuk@redhat.com> In-Reply-To: <20221217090740.522093-1-kkostiuk@redhat.com> References: <20221217090740.522093-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H2=-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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671268151724100005 From: Andrey Drobyshev via This patch translates GLib-specific log levels to system ones, so that they may be used by both *nix syslog() (as a "priority" argument) and Windows ReportEvent() (as a "wType" argument). Currently the only codepath to write to "syslog" domain is slog() function. However, this patch allows the interface to be extended. Note that since slog() is using G_LOG_LEVEL_INFO level, its behaviour doesn't change. Originally-by: Yuri Pudgorodskiy Signed-off-by: Andrey Drobyshev Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Konstantin Kostiuk Tested-by: Konstantin Kostiuk Signed-off-by: Konstantin Kostiuk --- qga/main.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/qga/main.c b/qga/main.c index 1463a1c170..85b7d6ced5 100644 --- a/qga/main.c +++ b/qga/main.c @@ -314,6 +314,38 @@ void ga_enable_logging(GAState *s) s->logging_enabled =3D true; } =20 +static int glib_log_level_to_system(int level) +{ + switch (level) { +#ifndef _WIN32 + case G_LOG_LEVEL_ERROR: + return LOG_ERR; + case G_LOG_LEVEL_CRITICAL: + return LOG_CRIT; + case G_LOG_LEVEL_WARNING: + return LOG_WARNING; + case G_LOG_LEVEL_MESSAGE: + return LOG_NOTICE; + case G_LOG_LEVEL_DEBUG: + return LOG_DEBUG; + case G_LOG_LEVEL_INFO: + default: + return LOG_INFO; +#else + case G_LOG_LEVEL_ERROR: + case G_LOG_LEVEL_CRITICAL: + return EVENTLOG_ERROR_TYPE; + case G_LOG_LEVEL_WARNING: + return EVENTLOG_WARNING_TYPE; + case G_LOG_LEVEL_MESSAGE: + case G_LOG_LEVEL_INFO: + case G_LOG_LEVEL_DEBUG: + default: + return EVENTLOG_INFORMATION_TYPE; +#endif + } +} + static void ga_log(const gchar *domain, GLogLevelFlags level, const gchar *msg, gpointer opaque) { @@ -327,9 +359,9 @@ static void ga_log(const gchar *domain, GLogLevelFlags = level, level &=3D G_LOG_LEVEL_MASK; if (g_strcmp0(domain, "syslog") =3D=3D 0) { #ifndef _WIN32 - syslog(LOG_INFO, "%s: %s", level_str, msg); + syslog(glib_log_level_to_system(level), "%s: %s", level_str, msg); #else - ReportEvent(s->event_log, EVENTLOG_INFORMATION_TYPE, + ReportEvent(s->event_log, glib_log_level_to_system(level), 0, 1, NULL, 1, 0, &msg, NULL); #endif } else if (level & s->log_level) { --=20 2.25.1 From nobody Sat May 18 21:45:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671268139; cv=none; d=zohomail.com; s=zohoarc; b=eqzR3h4Hcef4CR2NeKtS0j44Z1CzI4JaQvkO4GI4/R+2zc7YEhUPKRbzTAX5Ee6+IFBKhvz2pm5Cs2U4xyj5djRXMxlDKBzGxtJinRE7fkbLgtIZo/DeQwdDrFxgpMI9eJG3fWNUwQkn7GZGv/jMWNGUo7yvMSQ5/W8RBQ9ClhI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671268139; h=Content-Transfer-Encoding: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=1P1WaPdaI+wOBf7jCKrpFrJzk5Zbg2GZ0rmy2K16LLg=; b=X/5exJ4e1xdj31svPhD+vFh9lke6Ix8nDjTDOxterSsQwywjIpdAY7gSls3he3N2xzvfWcCwz+CDh8atEsDdolUPhbMrzKm2HKE1IGYVwfO8d+/52eumd7puZib6hC51CQvm+VxNyV/vDCCokAGjQRWiXo1jvhpw5IRaIvQ1Fks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1671268139450316.8768837831127; Sat, 17 Dec 2022 01:08:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6TAl-0005tw-Td; Sat, 17 Dec 2022 04:07:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAk-0005tN-4k for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6TAi-0006da-Dj for qemu-devel@nongnu.org; Sat, 17 Dec 2022 04:07:57 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-458-H3VId2ovPqeE6Zgn55r1sg-1; Sat, 17 Dec 2022 04:07:53 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E83685A588; Sat, 17 Dec 2022 09:07:53 +0000 (UTC) Received: from kostyanf14nb.lan (ovpn-192-10.brq.redhat.com [10.40.192.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 391EA40C6EC4; Sat, 17 Dec 2022 09:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671268075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1P1WaPdaI+wOBf7jCKrpFrJzk5Zbg2GZ0rmy2K16LLg=; b=gm6WgQn6tuER/N7KMlZTYZr521844CGzd7h4d1MCjxqR0LhcWs2DIUZJeM5p4xdmngpG7R vE1QpAEqdi7M3ACH4bDgA15m51OZh2OPbS1cbpKOdDt9Q32NmkJrQ0VbagEaZkgYlwo0u4 CX4P/PK+njPik7rLX7h9aFfk5tA+P/s= X-MC-Unique: H3VId2ovPqeE6Zgn55r1sg-1 From: Konstantin Kostiuk To: qemu-devel@nongnu.org, Peter Maydell , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL v2 6/6] qga-win: choose the right libpcre version to include in MSI package Date: Sat, 17 Dec 2022 11:07:40 +0200 Message-Id: <20221217090740.522093-7-kkostiuk@redhat.com> In-Reply-To: <20221217090740.522093-1-kkostiuk@redhat.com> References: <20221217090740.522093-1-kkostiuk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H2=-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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671268139690100001 Content-Type: text/plain; charset="utf-8" From: Andrey Drobyshev via According to GLib changelog [1], since version 2.73.2 GLib is using libpcre2 instead of libpcre. As a result, qemu-ga MSI installation fails due to missing DLL when linked with the newer GLib. This commit makes wixl to put the right libpcre version into the MSI bundle: either libpcre-1.dll or libpcre2-8-0.dll, depending on the present version of GLib. [1] https://gitlab.gnome.org/GNOME/glib/-/releases#2.73.2 Previous version: https://lists.nongnu.org/archive/html/qemu-trivial/2022-11/msg00237.html Signed-off-by: Andrey Drobyshev Reviewed-by: Konstantin Kostiuk Tested-by: Konstantin Kostiuk Signed-off-by: Konstantin Kostiuk --- qga/installer/qemu-ga.wxs | 12 +++++++++--- qga/meson.build | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs index e344c38e74..51340f7ecc 100644 --- a/qga/installer/qemu-ga.wxs +++ b/qga/installer/qemu-ga.wxs @@ -101,9 +101,15 @@ - - - + + + + + + + + + diff --git a/qga/meson.build b/qga/meson.build index 1ff159edc1..ad17dc7dca 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -140,6 +140,11 @@ if targetos =3D=3D 'windows' qemu_ga_msi_vss =3D ['-D', 'InstallVss'] deps +=3D qga_vss endif + if glib.version() < '2.73.2' + libpcre =3D 'libpcre1' + else + libpcre =3D 'libpcre2' + endif qga_msi =3D custom_target('QGA MSI', input: files('installer/qemu-ga.wxs'), output: 'qemu-ga-@0@.msi'.format(host_arch), @@ -153,6 +158,7 @@ if targetos =3D=3D 'windows' '-D', 'QEMU_GA_VERSION=3D' + config_host['QE= MU_GA_VERSION'], '-D', 'QEMU_GA_MANUFACTURER=3D' + config_hos= t['QEMU_GA_MANUFACTURER'], '-D', 'QEMU_GA_DISTRO=3D' + config_host['QEM= U_GA_DISTRO'], + '-D', 'LIBPCRE=3D' + libpcre, ]) all_qga +=3D [qga_msi] alias_target('msi', qga_msi) --=20 2.25.1