From patchwork Fri May 10 10:49:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13661311 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 ECD86C25B10 for ; Fri, 10 May 2024 10:49:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Nog-0001OA-5t; Fri, 10 May 2024 06:49:30 -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 1s5NoX-0001Ko-Kl for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:23 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5NoV-0001UQ-Ec for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:20 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-41ffad2426eso3650795e9.3 for ; Fri, 10 May 2024 03:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338157; x=1715942957; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XVbCv81rAzGflBvcSrzxqDvQbbVCQ+aUGbh/Oa+Rhcw=; b=GpfH6ElDBYL62gof87k7LDlCzRrUU37KUmj4oMkRWiwHb5Ey9EVi2EY5dCkMCs5bJw xgABtdLLEHDi4/qY8sUCaUN968R0AanIkgcriC+J2K1aXEpdyJAxCsf+e+DEz3hKCn35 CCUrTMNJOghpb6GqiR/o+CNK757EW4YlfVv8nvOtw9tiPSVws4Ok31XJl+sk43+ZAHS5 p+KidkmzyBepcVWXnttuXeTeSPRSVKmy8TECG4m0sk/9rQYMU9ud+Fi9Q9NJlnmyQCVu c7wsM4nSlw5+rlgs/h2AEh4wACdJQrVvpASAPwFKRBiXL25YCvGhccsIG8jWc4igN9+d 2jvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715338157; x=1715942957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XVbCv81rAzGflBvcSrzxqDvQbbVCQ+aUGbh/Oa+Rhcw=; b=otkpM4uYIxe5ITq0Nhy7Uiq3AqaVrvalCvUH/Sogd8jxQzWJ2X/hZMlFRYSvfecEcw O88zAmUALU1RULmKVZ7HU/1DoNyEcFqrEPLV9e/fwsetZ4VBa4oBoDiJw5ERSFVzIUG6 XCXjN7r6e9Q8GVfi3wBAgeVxZcp3DYdB/EHMOvT5BgvtLP/tUjoQlRUbfoe7xbf13BBB yTbhMPJ2+ZsLHhd0vhKONRTZFAg2PATYe+hSdonBcwz9IpAFHhJIoMXKGJldMMdHRjuh 7dXOqIskwmHWjEX1+B8K47WDouxI/AS8v79ynyuTr1dZqd6YW66iUElWRpUN8bjvuNjk DYCA== X-Gm-Message-State: AOJu0Yw0EOa/zPaT7FETZdlsPOCBUOdDB90lF00LP5+m1WL1PHCaw8+G npHVRRmWqTNIo2WoG3p+HATL1T8EluCEuBMX2EnX+x6z71Pi3wr0rr8cIvzNmfwzje8eccUwp8X T X-Google-Smtp-Source: AGHT+IHdk5RMerXt6xlL7OKXtzLIPevwNSQsVWTfglLFy+cVjQ0DDHmvBq710DZ/D55SqgKGH3hL1w== X-Received: by 2002:a05:600c:3508:b0:41b:f116:8868 with SMTP id 5b1f17b1804b1-41feaa38a79mr24859125e9.12.1715338157651; Fri, 10 May 2024 03:49:17 -0700 (PDT) Received: from m1x-phil.lan (sev93-h02-176-184-17-152.dsl.sta.abo.bbox.fr. [176.184.17.152]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502b79bdbcsm4196331f8f.23.2024.05.10.03.49.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 03:49:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini Cc: Anthony PERARD , Paul Durrant , Richard Henderson , xen-devel@lists.xenproject.org, Stefano Stabellini , "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/7] hw/xen: Remove declarations left over in 'xen-legacy-backend.h' Date: Fri, 10 May 2024 12:49:02 +0200 Message-ID: <20240510104908.76908-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240510104908.76908-1-philmd@linaro.org> References: <20240510104908.76908-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 'xen_blkdev_ops' was removed in commit 19f87870ba ("xen: remove the legacy 'xen_disk' backend"), 'xen_netdev_ops' in commit 25967ff69f ("hw/xen: update Xen PV NIC to XenDevice model") and 'xen_console_ops' in commit 9b77374690 ("hw/xen: update Xen console to XenDevice model"). Remove them. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant --- include/hw/xen/xen-legacy-backend.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index 2cca174778..eb22633caa 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -67,14 +67,11 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev, } /* actual backend drivers */ -extern struct XenDevOps xen_console_ops; /* xen_console.c */ extern struct XenDevOps xen_kbdmouse_ops; /* xen_framebuffer.c */ extern struct XenDevOps xen_framebuffer_ops; /* xen_framebuffer.c */ -extern struct XenDevOps xen_blkdev_ops; /* xen_disk.c */ #ifdef CONFIG_VIRTFS extern struct XenDevOps xen_9pfs_ops; /* xen-9p-backend.c */ #endif -extern struct XenDevOps xen_netdev_ops; /* xen_nic.c */ #ifdef CONFIG_USB_LIBUSB extern struct XenDevOps xen_usb_ops; /* xen-usb.c */ #endif From patchwork Fri May 10 10:49:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13661312 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 02973C25B10 for ; Fri, 10 May 2024 10:49:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Nol-0001b5-Ur; Fri, 10 May 2024 06:49:36 -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 1s5Noe-0001O9-Bs for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:29 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5Noc-0001V8-Cl for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:28 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2e0a34b2899so27370091fa.3 for ; Fri, 10 May 2024 03:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338164; x=1715942964; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WG6hHvxHnsfDLBmoixzqYQgPTY2J5n6T9oUHauE6pdQ=; b=vNUWPEL137vpjkzPtZF64LgBDtsJHfrQ4caQX8a9BfK0hB60QVQhFzs9qnfepcTFhJ v75LtWMSYAlcusxKQwYDdg2iDZyROIIV9hIFrIOEe4zvxx4nKYxx9td6o+xKYF7cioqr MUCFS2r1NfS6hkphAHFncAiJnYI5+yOcZK2rSBQQOoH5IzoyqP0Cff1uyRGh4IDPGd8F 1wYk164FDp4RD0XwbvBfTFmOGNPGSkn+o4qEuCgu9ZNOTzpf2cQ/2OHdqvkoFaC62lsx +mzmLS0tW2Qxz5qXHExorVToMX0Dfhd+VIrEjv1IdKGFtloWJGRSvPRvaj7mUevZteDx NgEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715338164; x=1715942964; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WG6hHvxHnsfDLBmoixzqYQgPTY2J5n6T9oUHauE6pdQ=; b=j8iuJHBrqC/OpByFuVo6+QHpdMb87AEsTbvLkfisLKmjarU5XV/Wgq7sbJlWQhJ+yo ums9yBL1xVCfh2/8QpoISAVUSjzEW+Gt+D9yfnDXysYZZ/zCkOtKlD5tA1zJJzq4QGc1 KTvSqwefK41fvM/6tfle0KvUHNilOPLd69jX0nT190YL490ciYdYWHaR1R/t69SHhBkJ wen0QikOhGAF2/YmDLtYvh1XkSDCoff4cvysGOEYbJ/gz5j0812u0aehjCpuzY0wGhY9 uQ2xmDAnQ2dPnzg3GLOudFjUlErN47bu2HyuLWPTBEpe5gQ7hFR6xGV84RRz4hz/hnF4 xb8Q== X-Gm-Message-State: AOJu0YyZkEH7Y5npHTQrsF5DhMt6N5DZqKAPKbpAZKxiH03teHdqF90M 7SoPqZPmTMG8jzd2jNeb5zN3BNclpTH/ohtEa74qe42QUOmT8R2EU5mZkqUJh/ckpJo1igfORRo b X-Google-Smtp-Source: AGHT+IFmnZ+GsRWrg13UBzYocLVh19CoDwULJS52v4mItPwgRYVUMX2l1wSejvKjHmjEdqsBZaZvSw== X-Received: by 2002:a2e:859:0:b0:2e5:4171:1808 with SMTP id 38308e7fff4ca-2e541711898mr7342581fa.51.1715338163501; Fri, 10 May 2024 03:49:23 -0700 (PDT) Received: from m1x-phil.lan (sev93-h02-176-184-17-152.dsl.sta.abo.bbox.fr. [176.184.17.152]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502b896a06sm4231043f8f.27.2024.05.10.03.49.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 03:49:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini Cc: Anthony PERARD , Paul Durrant , Richard Henderson , xen-devel@lists.xenproject.org, Stefano Stabellini , "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/7] hw/xen: Constify XenLegacyDevice::XenDevOps Date: Fri, 10 May 2024 12:49:03 +0200 Message-ID: <20240510104908.76908-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240510104908.76908-1-philmd@linaro.org> References: <20240510104908.76908-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.google.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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org XenDevOps @ops is not updated, mark it const. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant --- include/hw/xen/xen_pvdev.h | 2 +- hw/xen/xen-legacy-backend.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index ddad4b9f36..fd9a33e6ab 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -53,7 +53,7 @@ struct XenLegacyDevice { xenevtchn_handle *evtchndev; xengnttab_handle *gnttabdev; - struct XenDevOps *ops; + const struct XenDevOps *ops; QTAILQ_ENTRY(XenLegacyDevice) next; }; diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 124dd5f3d6..35f2b57560 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -170,7 +170,7 @@ int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev, */ static struct XenLegacyDevice *xen_be_get_xendev(const char *type, int dom, int dev, - struct XenDevOps *ops) + const struct XenDevOps *ops) { struct XenLegacyDevice *xendev; From patchwork Fri May 10 10:49:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13661314 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 5805FC25B10 for ; Fri, 10 May 2024 10:50:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Nom-0001da-Sz; Fri, 10 May 2024 06:49:36 -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 1s5Noj-0001Zy-GN for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:33 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5Noh-0001Vf-Q9 for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:33 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-41fd5dc04e2so9604645e9.3 for ; Fri, 10 May 2024 03:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338169; x=1715942969; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lLydyXWVq+dvuttt9ieifXl3jWWZU+LQZOiqeB7g+WE=; b=i6RSJQh65O6XC6dxR/GxkbxNFFPmqg6wVsXvGt+3NT/2UWZy0u4DeIkmq59Paj0A10 uVEdZk5nzEQnUMzFOAKEjbksjIFzld79cJp4nufbxKSkcugC9QWq5OoNken9Xqo5O/6c mw8f7ZQpZ3XvMWlnIk6O/rXuLK18QNIoSuvjamqoyuzSUdAr7FwwXeC2xeSAOxXOFqbS rmKLsP2anpZq9zYXEuBAxCdqVfrvPdPxzxig4IOfPdl8yj5VP6JSTbl/hb28MycH1axc TAKmYaaGqawnbasrAA9tX5mRnSlMV5AH3nuhO6alslrFBLm3WVuwU6BKY0VOcWl8HfeY 3Z8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715338169; x=1715942969; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lLydyXWVq+dvuttt9ieifXl3jWWZU+LQZOiqeB7g+WE=; b=eZHp6BMWGavgLa84tkdCeUuUnxaD4VgIXVpe2d5OKhBoUdl4Ri2jL+Vdrzt9ujDA51 R+smakX50PLy9ZOMdkLTHeLpkwbqDI7KQVP9uL8hhKgon6KTG/7tbb7dKpKGPqk9CWoW /bbX57VwPCOUQD8HtzqNeR2EGpStYbKp6yGFznX734Gm5/v/cDjUtNfUvT4ld+elKova pvOtPD1AF6I1CEyIWd3NVPhNvTBsnFt4sfBwfCuUuyxzFl1SUcbOLEkqi1lZO89rdQ1R C8QKOzsHlUI4HGpcZMh739irHsL/s3/pC10DX9fsDeAMRj2ejB7hDPuSgW95PzklrDj3 an2Q== X-Gm-Message-State: AOJu0YxAfbIKADHaKx5TlsBgoMbhU9ydQmFLxJdVk/W/L+oxuDnkXfXw SirysyALqCR6oXRVm2opNF8VXruuycbNMP5K6ABG7x8cHhcuTNwZ7OGAUrv5qV2HDvTJMQ3tN+2 Z X-Google-Smtp-Source: AGHT+IHGIbDdIaTxFsBrR2IWNVmIfQPPJ+675dXTXWbJ7moWgoCOFX7c+yR+LoYYFbbyaZxuWDMrRA== X-Received: by 2002:a05:600c:3b26:b0:419:f241:633c with SMTP id 5b1f17b1804b1-41feaa2f3b9mr18911745e9.4.1715338169611; Fri, 10 May 2024 03:49:29 -0700 (PDT) Received: from m1x-phil.lan (sev93-h02-176-184-17-152.dsl.sta.abo.bbox.fr. [176.184.17.152]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccce2580sm58674215e9.18.2024.05.10.03.49.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 03:49:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini Cc: Anthony PERARD , Paul Durrant , Richard Henderson , xen-devel@lists.xenproject.org, Stefano Stabellini , "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/7] hw/xen: Constify xenstore_be::XenDevOps Date: Fri, 10 May 2024 12:49:04 +0200 Message-ID: <20240510104908.76908-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240510104908.76908-1-philmd@linaro.org> References: <20240510104908.76908-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org XenDevOps @ops is not updated, mark it const. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant --- include/hw/xen/xen-legacy-backend.h | 2 +- hw/xen/xen-legacy-backend.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index eb22633caa..2b2e43c7e7 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -40,7 +40,7 @@ void xen_be_check_state(struct XenLegacyDevice *xendev); /* xen backend driver bits */ void xen_be_init(void); -int xen_be_register(const char *type, struct XenDevOps *ops); +int xen_be_register(const char *type, const struct XenDevOps *ops); int xen_be_set_state(struct XenLegacyDevice *xendev, enum xenbus_state state); int xen_be_bind_evtchn(struct XenLegacyDevice *xendev); void xen_be_set_max_grant_refs(struct XenLegacyDevice *xendev, diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 35f2b57560..4dc3a561cf 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -520,7 +520,7 @@ void xen_be_check_state(struct XenLegacyDevice *xendev) struct xenstore_be { const char *type; int dom; - struct XenDevOps *ops; + const struct XenDevOps *ops; }; static void xenstore_update_be(void *opaque, const char *watch) @@ -557,7 +557,7 @@ static void xenstore_update_be(void *opaque, const char *watch) } } -static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops) +static int xenstore_scan(const char *type, int dom, const struct XenDevOps *ops) { struct XenLegacyDevice *xendev; char path[XEN_BUFSIZE]; @@ -632,7 +632,7 @@ void xen_be_init(void) #endif } -int xen_be_register(const char *type, struct XenDevOps *ops) +int xen_be_register(const char *type, const struct XenDevOps *ops) { char path[50]; int rc; From patchwork Fri May 10 10:49:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13661315 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 D6503C25B10 for ; Fri, 10 May 2024 10:50:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Not-0001mG-9R; Fri, 10 May 2024 06:49:43 -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 1s5Nor-0001kY-EX for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:41 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5Nop-0001WK-JK for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:41 -0400 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2e271acb015so23950521fa.1 for ; Fri, 10 May 2024 03:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338177; x=1715942977; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4TpUZ8CKDgQBKN9dqD4YnU9Z+7ud1E8NXp6jYp8jowk=; b=Q6MxdewPyisYACr1va8rpSIDpuEv6nM3bDu7i7DMnUd5upAfNt5VbIXgYJk4a3+Jl0 t9cjgVJfTEb+R1iomIWH6vyBq9dloT3QJfVgjsD12zr74eEhwFBBPYQAKsO8DZkDjexj Q5BWLk6wYOOgR6yZwdywmtCHJy0LPyl4ggmY1abCycpyuDS/axJS37P23obVpoC9WC0B DUY3xfE0o2zGZU+vkrKZhoU8+8A+qyLaOsc+krxLnbWf9H5tIwuztd/gDTasOmdGRU6/ bWpwuLX4Inx3qb9gdNtCoLyXUVIIU3aroFJOJy7n9W9R6ivXd5VjnUDs7ZqbVafi+10v IBsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715338177; x=1715942977; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4TpUZ8CKDgQBKN9dqD4YnU9Z+7ud1E8NXp6jYp8jowk=; b=Rt5VvdeC+WhD4F9bGxw8/Lr0UErqHQrdTI/vYQMOCR1v/a958XTtVMAWRCENYKVIeE X5SV7QtFGJWi4g1sIEOKUUGx3p3WvBOrH3Ng2pLT8Qjpvpjyy0UV9lpFLFdsd+7wFpaq eAiuujP6ydrxsfGZvpoK1kzaPvdY/tjfVvwTMX5myAt6WgQ98JPLWDVXPdXbez+9o+Ih jaYtYyoOpoYAPM7ayTB4fzJmx2E7OruS58H96GxOygGOPlacKrLA4dgrC9v7oPqFI2oa QUOWvu5Q56xJzdp/2RdO4Pq25HBQDrkQNNgAu1q6+pcIPE73xrvry/X0VhKiUG8PkIy7 wfpQ== X-Gm-Message-State: AOJu0YwUk1vHtCrNIimLQCytzQMjbQz1QNCcGkjGrdD8myD2vL0PCaZ4 YjbXLpyP3KpoM55lyP//9pwsBHx069CWTawrqVdniEM/4plDSDotDewOxkgAwNEwTUZeWE0rtnv N X-Google-Smtp-Source: AGHT+IF8RYJPL89SDGvqPQidQK0KvxqcH+BiwQtlAacHw890jlHQhQtuBmxCLpPl4I/7qfyZFdFshA== X-Received: by 2002:a2e:93cf:0:b0:2e4:9606:6b86 with SMTP id 38308e7fff4ca-2e51fd42c6dmr14616001fa.8.1715338176994; Fri, 10 May 2024 03:49:36 -0700 (PDT) Received: from m1x-phil.lan (sev93-h02-176-184-17-152.dsl.sta.abo.bbox.fr. [176.184.17.152]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fe004eae9sm42086695e9.1.2024.05.10.03.49.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 03:49:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini Cc: Anthony PERARD , Paul Durrant , Richard Henderson , xen-devel@lists.xenproject.org, Stefano Stabellini , "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/7] hw/xen: Make XenDevOps structures const Date: Fri, 10 May 2024 12:49:05 +0200 Message-ID: <20240510104908.76908-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240510104908.76908-1-philmd@linaro.org> References: <20240510104908.76908-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=philmd@linaro.org; helo=mail-lj1-x229.google.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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Keep XenDevOps structures in .rodata. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant --- include/hw/xen/xen-legacy-backend.h | 8 ++++---- hw/9pfs/xen-9p-backend.c | 2 +- hw/display/xenfb.c | 4 ++-- hw/usb/xen-usb.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index 2b2e43c7e7..cfa43a984a 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -67,13 +67,13 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev, } /* actual backend drivers */ -extern struct XenDevOps xen_kbdmouse_ops; /* xen_framebuffer.c */ -extern struct XenDevOps xen_framebuffer_ops; /* xen_framebuffer.c */ +extern const struct XenDevOps xen_kbdmouse_ops; /* xen_framebuffer.c */ +extern const struct XenDevOps xen_framebuffer_ops; /* xen_framebuffer.c */ #ifdef CONFIG_VIRTFS -extern struct XenDevOps xen_9pfs_ops; /* xen-9p-backend.c */ +extern const struct XenDevOps xen_9pfs_ops; /* xen-9p-backend.c */ #endif #ifdef CONFIG_USB_LIBUSB -extern struct XenDevOps xen_usb_ops; /* xen-usb.c */ +extern const struct XenDevOps xen_usb_ops; /* xen-usb.c */ #endif /* configuration (aka xenbus setup) */ diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index 4aa9c8c736..b1780eb819 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -513,7 +513,7 @@ static void xen_9pfs_alloc(struct XenLegacyDevice *xendev) xenstore_write_be_int(xendev, "max-ring-page-order", MAX_RING_ORDER); } -struct XenDevOps xen_9pfs_ops = { +const struct XenDevOps xen_9pfs_ops = { .size = sizeof(Xen9pfsDev), .flags = DEVOPS_FLAG_NEED_GNTDEV, .alloc = xen_9pfs_alloc, diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index b2130a0d70..dd83d0f5a5 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -972,7 +972,7 @@ static void fb_event(struct XenLegacyDevice *xendev) /* -------------------------------------------------------------------- */ -struct XenDevOps xen_kbdmouse_ops = { +const struct XenDevOps xen_kbdmouse_ops = { .size = sizeof(struct XenInput), .init = input_init, .initialise = input_initialise, @@ -981,7 +981,7 @@ struct XenDevOps xen_kbdmouse_ops = { .event = input_event, }; -struct XenDevOps xen_framebuffer_ops = { +const struct XenDevOps xen_framebuffer_ops = { .size = sizeof(struct XenFB), .init = fb_init, .initialise = fb_initialise, diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index 09ec326aea..95a901e81f 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -1083,7 +1083,7 @@ static void usbback_event(struct XenLegacyDevice *xendev) qemu_bh_schedule(usbif->bh); } -struct XenDevOps xen_usb_ops = { +const struct XenDevOps xen_usb_ops = { .size = sizeof(struct usbback_info), .flags = DEVOPS_FLAG_NEED_GNTDEV, .init = usbback_init, @@ -1102,7 +1102,7 @@ static int usbback_not_supported(void) return -EINVAL; } -struct XenDevOps xen_usb_ops = { +const struct XenDevOps xen_usb_ops = { .backend_register = usbback_not_supported, }; From patchwork Fri May 10 10:49:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13661313 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 2343FC25B10 for ; Fri, 10 May 2024 10:50:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5NpA-0001xc-Oa; Fri, 10 May 2024 06:50:05 -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 1s5Noy-0001ob-75 for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:49 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5Nou-0001Wv-MD for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:46 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41fd5dc04f0so9555255e9.0 for ; Fri, 10 May 2024 03:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338183; x=1715942983; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f6xsQqOmikZFwXbyDk6ZpqqheWDHvbw4l/2JG+MVzRA=; b=ByLvpVQETrEL0LhjnwyS/H2dH8apyGyxayszlwbsr5shLr6TWCJa1RlAJLncUCAP1d SEYGbxY7M9wxz7T46ArOORat3VSfk+PqbRGAXap8UERMC50GjMAfCbpZOwlufTQGRmsQ HN7JejWk3VIpoFLERcO1ibwPKb905O1rzWgZ3KFJzdBK4klNnnrgeoA8BqPCK2Bxt09/ r9PT6cWcryce2vZc/UNJRODsRPns8VbrnQWs3Q+1vBPq67K3npKtKtWm2WnINTGnK+E9 VV0GBn0stE0iSfmK0sjfqCFrGrDXplhPdK5rWAf3Hpy91VglOpjb5nZ2vkQBdntlyaQY FSow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715338183; x=1715942983; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f6xsQqOmikZFwXbyDk6ZpqqheWDHvbw4l/2JG+MVzRA=; b=b8DfjKhYlxJgQafsfQHcBhwrxVNFFrlkwhoz9TNHkByZ12Pq3XasdajAAy69VOlRCL 5aO0KzFRGewAzwbp8D1vNoJBhUnFzn+7XSbSzun+JMOXA3pXrKI/srqlYgmkXqPF+Ojr pIBu0k/SkQrG/i81cQnd2j5UO316kszFIuJxmp0G9aFUVum9XhLxEGu9YH8+Eqjrobxu quEeTmmB//tWER1BvdRQFCIYehUJdbJDdcH/D4ZbjbrhfSVBjbnXlpKfiyveV/Hu60p2 Oz9CfmK2g7J+h8MZ1lW64AnICoGs1KPvIm3TSTBtTobPfqfYEdPbJNVzn2fMzxzIHI7c IGEw== X-Gm-Message-State: AOJu0Yxu1U4ra6bPqOu0BY/5rWRQYCe0Z9BQtYBp7vYsv6EEdE54fxZU XQwmENs+MvlppOPVyv8xaML1ql+KflJJnIKQ5EH4HYyNy1y6yOVJr98wydTtobaU3TeRfpwuA2e + X-Google-Smtp-Source: AGHT+IH3RnmZXXuxt2IBSPxIon61ivul84ejF6Ul9PK/puKcX3RJUgwhud+k6udV+bWCsrG6K2uZGg== X-Received: by 2002:a05:600c:490a:b0:41f:dcdd:5631 with SMTP id 5b1f17b1804b1-41feaa30cfamr23776095e9.13.1715338182860; Fri, 10 May 2024 03:49:42 -0700 (PDT) Received: from m1x-phil.lan (sev93-h02-176-184-17-152.dsl.sta.abo.bbox.fr. [176.184.17.152]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502baacf52sm4278278f8f.87.2024.05.10.03.49.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 03:49:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini Cc: Anthony PERARD , Paul Durrant , Richard Henderson , xen-devel@lists.xenproject.org, Stefano Stabellini , "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/7] hw/xen: initialize legacy backends from xen_bus_init() Date: Fri, 10 May 2024 12:49:06 +0200 Message-ID: <20240510104908.76908-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240510104908.76908-1-philmd@linaro.org> References: <20240510104908.76908-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Paolo Bonzini Prepare for moving the calls to xen_be_register() under the control of xen_bus_init(), using the normal xen_backend_init() method that is used by the "modern" backends. This requires the xenstore global variable to be initialized, which is done by xen_be_init(). To ensure that everything is ready at the time the xen_backend_init() functions are called, remove the xen_be_init() function from all the boards and place it directly in xen_bus_init(). Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240509170044.190795-7-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant --- hw/i386/pc.c | 1 - hw/xen/xen-bus.c | 4 ++++ hw/xen/xen-hvm-common.c | 2 -- hw/xenpv/xen_machine_pv.c | 5 +---- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 505ea750f4..19f21953b4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1250,7 +1250,6 @@ void pc_basic_device_init(struct PCMachineState *pcms, pci_create_simple(pcms->pcibus, -1, "xen-platform"); } xen_bus_init(); - xen_be_init(); } #endif diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index fb82cc33e4..95b207ac8b 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -13,6 +13,7 @@ #include "hw/sysbus.h" #include "hw/xen/xen.h" #include "hw/xen/xen-backend.h" +#include "hw/xen/xen-legacy-backend.h" /* xen_be_init() */ #include "hw/xen/xen-bus.h" #include "hw/xen/xen-bus-helper.h" #include "monitor/monitor.h" @@ -329,6 +330,9 @@ static void xen_bus_realize(BusState *bus, Error **errp) goto fail; } + /* Initialize legacy backend core & drivers */ + xen_be_init(); + if (xs_node_scanf(xenbus->xsh, XBT_NULL, "", /* domain root node */ "domid", NULL, "%u", &domid) == 1) { xenbus->backend_id = domid; diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 1627da7398..2d1b032121 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -872,8 +872,6 @@ void xen_register_ioreq(XenIOState *state, unsigned int max_cpus, xen_bus_init(); - xen_be_init(); - return; err: diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 1130d1a147..b500ce0989 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -34,8 +34,7 @@ static void xen_init_pv(MachineState *machine) { setup_xen_backend_ops(); - /* Initialize backend core & drivers */ - xen_be_init(); + xen_bus_init(); switch (xen_mode) { case XEN_ATTACH: @@ -60,8 +59,6 @@ static void xen_init_pv(MachineState *machine) vga_interface_created = true; } - xen_bus_init(); - /* config cleanup hook */ atexit(xen_config_cleanup); } From patchwork Fri May 10 10:49:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13661316 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 DBCA2C25B75 for ; Fri, 10 May 2024 10:50:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5NpN-0002Es-CW; Fri, 10 May 2024 06:50:13 -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 1s5Np5-0001y8-Jp for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:58 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5Np1-0001Xn-Rf for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:55 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2e538a264f7so7492651fa.0 for ; Fri, 10 May 2024 03:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338188; x=1715942988; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=59LwZUfkdqE1X1uqHmA8fJxVEaLTRUaAXUjy1rLp7lY=; b=IfXz45XKO6AJC67MVD9EQ6RAv8BanVx/Gv4NWnwQFTkgiBg08dAuZev7H9ny5YiVCK 7URbEMFhUlOb6eWfNSnOvB+22dHIauDPDTJxiwpSltdOvo3+ElLyDpjBKJF9G4DBIHRJ iO1A/rMlZ7Peqg/HV3Dp8RN0tLNZrJTiBH6ebBSWFcVnuFeCNg2PdL9e2Uwiq3auYPQg 38tyLNDjV45uSrZqM8dt6TUQzyofkv9zyJOBzyO+AEYx+6VKmW7ucndbVZ9HWLIjGtGa 0NAOyojYyb9AUOa3k3F27K43dm9B4IDJtt02PYKY8OS+A4CoSdbCLmSPNFNNz1cn7lNP IHIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715338188; x=1715942988; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=59LwZUfkdqE1X1uqHmA8fJxVEaLTRUaAXUjy1rLp7lY=; b=X6fiAPLU0TlPS3r+ff3Y8O1ozBwJUyYX9KW1H7+6semO4hu0hA6wiWU4haCMMiS88s ExjdsI2xXcvyZOFQWUCP1uWx8ETKPZrt1TDSImlsa1t8K8Cqv4NM+dQGp6tVHEfPUoxB 0Wbo4VCpIEA/tic9EZdO4ZEh2R6IYemm4+FRuWlS1fF0sfdAfJOes6k0n/v0dyrIksFM x1ixuk+5f6ofywjUP9q98C0D8mSou2UMFJrXUJhjM6i8TchjK6XU97HaTJfVj/vulO5h hCX+ENSvjUClSvC71wuTZ36Zcw/YOw8U/rogib80lWaItUx29Pfye0bSR8maIvYW4hyg ALNA== X-Gm-Message-State: AOJu0YyqSj7SZyMlmC+pNaBJLSg+w46SFpN2T0VYVgM8IB68jcwDNPyO VbSZ38/z83mEIcOO2rAySbG0hKiakKDCSklGp/dDNY9eByu4OECdV5hpl6Fm7y41VMupYz+p5Mq u X-Google-Smtp-Source: AGHT+IHXwM/S059R6UkOB6MRtl349Xb619zHzrqPuRu/IZXAzDzUInG0zBbE08W5hL9UPuwtPHGoJA== X-Received: by 2002:a2e:9e14:0:b0:2e1:c97b:6f1f with SMTP id 38308e7fff4ca-2e5203a795emr13764691fa.51.1715338188613; Fri, 10 May 2024 03:49:48 -0700 (PDT) Received: from m1x-phil.lan (sev93-h02-176-184-17-152.dsl.sta.abo.bbox.fr. [176.184.17.152]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccce2449sm60037515e9.16.2024.05.10.03.49.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 03:49:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini Cc: Anthony PERARD , Paul Durrant , Richard Henderson , xen-devel@lists.xenproject.org, Stefano Stabellini , "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 6/7] hw/xen: register legacy backends via xen_backend_init Date: Fri, 10 May 2024 12:49:07 +0200 Message-ID: <20240510104908.76908-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240510104908.76908-1-philmd@linaro.org> References: <20240510104908.76908-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.google.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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Paolo Bonzini It is okay to register legacy backends in the middle of xen_bus_init(). All that the registration does is record the existence of the backend in xenstore. This makes it possible to remove them from the build without introducing undefined symbols in xen_be_init(). It also removes the need for the backend_register callback, whose only purpose is to avoid registering nonfunctional backends. Signed-off-by: Paolo Bonzini Message-ID: <20240509170044.190795-8-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant --- include/hw/xen/xen-legacy-backend.h | 11 ++--------- include/hw/xen/xen_pvdev.h | 1 - hw/9pfs/xen-9p-backend.c | 8 +++++++- hw/display/xenfb.c | 8 +++++++- hw/usb/xen-usb.c | 14 ++++---------- hw/xen/xen-legacy-backend.c | 16 ---------------- 6 files changed, 20 insertions(+), 38 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index cfa43a984a..e55a14057f 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -66,15 +66,8 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev, return xen_be_unmap_grant_refs(xendev, ptr, &ref, 1); } -/* actual backend drivers */ -extern const struct XenDevOps xen_kbdmouse_ops; /* xen_framebuffer.c */ -extern const struct XenDevOps xen_framebuffer_ops; /* xen_framebuffer.c */ -#ifdef CONFIG_VIRTFS -extern const struct XenDevOps xen_9pfs_ops; /* xen-9p-backend.c */ -#endif -#ifdef CONFIG_USB_LIBUSB -extern const struct XenDevOps xen_usb_ops; /* xen-usb.c */ -#endif +/* backend drivers not included in all machines */ +extern const struct XenDevOps xen_framebuffer_ops; /* xenfb.c */ /* configuration (aka xenbus setup) */ void xen_config_cleanup(void); diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index fd9a33e6ab..0c98444047 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -29,7 +29,6 @@ struct XenDevOps { const char *node); void (*frontend_changed)(struct XenLegacyDevice *xendev, const char *node); - int (*backend_register)(void); }; struct XenLegacyDevice { diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index b1780eb819..79359d911a 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -513,7 +513,7 @@ static void xen_9pfs_alloc(struct XenLegacyDevice *xendev) xenstore_write_be_int(xendev, "max-ring-page-order", MAX_RING_ORDER); } -const struct XenDevOps xen_9pfs_ops = { +static const struct XenDevOps xen_9pfs_ops = { .size = sizeof(Xen9pfsDev), .flags = DEVOPS_FLAG_NEED_GNTDEV, .alloc = xen_9pfs_alloc, @@ -522,3 +522,9 @@ const struct XenDevOps xen_9pfs_ops = { .disconnect = xen_9pfs_disconnect, .free = xen_9pfs_free, }; + +static void xen_9pfs_register_backend(void) +{ + xen_be_register("9pfs", &xen_9pfs_ops); +} +xen_backend_init(xen_9pfs_register_backend); diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index dd83d0f5a5..b6d370bdf6 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -972,7 +972,7 @@ static void fb_event(struct XenLegacyDevice *xendev) /* -------------------------------------------------------------------- */ -const struct XenDevOps xen_kbdmouse_ops = { +static const struct XenDevOps xen_kbdmouse_ops = { .size = sizeof(struct XenInput), .init = input_init, .initialise = input_initialise, @@ -995,3 +995,9 @@ static const GraphicHwOps xenfb_ops = { .gfx_update = xenfb_update, .ui_info = xenfb_ui_info, }; + +static void xen_vkbd_register_backend(void) +{ + xen_be_register("vkbd", &xen_kbdmouse_ops); +} +xen_backend_init(xen_vkbd_register_backend); diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index 95a901e81f..13901625c0 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -1083,7 +1083,7 @@ static void usbback_event(struct XenLegacyDevice *xendev) qemu_bh_schedule(usbif->bh); } -const struct XenDevOps xen_usb_ops = { +static const struct XenDevOps xen_usb_ops = { .size = sizeof(struct usbback_info), .flags = DEVOPS_FLAG_NEED_GNTDEV, .init = usbback_init, @@ -1095,15 +1095,9 @@ const struct XenDevOps xen_usb_ops = { .event = usbback_event, }; -#else /* USBIF_SHORT_NOT_OK */ - -static int usbback_not_supported(void) +static void xen_usb_register_backend(void) { - return -EINVAL; + xen_be_register("qusb", &xen_usb_ops); } - -const struct XenDevOps xen_usb_ops = { - .backend_register = usbback_not_supported, -}; - +xen_backend_init(xen_usb_register_backend); #endif diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 4dc3a561cf..5514184f9c 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -622,27 +622,11 @@ void xen_be_init(void) qbus_set_bus_hotplug_handler(xen_sysbus); xen_set_dynamic_sysbus(); - - xen_be_register("vkbd", &xen_kbdmouse_ops); -#ifdef CONFIG_VIRTFS - xen_be_register("9pfs", &xen_9pfs_ops); -#endif -#ifdef CONFIG_USB_LIBUSB - xen_be_register("qusb", &xen_usb_ops); -#endif } int xen_be_register(const char *type, const struct XenDevOps *ops) { char path[50]; - int rc; - - if (ops->backend_register) { - rc = ops->backend_register(); - if (rc) { - return rc; - } - } snprintf(path, sizeof(path), "device-model/%u/backends/%s", xen_domid, type); From patchwork Fri May 10 10:49:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13661317 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 64278C25B10 for ; Fri, 10 May 2024 10:51:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5NpO-0002LI-B2; Fri, 10 May 2024 06:50:14 -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 1s5Np9-00024I-Ng for qemu-devel@nongnu.org; Fri, 10 May 2024 06:50:04 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5Np7-0001a1-94 for qemu-devel@nongnu.org; Fri, 10 May 2024 06:49:58 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-34db6a299b2so1406971f8f.3 for ; Fri, 10 May 2024 03:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338194; x=1715942994; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4MMieI22tvUHRez0ASZq1ieLRFlQN49cydbbEGQRCXw=; b=z5oMFXzPVEKemroKPdSa3uvc/+olFkBPQzM/e6J1n8ytvMF3jbmFt4MwFTnrz1YXNN fN/d0PTEWueh5Areewg/0jpxjkZITrMH4/qGVMMdHMkCwugR7ItQVRGGGBX7JKNTSeah HdaOGk65vil9aJALcMG2jFK+FlwQ4pymurW9C7lMaOQ+BryLYbdYPmZcq+TRFbxhG/SS trq9f3rXoFNMq8MPMb6Jznc8fyG2hhcK+4GRqvrGL7SZAw2iZSDNnC7EowgS2XgGJRNq nRldid1srx3QYTZUKzjSn16L7+HR28sFQQw6WzcqFi9R+KCG688ZKnqQJ2bxTEmI6r8v SF3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715338194; x=1715942994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4MMieI22tvUHRez0ASZq1ieLRFlQN49cydbbEGQRCXw=; b=PQhMNQS+OTSbI400tzNQ10BO2OeUncT0AoUo6NVkWcnxilLA30JkGH/pnw5d1aMu+c 4wvdP/UFmzdRc85ln7z/Ed2rwHUQhNkCjbo6Y8/ZHNxJckKs8Ie3Aiye15akYeXRW4Y3 t800fN+nyv8PTm07wxd4KELbwjYN68uzBErAWdSZb3hGKYVA47Y8auOqwYSXp5w71vGz +GrwBN9HuFjHGAhnMFAGS1lUk4IoZG8q9v7ms9bxjoYXCZAzZu0mZFtR8mcORgRsII0p mw5s5mTmAz2kuU5ZB3CxFVCvZc6nUyayCOATA8cWeTeE26ZqCu3W3wyoax78YG6JWAcM aTgg== X-Gm-Message-State: AOJu0YydW1UrcrnZodX+5I8jF5N0sZwyToGloABjkKc/kcJkP0j27arT OCmNzkYEKyeibiDQv1mXOBm4gABUw2FSTdCA1qucAGkZh3b7JaBOctuEocgFx5On143Qb0yprFZ X X-Google-Smtp-Source: AGHT+IEewNU5yU5UDos2eDjrq2/6gYromkISrbJeR/i31/cfP+aw0nvt1M9WGWO7AigSVj0qKxcq5A== X-Received: by 2002:adf:ef09:0:b0:34c:fd72:f308 with SMTP id ffacd0b85a97d-3504aa69de0mr1652917f8f.71.1715338194433; Fri, 10 May 2024 03:49:54 -0700 (PDT) Received: from m1x-phil.lan (sev93-h02-176-184-17-152.dsl.sta.abo.bbox.fr. [176.184.17.152]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3502bbbbfecsm4215282f8f.105.2024.05.10.03.49.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 03:49:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini Cc: Anthony PERARD , Paul Durrant , Richard Henderson , xen-devel@lists.xenproject.org, Stefano Stabellini , "Michael S. Tsirkin" , Eduardo Habkost , Marcel Apfelbaum , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 7/7] hw/xen: Register framebuffer backend via xen_backend_init() Date: Fri, 10 May 2024 12:49:08 +0200 Message-ID: <20240510104908.76908-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240510104908.76908-1-philmd@linaro.org> References: <20240510104908.76908-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Align the framebuffer backend with the other legacy ones, register it via xen_backend_init() when '-vga xenfb' is used. It is safe because MODULE_INIT_XEN_BACKEND is called in xen_bus_realize(), long after CLI processing initialized the vga_interface_type variable. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant --- include/hw/xen/xen-legacy-backend.h | 3 --- hw/display/xenfb.c | 9 +++++++-- hw/xenpv/xen_machine_pv.c | 2 -- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index e55a14057f..943732b8d1 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -66,9 +66,6 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev, return xen_be_unmap_grant_refs(xendev, ptr, &ref, 1); } -/* backend drivers not included in all machines */ -extern const struct XenDevOps xen_framebuffer_ops; /* xenfb.c */ - /* configuration (aka xenbus setup) */ void xen_config_cleanup(void); int xen_config_dev_vfb(int vdev, const char *type); diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index b6d370bdf6..ff442ced1a 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -29,6 +29,7 @@ #include "ui/input.h" #include "ui/console.h" +#include "sysemu/sysemu.h" #include "hw/xen/xen-legacy-backend.h" #include "hw/xen/interface/io/fbif.h" @@ -996,8 +997,12 @@ static const GraphicHwOps xenfb_ops = { .ui_info = xenfb_ui_info, }; -static void xen_vkbd_register_backend(void) +static void xen_ui_register_backend(void) { xen_be_register("vkbd", &xen_kbdmouse_ops); + + if (vga_interface_type == VGA_XENFB) { + xen_be_register("vfb", &xen_framebuffer_ops); + } } -xen_backend_init(xen_vkbd_register_backend); +xen_backend_init(xen_ui_register_backend); diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index b500ce0989..24395f42cb 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -50,8 +50,6 @@ static void xen_init_pv(MachineState *machine) break; } - xen_be_register("vfb", &xen_framebuffer_ops); - /* configure framebuffer */ if (vga_interface_type == VGA_XENFB) { xen_config_dev_vfb(0, "vnc");