From nobody Mon May 13 22:20:25 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=comstyle.com ARC-Seal: i=1; a=rsa-sha256; t=1668253322; cv=none; d=zohomail.com; s=zohoarc; b=dCRiokqQtbaAsQFRPQvvsAMqaXAv5a20PEj98/zcT6iPDPRGM4/eSBwHPtO0VJJcDUDHg27/ZUDnL6jlGjWJWJ0Q4h6EuD0L2J6wOjfxBHc6P+LNPMVG8cSXIDK5VXtCiHhUuEJbZW0tmSMuhunj03Z+vKc71OWSIEHVrsqbhfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668253322; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=uuDtzbISn2Ozvdl3y44i9TMC9fkN0hlk35WjbQzVzNI=; b=ASJW7VorCvCvcDgwRLsqFZkYjBgKdcOy4MG5tpvXLom/jEKukAVqOsYqaTVJBRkUBAhbmQxXKUWJ1deQB+deh0hHXh5MjuYZmNxSzWzTZwz/Ju1Xi4MFg5qzqbSusihnjRPNMakZGoW8fCpCszT0e5X3HQX0SeZIdP9TRgcJsRQ= 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 1668253322085989.4128655068562; Sat, 12 Nov 2022 03:42:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otosk-0002lN-Of; Sat, 12 Nov 2022 06:41:06 -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 1otosf-0002kn-DK for qemu-devel@nongnu.org; Sat, 12 Nov 2022 06:41:01 -0500 Received: from speedy.comstyle.com ([206.51.28.2] helo=mail.comstyle.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1otosd-0008Tf-PW for qemu-devel@nongnu.org; Sat, 12 Nov 2022 06:41:01 -0500 Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4N8YY92dB9z8PbP; Sat, 12 Nov 2022 06:40:45 -0500 (EST) Received: from humpty.home.comstyle.com (unknown [IPv6:2001:470:b050:3:6d50:1d1b:ba5e:b2c4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 4N8YY91hClz8PbN; Sat, 12 Nov 2022 06:40:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=comstyle.com; h=date:from :to:cc:subject:message-id:mime-version:content-type; s=default; bh=OQZ5fC2oIGbditZ6PL8HzM4gAgU=; b=Kqnq1C1LGvjr6cobm2s32dhMWHBE IlyeI5uAR48dsG7W1gTy2NrqaoonPsGZBbHsm2/nW4b/JYVoh+qNaSBbiGnLrpDo kI75btRtTotgsZdxSlXUt06jT1ovsTndsOWMD1GZZ3L1Be6lw6CgiiPJRgs7cZOU 7xabq3P8tm64pIk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=date:from:to :cc:subject:message-id:mime-version:content-type; q=dns; s= default; b=OrjzkVGru8+F3GpZv9hhaZR2C5B5lupFdcSQw8ZO4vsGqyq4wuyvU ySAh3MgavyR2K89T04XEE/CQNT0ckSv5HiK+yeGOSg1WtBY+vo3hlsDsAIj2nQje PM+mxEdArmce574/+E+RwfLOXUUYevHMpfymbP92sOMcZsE0GEFTeQ= Date: Sat, 12 Nov 2022 06:40:43 -0500 From: Brad Smith To: Michael Roth , Konstantin Kostiuk Cc: qemu-devel@nongnu.org Subject: [PATCH] qga: Add initial OpenBSD and NetBSD support Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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=206.51.28.2; envelope-from=brad@comstyle.com; helo=mail.comstyle.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=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.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 @comstyle.com) X-ZM-MESSAGEID: 1668253325218100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" qga: Add initial OpenBSD and NetBSD support Signed-off-by: Brad Smith Reviewed-by: Konstantin Kostiuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 cf3e517e56..5556356f14 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 32493d6383..86be320a1b 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 @@ -2881,7 +2886,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. @@ -2930,7 +2935,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.38.1