Message ID | 20221017072825.72867-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 606BEC433FE for <qemu-devel@archiver.kernel.org>; Mon, 17 Oct 2022 07:47:10 +0000 (UTC) Received: from localhost ([::1]:42498 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 1okKq5-0002lC-7x for qemu-devel@archiver.kernel.org; Mon, 17 Oct 2022 03:47:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40876) 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 1okKYZ-0004cF-3s for qemu-devel@nongnu.org; Mon, 17 Oct 2022 03:29:03 -0400 Received: from mail-eopbgr00109.outbound.protection.outlook.com ([40.107.0.109]:35648 helo=EUR02-AM5-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 1okKYX-0001HN-Eg for qemu-devel@nongnu.org; Mon, 17 Oct 2022 03:29:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NUopEGLYtu4G1EHg2EXTR8hoHihG3cmga5/kyC9Tk73SHH7VkVc+8a9I3P0miKw0NE+jhtAvfAho63WmibojUm/iEGEpaYD+jkDqlmkv633ZQZt5sczqIciLFMRdhxnVwZmGVxB+vsmtyKNbgC5uobLWfsc+dk6gW5iWfxbCL6DejWNcVQzqINfI6/vc8IR3LKcNgk6zuv3I6/vu9LZNIqbNGcGVyWtL0kXaPpfO6kTun+jaMfW+PwwosG81b62qomzeQggA1yJ+xcIPs/efVRLg9jaqDPX1XHIrWlkYuJmjXaiVGVXAraC3wuNXI60w9W7y2+lfNxwyTeDthhnLdg== 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=V3Mx2EqfRc9oeboLAmpMnogS7QgWa/LcbDHfOxhZ284zivR23m5G60iqm9fG5Spt4acIJK8Nwij8N6tSylXpz9FGJ4IZ1ExsGiHU58Rxc6eONVW+6W9AmX/lt8aieZzxqG8acBmgo9g5l57uOVuq9U+/6reW1LsPcFa80vjpUOKn2jV0uypx1IZQJgQ/bvNAr2qUbJIC6Seo2SxHgAOfnn9leUJVzrjGnvnBlqyZexLVQQsXfACSfMnwaI7dACqRf4qcg7tJ8SeZP98eh8rR0loGF5PUwaONiV//gVCOzNzSDWUIU3yivB/17Xt8Pa7/ukOpLD7/lH5G2FYMokXfFQ== 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=TyMm27s3TjLZ/lqnQU6xxmLO3uqKBSfN8yo3/dxJxn+Ftnso+xsdrPQ2bV0ZzjlTZKZrd/KGDkWCYa/Bi6f9Ct/vsskw8OFfj9IIVrVhVcMaLLjLpoKcYk+y8wgxnwZbBVZQgJl6+ukA1NgTRCGw24su+3BrZsswbEcH3JsnNx2SLjfFiZSWo9ORpZha1kMN3G2Xev3/QkzfAbFt+M6BzezDslGlxp66skQRfz93p/DFIKY4ShBLmjzpM3zyzAM8vpkIVQj+LlBbHlV/F38hvPExwFuRHlhMQP8NZRg1IT+OuQJcRGfyi4ydNFd8DTe3bBZlBFirR9QNwAZzJ+Bgkw== 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 GV2PR08MB8653.eurprd08.prod.outlook.com (2603:10a6:150:b9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Mon, 17 Oct 2022 07:28:41 +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; Mon, 17 Oct 2022 07:28:41 +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 v5 7/7] qga: Add HW address getting for FreeBSD Date: Mon, 17 Oct 2022 09:28:25 +0200 Message-Id: <20221017072825.72867-8-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221017072825.72867-1-alexander.ivanov@virtuozzo.com> References: <20221017072825.72867-1-alexander.ivanov@virtuozzo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR3P281CA0033.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::12) To AS8PR08MB7095.eurprd08.prod.outlook.com (2603:10a6:20b:402::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR08MB7095:EE_|GV2PR08MB8653:EE_ X-MS-Office365-Filtering-Correlation-Id: 409558ea-1e7c-4368-cf84-08dab01136f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wA8kvoViXqK7n5cAKlQ0GgM4Ke/xl7psWb5aSBfCCVZYSMEojNdsQiPRVGuUNn60s4v9eK+YV8a5fu1SlVAP9CtZOhke03V5hpXoylWK6TbGc+67RIctHj7vzwYx8ucScp0RbttFJnmJPJo+891e83apXlPyGOMIhia2x/LvMDah713WKPl3Mg4VvVoXz27lnlWiQ5rQr75dy4hKbMh2CMTRpLa0Q01jrKXihpZ0zEfvgOaGjJa1SODFCr/lED6SGs8JK0c3mrfY6D7CYCjUtTS6Gk2y1LfBZiX6e0PtQhPAaYZq1kbIKmFunXcP3NiEgvmcX3MccE+bT9SI65foUDUBtsvLf/yKmyk7qaH+9plJLRP42cGLyBTGYIHjCjvg31dwgjFAcEUaaogkxgTZzx4KAJah2LKjwgn0a/nFkEDJaFqjNv/PugfoDypfDjpDD50OYTnO/TW3wWO30CFFZ+lIhJ46r+zX1T9rrQTAA1Wg/3xBwqBoyuK9cOG+qhA1okJ4STuHO5tudbJXJczxQHkM6fyx3xO+bC5M3K6k85fpM2FMe2SH5NiXBXSCxWFtafz4OfkAZW65qpM7m3WDZmeM+GSwPMdPhP+VhOdMEn9u6Iven6ELq9xU3rFSabBXNRtxNvdhRdU+yX+hGz2M9PjAIAHj0SItjfN4ZxY9e2QQMlK6XxYN9TB+lUAIqy3cYpmgJT0oSNKbQ5U+gIOaVY1PHX0CoeByuepEg/ix0yROnD1Bp22TwEUo8i7K+BF4n2Ii9/QwdoyXyAstfKRo1w== 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)(136003)(376002)(39850400004)(396003)(346002)(366004)(451199015)(36756003)(86362001)(5660300002)(44832011)(2906002)(38100700002)(38350700002)(1076003)(186003)(2616005)(52116002)(6506007)(316002)(26005)(478600001)(6512007)(6916009)(6486002)(66946007)(66556008)(66476007)(41300700001)(4326008)(8936002)(6666004)(8676002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SJVEzlx8coqLIrPMrr1+Wcb/Oyjg?= =?utf-8?q?7EFnGV+rY3DoW5aLvlOnm7ouZwrzL/S/SY5sXMvMnFQEwzBmZQdzlZRu4JWVsg26m?= =?utf-8?q?3HZHmTVWJx0u0Q4Af5wvj3mwCBqUMoK4Dy8PNuqKpRZtTEWFJylMpuQJGTJ2nqSrV?= =?utf-8?q?unR0sc+WerOWHkdjEky1YWkZzCeyU1Ruz4k41WNUSU+Ijo0MtxcUjzUF15OlHqwS6?= =?utf-8?q?ewcaH7t2AZi838JLTNVNnau8aqoc3rQIO/RIcv+R5Fi1nNLk82Sx4ovjqSDAydk+8?= =?utf-8?q?uIkj0B2+2YRZF+OOZCQ7ko2mMa1sdi4hbdheV/HbPT7624sk2zBePiG7lYLoV3WO8?= =?utf-8?q?R83o6eviT/iDuBBe8bwxun+oy9B0+uOAW1q1Cef8YdAt5ulxPma887PL+woCRGS3h?= =?utf-8?q?kJkQ14uocBUDk43CRjVsHHpkseOdnvyYnd3C46pRVJevlzFYDfqxv317PUuTeXNUU?= =?utf-8?q?M4wdhi0ZMhBDBLURoFniKb3J6smGkiWyKP2g3E6uizU8jDn7EW6fvHAH5NCGjofiH?= =?utf-8?q?mAxoJN+tHqJwzYugVY0CkpdM7X54fdeOfpmgDOE1g3U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D4axlQ6hK9eURSmRjZNRnyZV8hXbnY2?= =?utf-8?q?48ieu/vvBZN9wwZozXtuxYxFC21XTbtH5DjMdvq8qSSqGz482M3tk73SIv6ny3vVA?= =?utf-8?q?ycNFUa/A89O/Kw9LUwViVh5o4/luzbCbQA=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 409558ea-1e7c-4368-cf84-08dab01136f2 X-MS-Exchange-CrossTenant-AuthSource: AS8PR08MB7095.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2022 07:28:41.3079 (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: 9RvBeajlmyWEb4hmSPA0R2DBAs+l+0EifiWSOA4iG3F243EHztnDttpE1clVqmnLBuHzoVRYEJu7DtmrxUyenBv1Z1MCBM4XRx/m+GvftDk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8653 Received-SPF: pass client-ip=40.107.0.109; envelope-from=alexander.ivanov@virtuozzo.com; helo=EUR02-AM5-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 */