From patchwork Mon Oct 17 07:28:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivanov X-Patchwork-Id: 13008279 Return-Path: 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 A8263C433FE for ; Mon, 17 Oct 2022 07:55:50 +0000 (UTC) Received: from localhost ([::1]:50224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okKyT-0002Cl-Nq for qemu-devel@archiver.kernel.org; Mon, 17 Oct 2022 03:55:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okKd9-00086T-S4 for qemu-devel@nongnu.org; Mon, 17 Oct 2022 03:33:53 -0400 Received: from mail-vi1eur03on20712.outbound.protection.outlook.com ([2a01:111:f400:fe1b::712]:45774 helo=EUR03-VI1-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 ) id 1okKd6-00029o-KY for qemu-devel@nongnu.org; Mon, 17 Oct 2022 03:33:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/435xY4cQzD8asLbZX06jxFy9qLvxThv1z5VZCh/mcXXq5jNiQStDol7tDmV0KWV2QiXk0vf27soKfsw1yeos+Rkk39TM33R7WGheYjttnl2xwBgzDbDOluFdLZU8UIVYGMi/Dnvg42u9YIrFIZ4AhcByVO3girRS5zIv15hjYWA+wpqaWsFgHOPNaSYCZkaOu79kj0N6JpXFpWm6D2GnYH+jHARSHkFcfVExSwdT9QJPnLmd9/4jztIhHVw/ayN+Z6RprZEEY8PTLxSq0zWbywzcnf2Hm8ewigDVBihm+kUqZg/p3R9ZZGlMYYoLdvnvKlb9Qz2fMxXBqX87OMsw== 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=gDgFxlHu3tTZq1W0DmzXFYX+CvAiLxpvQeQbsn/Ns8Y=; b=cZX0RBKEyuBQ3dsw2/qF7+OyZR5Dceg3oUNpbrNTN1Hrm0eD4aKIlqUnpIHanO1WxhKhsi7Kgd70U4ILLwszawVHmY/9/54QOB8qH4NpBdvgE8NrgN6T7hUOw4gu0CiYouQGTW+VP4S88K6U1gZrwmhNnkCNApQMywGGSg/uAP4Kp356yU6YUGcjb2d7hQN5y1XAh2idBoVJn3LJto+Fmf+6wnXCfrfgT2Cvzl/D6D/KgBWmkq1l9C6j166QNlqL0NfRW+GIQuHPGZ0gA6jVskVq1iy4s7uKxkKTjxKr66nrh9xNL85vgdlTXomPK2pZ24eCwdpat0UhD6lpReoggQ== 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=gDgFxlHu3tTZq1W0DmzXFYX+CvAiLxpvQeQbsn/Ns8Y=; b=mDeOxTG8+gbUEHL+XUfWttJ5cbyATu4e2NeiftDyaOOQal7Qnp75s+X8bowbWCTwBV9onuImJFykDR0IoOR1JUGqvXVBs/KPQvZt5mn8Lo99S4L8PTLI9jJRbYpCxaORPEI3Tpdm3wF2WyYUgGw6V393jqF64uKbhkdU5vtxern/ykIDhsflzR531GV6nrl5vcma/gyfsx56h6bH22PWIW4PHdCde1LLxFVb5tEyHC+YEu7zHa4kf1aA0AC5IwL+uHU0VqGU/KMKC/4ZXF4XlUMFZ66y/pVcBpLrYV5IXKpl140FLrdu3ejOOwxjyD/qNGFVANL6uZh1SKJyqjhQTQ== 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 AS2PR08MB8286.eurprd08.prod.outlook.com (2603:10a6:20b:555::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Mon, 17 Oct 2022 07:28:37 +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:36 +0000 From: Alexander Ivanov To: qemu-devel@nongnu.org Cc: den@virtuozzo.com, michael.roth@amd.com, kkostiuk@redhat.com, marcandre.lureau@gmail.com Subject: [PATCH v5 0/7] qga: Add FreeBSD support Date: Mon, 17 Oct 2022 09:28:18 +0200 Message-Id: <20221017072825.72867-1-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.34.1 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_|AS2PR08MB8286:EE_ X-MS-Office365-Filtering-Correlation-Id: a21a9870-c9d1-40ce-42bb-08dab0113465 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rgprKjv3uEDwnyrqxqjb+FhO5ImyVwQgSGl+FKcW0qEzSBDeYfFyE1Dgup73SKp2SXiPZiHE8Ort44UHtF3Zy0fV2XnrdRIbZ2F2I4WB0EDfFhhGsD/3MKSWJiDsUqzJYrqkzGEA5MmQ/WKRBybDr8U5jYmZcLeGMzEIw4Ry/U+eX/5WELQSvGMCzSkDsyCC43b8lhHeq3oGdvf8UWg3ch+rTiYgwok0hGJmm/U52lADORYnZXor4VjLK9Ktwke2PIEKTF3jj6R6w2Tx1cP/EMsKUJdwy86BaQgeXIuFxQC4wYzXyJNzj72u0Fh/ViLTHQuW7JJOk5lp4y4g0LsTezBYMWFvqNy8/oc+OZyfSgXpDEJPNok/RTpI3IKEkqjb3Acj1HQUrT2b2MZ7w2tP/UCk32jEnKecVARNIRAiCrOnP55cg8o+Kn3ZtasmRdqDV/fdEK2mWsr5YDdpuMCWe0/Ao7HyEnPktsUGHYqoJpp0W1J7hHYzLEedocPlsDd70tR0yUsFb65MEu58WRIg+VfXbIextytP1HD1E/1cqogiYTyZk4EYaztHl8FuEk2Ls5EPY/GC8W0RYIep6iEdUJlhEus0aNpyywW3Gmo1llUd6KFTA3pdCBEEwHGai967Fu6BZMM1JLF9CGToehFy2LWmvmd1CDfhSBWxU1vAWCpGOznT45jeCLv9MINZJsSL1CBgbNGcDMVRMErZD3AFd54gLr646lEWgqQrGMMnOlNluNBFkD/S/uG7Dhgd82At 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)(346002)(39850400004)(396003)(366004)(451199015)(6916009)(66946007)(8676002)(66476007)(6666004)(66556008)(36756003)(6506007)(41300700001)(4326008)(5660300002)(316002)(26005)(6512007)(86362001)(8936002)(83380400001)(2906002)(2616005)(38100700002)(52116002)(186003)(1076003)(38350700002)(478600001)(6486002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?tTNUEBoiwCIAdjF4LAwb6olshGc6?= =?utf-8?q?+CSp03EwglC1kr3lGT3n49bJaPrTZJrlInJQ0LT7TAwmPmMfGLyEajPHb1vmiWAAK?= =?utf-8?q?IoueMQzTB0lh4PSfFagHOhGU/qdea8g36ZPsdLu+ylarowdvK5F/e827F2dGMTv5S?= =?utf-8?q?Gtl4V3CH+AJM6ud01JIWAqambf5JtM/Y+ay6dolNf+XbkT6bZJZI+vc3adZTpDPOR?= =?utf-8?q?wi9MvP0M0wUYmxIbZ0/a6Kyjr9AEnOcPL52vUG2SBnyFFQKFT6fWjT+sH2c4sLBjf?= =?utf-8?q?62IoIFQpjOvhLTjNVF8A8pvaboXw1dk6uHGPlT1NzUWsrIi75yFsm7+Wn4PSMk1Kk?= =?utf-8?q?MTlYAjHMR9T2CA7CemER9Q7FDEJnQ8JVneNurIHdm+BYIox49CURll4WenUvazmQg?= =?utf-8?q?tr2uADo9WfY1pRO10CaNp3vOAsMO5Txh5d/HFf6rWcmF7SxEaSOLp5C8gIdlWNM9c?= =?utf-8?q?FfwQ7IvSMLaR37tjCzSik0oUoqXjcx3eFSup5VIuGFiqUThvCY/Ct6Bu8i0gvev2y?= =?utf-8?q?tF1oKabOAecXVhWd2NV3EPAUixZjK0u7a6sEsiDVm2Gl9aN63CWPOHmyzclfJCTzJ?= =?utf-8?q?5SrHzN8L+q4jMLywWGSak2ruQDP0J97HwNApzHqfyWaCXhIEjbZMH3XMwuFmhioWE?= =?utf-8?q?E0DzqtNYatWcSnM+h1hkLwnYqRywq6pK6BdWQcTwWown2AEtvNYdWdadx+LJHd2lf?= =?utf-8?q?N6SQwbRIQBc1A+puIpImOmpnJtYpmmDtk3eVMIwfWd+3S3L+qFN0W1GzIGX+0578+?= =?utf-8?q?IGkfvQDyiENCgZWOR84ZYNbY76PVgfsLCw6XaqZD1a+Ai/QSVrVK6VRxwHtZWX9Yb?= =?utf-8?q?eM7nzuuy1mFGF9ccFzQ57zE8edC24eXVR8YwXyar22+9Qb3J4Jrn+JZqaHGJ6LHw1?= =?utf-8?q?WJj9ocF1jY8JHzTFDEjutrocUuDTZpBpXnqxE2shdx1ONZxMxTiSzpqEYma4BWMHK?= =?utf-8?q?luyZg8f4tFJ5UAEYxNsuw+9C0Ff24evc0wHqvIoU35IpcUzbveOK5Gh6hZD3kJDju?= =?utf-8?q?pHUzp02uZi1EUGF1cI3Kn/L6A703E3RK0oscljemE64fFhoVBhKd3UGFfE8Zkgdpa?= =?utf-8?q?w6dyBhXP88/R+JUrVyY4lhqD0pEp5DGsuZAolGgVXf41H4iiixKyQmZZP7/qG8GHa?= =?utf-8?q?sk8gAlR5927WiwQwwQAXTp2KVSdSp/6+SA82gjIxpzoVXqzUW4g2sCT+e7Seti3uy?= =?utf-8?q?MDN2hVuUmvseJK5ivBCYOufaQWlNIzXlrSi+kj9m5y5MYX8Wf3nVpsFhZxmvDAWQ6?= =?utf-8?q?GpNTIPYzq128guU1zlnr+/e+5H1PKpZfPbEzEWBgJGn79bO9sJplD7e/mv0KtPxVd?= =?utf-8?q?ehvnI3AbUC2DjZe5bhDUugYxKywxf9AnTBbWu1QfRD3Ul1Zec3COpXbNbLMxyMnj0?= =?utf-8?q?3y7tsXe+yVUXXluiwP414DivfmEv1P/YX42J/oSPIqErT+dISEra2GzmMI1n8gHA9?= =?utf-8?q?tiyzOyD3SiKyQLilECJrVhpRPCeoT9VrhTr3jr1h+ljIksR5rugNLhLJDIm+9JoHy?= =?utf-8?q?3wTcaics4iO2EL2u8mmgHcMlZkIqmsf5AQ=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a21a9870-c9d1-40ce-42bb-08dab0113465 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:36.8205 (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: m5AVmTUlLDh+DJf1ZtvVqnh7J8lDFmWOCwiHE10/t/7WMMp0YNmVtUuWFoRER+E+Zx2o4r9em8vzJkLSP/3Yi5z1A3zxpibclALLQPI4l2k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8286 Received-SPF: pass client-ip=2a01:111:f400:fe1b::712; envelope-from=alexander.ivanov@virtuozzo.com; helo=EUR03-VI1-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, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add freeze/thaw, shutdown/halt/reboot, password setting and guest-network-get-interfaces command support for FreeBSD. v5: 2: Left ga_wait_child() static in commands-posix.c. v4: 6,7: Return bool instead int in guest_get_hw_addr(). v3: 1: Add a comment about echo suppressing. 5: Replace code moving by splitting the code into a few blocks under architecture conditions. 5,6: Move actions with dumb qmp_guest_set_user_password() to the appropriate patch. 6: Fix error/obtained return. v2: 1: Reject the idea to move all the Linux-specific code to a separate file. First commit now adds initial support of FreeBSD. Fixed device paths and fixed virtio device initialization (disable echo). Add comment why we should disable the code under HAVE_GETIFADDRS in FreeBSD. 2: Replace the second commit (which now is the first) by moving Linux-specific freeze/thaw code to a separate file commands-linux.c. 3: Add error raising if stat() returns error. Replaced strcmp() calls by g_str_equal(). Add a comment explaining why UFSRESUME isn't necessary. 4: Replace #elifdef by #elif defined(). 5: Now the code doesn't move from one file to aanother but still is moving inside file so the patch doesn't become easier to review. =( Fixed typos. 6,7: New patches. Add guest-network-get-interfaces command support. Alexander Ivanov (7): qga: Add initial FreeBSD support qga: Move Linux-specific FS freeze/thaw code to a separate file qga: Add UFS freeze/thaw support for FreeBSD qga: Add shutdown/halt/reboot support for FreeBSD qga: Add support for user password setting in FreeBSD qga: Move HW address getting to a separate function qga: Add HW address getting for FreeBSD meson.build | 2 +- qga/channel-posix.c | 19 ++ qga/commands-bsd.c | 200 +++++++++++++ qga/commands-common.h | 51 ++++ qga/commands-linux.c | 286 +++++++++++++++++++ qga/commands-posix.c | 639 ++++++++++++++---------------------------- qga/main.c | 13 +- qga/meson.build | 6 + 8 files changed, 778 insertions(+), 438 deletions(-) create mode 100644 qga/commands-bsd.c create mode 100644 qga/commands-linux.c