From nobody Sat May 18 06:50:47 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=1667191287; cv=none; d=zohomail.com; s=zohoarc; b=FQvE1Re+cZJPEHOkfL9KswewWJPR2qVSIJgK3g8lsiko+Nmnq/+YtOPa62nCC4fAcX/144DVxSniHkeW0xWyn7iWj5+I9tImq89spvekdSknEy2qcbwirWRCZspFxKjO7VPOGb8HtvgHUdgXCFpUmihlIXRtHeRLjyFIm6kbZac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667191287; 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=ChLe3uA3KtWrHi56O/ZCTA91SB0JyI16HAPBHDwtFUA=; b=YXcLh1cmTE1C/1Xq/vqAb8RED3wpAodnQQXg8Ic/AikZQF8kcO3W4O+4/FMMpL8E9uvBJ2ZEQ+nBWPULuFWJYC4YCt7nG89J2hMZ6UNgTKcoWt1PMPhjePMpz0BQIzUbDx+J5ALX17jncfXvAU5iU1ND5k/C/y7yuB79cAc/Ass= 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 1667191287767600.0623160771796; Sun, 30 Oct 2022 21:41:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opMb2-0006EL-P7; Mon, 31 Oct 2022 00:40:24 -0400 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 1opMb1-0006DR-6C for qemu-devel@nongnu.org; Mon, 31 Oct 2022 00:40:23 -0400 Received: from speedy.comstyle.com ([2607:f938:3000:8::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 1opMaz-0002J5-JA for qemu-devel@nongnu.org; Mon, 31 Oct 2022 00:40:22 -0400 Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4N10nS3sD1z8PbP; Mon, 31 Oct 2022 00:40:12 -0400 (EDT) Received: from humpty.home.comstyle.com (unknown [IPv6:2001:470:b050:3:4559:695d:5708:6465]) (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 4N10nS1Z6vz8PbN; Mon, 31 Oct 2022 00:40:12 -0400 (EDT) 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=EU0TuiVdMuNZLLVNAK1VSuYkiOs=; b=KBPEaJqeNXhusklY0/+YqLbQEIex VaEULrGT8wwu9zYUYW4woaML34lwCs3qnZPj94c/4d52QVMse+RnEioPnym5mmOF 8tkh8PvLW49T4pLB2R7aBzRBN+3TPKcAUMH507bBof4LAu9SDK+SnM4GAn8p1NBK oTpRJk21LJQsLYY= 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=mm4bhhD0j+YzPPJrTWps/qa2CRAPk7NOm8PnfR2IWgZ/k4MM0KOSI x1LY2D5xWoBDzbbrAeUm+XY9eyzN6OtMuRLRCeJfJtqV0Vy46T3BBButs4ggg/EK yrwkahOPvS40Oo7iW2xNB0cGaGjVeNaq2na6DikWBTAbpsn6EsBhFw= Date: Mon, 31 Oct 2022 00:40:10 -0400 From: Brad Smith To: Michael Roth , Konstantin Kostiuk Cc: qemu-devel@nongnu.org Subject: [PATCH] qga: Add initial OpenBSD 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=2607:f938:3000:8::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, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @comstyle.com) X-ZM-MESSAGEID: 1667191289711100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" qga: Add initial OpenBSD 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 | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 37737913df..fb69a6a683 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', '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..4deb3bf580 100644 --- a/qga/commands-bsd.c +++ b/qga/commands-bsd.c @@ -21,7 +21,12 @@ #include #include #include +#ifdef __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..640f26dc16 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -45,7 +45,12 @@ #include #include #include +#ifdef __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..0fe94e80d1 100644 --- a/qga/main.c +++ b/qga/main.c @@ -40,9 +40,9 @@ #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__ */ #define QGA_SERIAL_PATH_DEFAULT "/dev/ttyS0" --=20 2.38.0