Message ID | 20221013092326.2194646-8-alexander.ivanov@virtuozzo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56700C4332F for <qemu-devel@archiver.kernel.org>; Thu, 13 Oct 2022 09:31:27 +0000 (UTC) Received: from localhost ([::1]:43118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org>) id 1oiuYo-0007kn-97 for qemu-devel@archiver.kernel.org; Thu, 13 Oct 2022 05:31:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <alexander.ivanov@virtuozzo.com>) id 1oiuRa-0002Ll-DD for qemu-devel@nongnu.org; Thu, 13 Oct 2022 05:23:59 -0400 Received: from mail-eopbgr140123.outbound.protection.outlook.com ([40.107.14.123]:28929 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <alexander.ivanov@virtuozzo.com>) id 1oiuRX-0004g6-Tt for qemu-devel@nongnu.org; Thu, 13 Oct 2022 05:23:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JcciapBzLuNKsRW0JRlO6csm3SrZ9img6WyiseARORedqnsdDXxameDx2R/CyCoO/Q/s3Cm37a6qamS4Sp1iABdy6p4OenMp0KTOawxV9inQ1NEMg/0v1bBtkptgliT4zas9ga1c3WGxGCZbReg6JAFJAOKH9Ijz5qxPfMFS3bHVM1rlqwgNmrcP6cSr3A9tlNK/mFCXmJIOlWZckZnpOegr7U5idiMXNcr51pimYWcc2RyOsF4iu0BehexAe/5ZEpdLgp72iTYhDXt+KxbBKRWXIireTlqf+N5YScsgrnXHUX8mFocS49LLYRuxgz8eaxxppRZv8PZSy0D47oUpHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gxxmbxAcZk965Xpx44CaaKqYjArE71BENpKHlF/1fPc=; b=Hbg6909E7NWtSNzcVF4PByKzN4ueHl55KxdFniyid1WF3upHJhJugNVwVSByhLVq8sWaSNQOf+Vs/klpFSm5tsXcxc8Uerouui2mH81Zhg5ylmBVBF04mso1JYJC9kUzaQHHezcbUxFER4aV+cO9GHs1AFDjxoRYKjvhtk3x4cOlcSoEL1kAoA1oSo47svP0VQftDlWVDwSx8BG+sNcu8fQHP+SWv6m7Avnw+RRJm95XJooy1sVx3YtbWkJDpOFsJXRF7ctBhuV37s4xALqlp3HZb38kIbN0f9HyDEHGqvBXFpeE/3SguwisyQZA7H+ax25soOMr3x39pyiFJxhcrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gxxmbxAcZk965Xpx44CaaKqYjArE71BENpKHlF/1fPc=; b=EbueDlinO6p8g7IuOxDMc2REII/o1t7ikKgH7xZFKVrwkVyQVf7nr3SnignppVAPDc3GlrQF20kFjTqqD1De6X4I3HEnOcs/KUBW+bg06n49yIxVLal64+60z8EZJqwDfSKMZHywPGutEz42q6ODqgoXy8wd45ywuB1uvcCpMyJ7zXmkqksZVfjqNl3D5ktOGoan8IqXAnqmqnRQUTiNKMqHkVzJ9/fvCkzcVjLUBqOalUGdPmt+qB0YtK7aoOwT9lurnlmuYo6N61vwYN0d0i2PJSKqwgZr6hQed/LAAFZmue0A67YiKvKMuW4RNCXn8nbpF2qOrXl4eClcR0Mx5Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AS8PR08MB7095.eurprd08.prod.outlook.com (2603:10a6:20b:402::11) by AM8PR08MB6466.eurprd08.prod.outlook.com (2603:10a6:20b:363::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.21; Thu, 13 Oct 2022 09:23:40 +0000 Received: from AS8PR08MB7095.eurprd08.prod.outlook.com ([fe80::5174:25c7:6df8:741b]) by AS8PR08MB7095.eurprd08.prod.outlook.com ([fe80::5174:25c7:6df8:741b%8]) with mapi id 15.20.5676.040; Thu, 13 Oct 2022 09:23:40 +0000 From: Alexander Ivanov <alexander.ivanov@virtuozzo.com> To: qemu-devel@nongnu.org Cc: den@virtuozzo.com, michael.roth@amd.com, kkostiuk@redhat.com, marcandre.lureau@gmail.com Subject: [PATCH v4 7/7] qga: Add HW address getting for FreeBSD Date: Thu, 13 Oct 2022 11:23:26 +0200 Message-Id: <20221013092326.2194646-8-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221013092326.2194646-1-alexander.ivanov@virtuozzo.com> References: <20221013092326.2194646-1-alexander.ivanov@virtuozzo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR0P281CA0069.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::22) To AS8PR08MB7095.eurprd08.prod.outlook.com (2603:10a6:20b:402::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR08MB7095:EE_|AM8PR08MB6466:EE_ X-MS-Office365-Filtering-Correlation-Id: 09540233-3558-411c-1f58-08daacfc9d89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wbZLJNcSnhXIbLr9RHFKETFSr2YLqiHaj0Mlvy4NIGGUoWMJuHSmvArh33RIkvM/7K0CcvHVmRa1RWfFwDD0+wwxVur6siXUSH9M+P/WKq6bM6zpP+XcLqhBIfailztRDLWmtoleX1MKoRbV0G6ibC2AVPOQjRx/P5KeO4WwamcqqkdNa3vWG+j3ZZY5cIL2saMkAcxKridym7teprL6ZSvTa+9qoDRYPW/USMgdl+9xhvvHjR8T8mFw/kzhF7xjEo6Gn0MpRv29nBRvFDE+86mxyytvsu2A0wRlVBLBkn2suY+CM1g+LMgmqMhB2tiSg/GhmGeqXlcVEJNyAzNm2u+WNzCtnvbto7EkOSGMYqVmcuZOiLBD+2zHNIdA9f6jyr05rWf4HaCNqAwsCMe0Qac0yXVCQYqbKPxcg3Fw/XsQ5jeimjxeiYmCLRrbaBeVMQG0WK2UJi5fq8Li/TEpSPHX+CvItNYQ79xwKfWHY2ZjphWC0QxLcTvX3edT+aXbV0FAZ92Sp06+iXvHqYo1GHtPuetLw1o1BNg1wcVd5Tu4ao/l7gV8kDh5LfI9AtBsqZwJZ8mzCEU8bPh/huqm09Qhus1hXxMBwtIVW1DIo+lshef2IXTbx0jF9disH+bReeWYjGpqFBBA0/sS7LLC9QUf4Q3DvTKX5da3OUXUD+TZ0rcv8d/zLQJpGcFUHSW3YZCLFhxa9RfbVO70u+dN4zjOkko6de7C38TI4bjIk35qaDusFChS3rmod2p9x1PShBXuDANhU+SpHp5eRWGhjA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB7095.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(376002)(346002)(136003)(39850400004)(396003)(451199015)(36756003)(2906002)(44832011)(4326008)(6512007)(5660300002)(41300700001)(8676002)(66556008)(316002)(86362001)(6916009)(66946007)(66476007)(8936002)(38100700002)(478600001)(6486002)(6666004)(38350700002)(26005)(6506007)(52116002)(2616005)(186003)(1076003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?QrsMBblm9SyNFPIycBfHC16+LPNy?= =?utf-8?q?1UN0/+9pJpZYmgT77mUOWQYkhUwdS+D4WUmG69CMcilpzpjoncasgUTxxz1Bbxgow?= =?utf-8?q?AzB++IWm4TDGGnmJILtQDZ77dkAbD7ycz4ni1hgxkittw355JyJNItS28yI6YGpV6?= =?utf-8?q?T0OyAoQ+7RxpoUPSN7fjRJJjkjwttEslqOMv+VJkYteC2ZxBxjfXsAa1pr+UENoj+?= =?utf-8?q?HunOQ1F7tCz+JVUA3pf/SYBVZp0GQ7McxTCu1ChU1Jp709+Z+VYezRN1t0hEl0HTm?= =?utf-8?q?9x/m3e1V+OSQjTDjwXzM9gNr1I5070nEdRe32lZ7yotfropC/y7quINZx1nEKqP/i?= =?utf-8?q?3+zd0TWl4XdjQlxVfmnAkHyBx/05WQXBXyapZns7hRXrr/K6xg7lyXEWH0c9S4Qqq?= =?utf-8?q?CXp84OvUkSgS/KGauz1u04O/htmLKnGbhPYBHrPq3JQJWylX4svSMDGdDk3orphG8?= =?utf-8?q?Eu6CfB+DdWDers0ZYB2m+E+MwS1jOg9Ya3F7fTpjy5eg5HofeX4DtaJp8l1KXCI/M?= =?utf-8?q?IGDCZEQGE4DjKvhPPqkucJSZ8AvdKGe87PrZTuMIp2AHtBeVfNa3i+UNB76daXhNK?= =?utf-8?q?8YO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NfYpfFLL5zlg4tuZQgdETxJFBe1+5SfG0TxQ3LPcrlysscGP8iW?= =?utf-8?q?4lAJ8J3LtSVGHnESpScty08I4KUkeXL9bA=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09540233-3558-411c-1f58-08daacfc9d89 X-MS-Exchange-CrossTenant-AuthSource: AS8PR08MB7095.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2022 09:23:40.2498 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zWTjW3Akn9pXYo+onZHVA50YvGLNePnA4LX4nRkPODSk+CETakxqmpDBMZxwfRvL8QY746Mt19Ge7UGL6Qkey42ED0ly4VIk3OHGLsPYoA8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6466 Received-SPF: pass client-ip=40.107.14.123; envelope-from=alexander.ivanov@virtuozzo.com; helo=EUR01-VE1-obe.outbound.protection.outlook.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_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org> |
Series |
qga: Add FreeBSD support
|
expand
|
diff --git a/qga/commands-bsd.c b/qga/commands-bsd.c index ebf0fb8b0f..15cade2d4c 100644 --- a/qga/commands-bsd.c +++ b/qga/commands-bsd.c @@ -20,6 +20,8 @@ #include <sys/param.h> #include <sys/ucred.h> #include <sys/mount.h> +#include <net/if_dl.h> +#include <net/ethernet.h> #include <paths.h> #if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM) @@ -179,7 +181,20 @@ GuestCpuStatsList *qmp_guest_get_cpustats(Error **errp) bool guest_get_hw_addr(struct ifaddrs *ifa, unsigned char *buf, bool *obtained, Error **errp) { + struct sockaddr_dl *sdp; + *obtained = false; + + if (ifa->ifa_addr->sa_family != AF_LINK) { + /* We can get HW address only for AF_LINK family. */ + g_debug("failed to get MAC address of %s", ifa->ifa_name); + return true; + } + + sdp = (struct sockaddr_dl *)ifa->ifa_addr; + memcpy(buf, sdp->sdl_data + sdp->sdl_nlen, ETHER_ADDR_LEN); + *obtained = true; + return true; } #endif /* HAVE_GETIFADDRS */