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: 13661302 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 0A223C25B10 for ; Fri, 10 May 2024 10:49:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.719760.1122597 (Exim 4.92) (envelope-from ) id 1s5NoX-0007bV-DI; Fri, 10 May 2024 10:49:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 719760.1122597; Fri, 10 May 2024 10:49:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5NoX-0007bM-A4; Fri, 10 May 2024 10:49:21 +0000 Received: by outflank-mailman (input) for mailman id 719760; Fri, 10 May 2024 10:49:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5NoV-0007MJ-Mp for xen-devel@lists.xenproject.org; Fri, 10 May 2024 10:49:19 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f34551cd-0eba-11ef-b4bb-af5377834399; Fri, 10 May 2024 12:49:18 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-41ffad2426eso3650765e9.3 for ; Fri, 10 May 2024 03:49:18 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f34551cd-0eba-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338157; x=1715942957; darn=lists.xenproject.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=WGWLDirjkrVHyU6JwVlrULpLZGf7hJrkCfjZuocw28RRNUxenNRpApohRTL7gTxWKN zVyQUWf75wErhf0SJBNR7rSwd5RzUzJKGPW+jckrVVU+sPkGTmjWSHqKc66lebQfNccZ r3vn9jJ9CPqdrFup+wNc76W57DgSv85ifbk1U94JiW7AK+U40ncM5EyXl3oXc8uuYdPb yi3/QRHd1d4KMagHgwzzb0iYpztAetFyfBtkGHKDMyQ3IS96K7PIOhU5bPAenVom09rL vdKmjAL5XRYL0n7srcbXowJfhiwl2EIA3aHlZ36wtBOKTCubgW4hFC8Kx+7K1moBqN4n xRhw== 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=cYNt/sziYvK/qsyFYgulknaUDrmEUiPltyIZs4ltqg1m8HM49a4KcPCcpzuJKWYD7J 5pe0CzKBqycSPm5Fn7KF4ArAbZQhoQkHWABHYoUAeP1At7KTJJbcx4bcoGBr7QMsUk0v SAB9nEsoCASPJ2JI1o4s9etlYAEdNslWkAkZRLB8dtDdaGZGOuW/dYsq6fcsHqLrobIx rfD0BG78pj8At8GjREl0jIuyZnuR7Gmu+MbndQ7wk+1eUV8UI0XxBAjbITNA3DdejX4w GfhjkUAVBEkr2RshVSVW6aEFZmJHNzM2GaTP1O02g3poHW1055rbOzWRU7UnbbGHfvw2 GQTA== X-Forwarded-Encrypted: i=1; AJvYcCWoebHz5D7K6R8nRYMfnShiZ5lIvOJ/fX0QRbDC4ywIYjOKxixST0C4Yld2Av/Fmgsz0kgi922sh/Yg5Ih2rrZMEKGLwU3ZsVI9ikOKiVE= X-Gm-Message-State: AOJu0YyMqT8xVY1nP1o7dkiF3DRW/F40c2XVPfDovlEC+LW9INZLWj9B 7qMyaibAg25Cje/20EEygK3KoN2V3IHkkzclxdPeNm5xrP9maGBIx5JlESvHxRc= 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) 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 '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: 13661303 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 26407C25B74 for ; Fri, 10 May 2024 10:49:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.719761.1122607 (Exim 4.92) (envelope-from ) id 1s5Noc-0007tk-Je; Fri, 10 May 2024 10:49:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 719761.1122607; Fri, 10 May 2024 10:49:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Noc-0007tb-Gl; Fri, 10 May 2024 10:49:26 +0000 Received: by outflank-mailman (input) for mailman id 719761; Fri, 10 May 2024 10:49:25 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Nob-0007sQ-HF for xen-devel@lists.xenproject.org; Fri, 10 May 2024 10:49:25 +0000 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [2a00:1450:4864:20::233]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f6e23306-0eba-11ef-909d-e314d9c70b13; Fri, 10 May 2024 12:49:24 +0200 (CEST) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2e538a264e0so7789451fa.1 for ; Fri, 10 May 2024 03:49:24 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f6e23306-0eba-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338164; x=1715942964; darn=lists.xenproject.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=YiearKB/mIu9+rSlpfPyjFaEzdcPkvOzunu9UYVmdCLQSVOVENujUBdRDGAaWJdiNU T9kl73sB+LhujSJqZnAIwX5OaxEU60uDQEJf0/icpor8BA3WnOydayMRW7QZABX/SQ6b HTUZkHC/fy/+UfX7cZUKpWfbrEmq6n1BVrk7VQ4f2F4BBdN2mYwBAViwute58nB86MGu gjqT6fMHEyhOxoFTc3Zp8ffyZ9FIuiPC9SsWYsK/I+hZyj5klTsQGsiKwuybUz8LLbAj Xmb4UTeKpcMq0KMqe0ZRDcxQS0a+qxGdgLs7uGDdZNC5l8ATmuj6wu5rGS29js84GEd6 3TVw== 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=HLjMrzKBUnMEUunN2jxrrpmVQ1ArCK9QWfZ7/fj4eFg13YU48iq2Tqkw7SUcd77/SX x+KLMHuTeQd5e098V47q0k2DEHgCU36FUnuwKYUYQL6cJunw1KJ2q2JmWAHyus1IsEpX Vn7Bwf11ZKcl+2viSO+xkOeowIZZqWcsjZFAxF2mLQF7DcMBF56pbQB/ZhPn7S6yS77o iqcEQqGFbX4JHB2lom6M6z4+NpFbHyXG1iwhT9pKCyWUQ23zEc+bn8vAmK4rhwl2M5r0 KN2rpEiXZrjWpmRAIIr/+4MqO7mf8Oq+AApQiCF8DCy5HcbpHC6xgNwxeu6a7BivYnad PS+w== X-Forwarded-Encrypted: i=1; AJvYcCWCjjjDelFk7bmSUnjP8WU1O6hxqIV/VB+4gcNK3T/ZRXlFNfJlBlqqO8URc7pCo7tJXDt/ZQqvPLSW9Z5Cfz2PStia6RiXfejONCORuL0= X-Gm-Message-State: AOJu0YyxJseW1pOQW7u7our+eIX7Ir1lNTWp/PW8sY0xktFvpHSoiBLK uivlWO02hf1EncsENlOHsjkPmg7Wk5HDHZ2AmFkliiFBmt1m7y2+1m3f5Xcrz5A= 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) 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 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: 13661304 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 A33F7C25B75 for ; Fri, 10 May 2024 10:49:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.719762.1122618 (Exim 4.92) (envelope-from ) id 1s5Noi-0008Hj-Va; Fri, 10 May 2024 10:49:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 719762.1122618; Fri, 10 May 2024 10:49:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Noi-0008HV-Pn; Fri, 10 May 2024 10:49:32 +0000 Received: by outflank-mailman (input) for mailman id 719762; Fri, 10 May 2024 10:49:31 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Noh-0007MJ-Ou for xen-devel@lists.xenproject.org; Fri, 10 May 2024 10:49:31 +0000 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [2a00:1450:4864:20::334]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fa5aefe3-0eba-11ef-b4bb-af5377834399; Fri, 10 May 2024 12:49:30 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41b2119da94so12276475e9.0 for ; Fri, 10 May 2024 03:49:30 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fa5aefe3-0eba-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338169; x=1715942969; darn=lists.xenproject.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=YaRAKhpNMVRrQIrZ80PwU3rbfxaLvgjW4SiRcIGQ5kf+8oDfoMO0sE58LCe0UAJh8g vOTvD8tgz/lyDNFL35xVPyA8ouWEd/26fAz/qKGTZM19TAJPAsNMt7JKLCSIKns4rr97 P0RfzXUVyfxRut6PSgeNsbke62evzwW8I0OPKYJZZHmc/95QU/pZgJ0Up/EvXjya5Zu/ ylHPWAE3nW3d8DfeueGEgrPGLdKlH2tg0wcMI1TbJyfLEangrQbPCohD93Fj19YCZaLW GynwdBVylaaCF1Sz008eYMc5ckEJHQOKlMgBZ4VnOmpWatISSIJFMJhmeUuOPCFwYIuH 4szQ== 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=Zw7VqXMCkpzpOCnp3EBcdcLBRabCUvZzRIYL2g0jV7a8pkgdFe4/jTdozp4AflDF8t EMQJ3gkTnxhE5MEFkfJgNjqU5n5V4D8dGHstL6LdLLSo+6xbnVRrKLAWuquQs4D47seu H8yEDJWlLUiJ8xr/8lhPicFgV9RZbQ9xqJ4O8rfFnacUtG/AEePrGo0hgHJ1jQKYnyNu jlLB7JFxqP+Bf2p22FWP7joSjmIYb4UbOyzIuDzLuJYgV6YtiT0H1S7lHjsCOFFYqGYx YgZxCTl4f2biJ/pAQR0qJFzbf0uFbTVTruq5Tu8u4+Z9U5jIBRO3NK07ObnyPEc7rCeH mrIQ== X-Forwarded-Encrypted: i=1; AJvYcCWVfoDiqpTpK5mYY3IA2uX7nOKNz8ErAE5LQJwATfoGtfuOo374PKQziA8qBQNNwPeilzDqlEEf09q4OUV7e/hhRLWDayeWhSkrqpeKw+4= X-Gm-Message-State: AOJu0YwQx1Tf71UtFrdGG54pWHGNibT+PjF6xjxfr6z6Gykw6gC8NICD h5Kei48tIAVkRrVapvQf0t5apQk1HOr4M+prhrmbyWYyDq0lAuQq8eMgRY6Udw8= 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) 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 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: 13661305 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 E748EC25B74 for ; Fri, 10 May 2024 10:49:46 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.719764.1122627 (Exim 4.92) (envelope-from ) id 1s5Nop-0000Ld-4x; Fri, 10 May 2024 10:49:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 719764.1122627; Fri, 10 May 2024 10:49:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Nop-0000LW-1i; Fri, 10 May 2024 10:49:39 +0000 Received: by outflank-mailman (input) for mailman id 719764; Fri, 10 May 2024 10:49:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Non-0007sQ-Pf for xen-devel@lists.xenproject.org; Fri, 10 May 2024 10:49:37 +0000 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [2a00:1450:4864:20::233]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id feb9777f-0eba-11ef-909d-e314d9c70b13; Fri, 10 May 2024 12:49:37 +0200 (CEST) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2e271acb015so23950491fa.1 for ; Fri, 10 May 2024 03:49:37 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: feb9777f-0eba-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338177; x=1715942977; darn=lists.xenproject.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=e7LX8ldC7IbLCg3cad21oVjET7xzBXL/XwYHj5BzLtk6xvTaqAVvBkCUqwCyc5g8CC 54s9Lhi24PifFYcFAYkyjqvtLWMwhln4Pm+CUrzhaD2TtC9IXkBkgyLnJemN4I9UZBUz cPk0A6PNR0C4XawrVtPmoJHs+6LMtpjofob5pEO+HuVw2qYd758w62VI4srl0xlK+TUB 2LB6BfptbrTCF85lDEiRDUBPEltcjLTVumaBdPCxq2e2tTsmsO1YYxaN92QqhFjyjTYN QoB8mNYrzPslogtzzOZAxoGVssrVzgV/XdD8xKg4/t2oJNTf1jhRtIFRUFhIRDXkz5LN 5q9Q== 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=Qdhs6LcdfYlkpxjmz3qNNjSWCnYjfdZoi5UHFKeJKUOQpJ02jFFoBPWoX5kzHx3KnZ PCzyJwZtlweHWFM0SwI0+aqMbudBSMrP7610K83ubUbOHS0prqswAST6I5i5/8fKu4ch byO8GfKxhUFPW2rLomuNg5s34AMHEi0rMfbazJIq2L0zhPRB5DjmUBye43h0upOkb/d/ 0IP7o23CnpYPqdJ4UZQK2sJwZspyMbbTBWTBpeu7JJtTtHUKO/Y/YerducwdKp9KPbTu AHU56Rvs9rCCT0wugLmmkQegEzm043OnqQYBznhMkWRUCnOiuZjnCP3JNbfOxBQCoxgG 4m4Q== X-Forwarded-Encrypted: i=1; AJvYcCUvXjuvf9NLUrNDH9XvqOf7zN34lCRIPK6quNDa9ZlnsVv7GuVxFJE2rRXKwPGmB6vEkGLs/JxAhusaJ+ykQjYOcxT4+a/GgoNxT5O80VA= X-Gm-Message-State: AOJu0YwprW/sBpaPMrKjUE8wIvqaaNxaB1hkean4sHEy5GsPo75Plw0m SedqL/gg5bmgxsWEU+WUDIP4wj6M4zlzAaDf88c0OX+sBWEdvrlLVY1KxodKiLY= 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) 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 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: 13661306 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 A9435C25B10 for ; Fri, 10 May 2024 10:49:53 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.719766.1122636 (Exim 4.92) (envelope-from ) id 1s5Now-0000uj-Ft; Fri, 10 May 2024 10:49:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 719766.1122636; Fri, 10 May 2024 10:49:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Now-0000ta-CY; Fri, 10 May 2024 10:49:46 +0000 Received: by outflank-mailman (input) for mailman id 719766; Fri, 10 May 2024 10:49:44 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Nou-0007MJ-UD for xen-devel@lists.xenproject.org; Fri, 10 May 2024 10:49:44 +0000 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [2a00:1450:4864:20::334]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0242e75e-0ebb-11ef-b4bb-af5377834399; Fri, 10 May 2024 12:49:43 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41b79450f78so11940995e9.2 for ; Fri, 10 May 2024 03:49:43 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0242e75e-0ebb-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338183; x=1715942983; darn=lists.xenproject.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=ejok603IdcxQfgqps6+fPbxbUnH+knmZrcZUrCtY6LGZMmtqAJa4d/W2sH9QL7+u9H 60vtIG3HiCPKSHNFRGaOvdRes/FxcvZffoJuIPAHjdIq1aP0PHVEmDvYLFU+njJFHaSG NtM/T0rtxiO1ALRpMV1PMjMJ1wxC3SrvbH96Fou6P2g9BDpX4zpxUD07TpgdDQo8py+9 BULthWTn3dym+ysKlHx+zmAc7nEY3QXojN5GduB3kjFgBXR/xEIeMQKhU+u1YFXz8vA+ cYsbdHILhkBgeUYVNMYG2dG4JzWc0POSCSj8l1EJ5WGa9mqom4g1Cyy4GclAFOMM2EZD SAUg== 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=cd+HwZPpZbOLioH0yayylsGj7bcpX3bdbPh71Ye6DY5at+egpwQh5tpU4ZywhP/1N1 5a6cfPbbLA4ixgl/6rO/ILcVgP9jZpOm/G8qUxVHrrmKuZrVGJVTdc2ldq7Bl9q39Jfg /QLAhgfGSCCT9GmYtpeW7m3YU3CICw3W211d5D0zZ8t9LdGmnx+8flaReglkXmnTOEkO ZmsgkKMvLGsLyLyOwTBuUspXG3uAtJn5v3CMZMLj/dPvshxjiL2cZFjyWCuDvIlMGgf/ ECxL/KbB1+aroUZp14spkMoycVr0S/3jir9OeSpQV805qwtxuTNNaNmevrRj9b2D5GwR QLDg== X-Forwarded-Encrypted: i=1; AJvYcCUhyKXxKfOlfvG04RnPd1HKHR8VVOVW8Qvh9evrPWBOZY0ZGZffNxR0UfHlCYwk0Gz1rT+8QMYff5zz8fqKJt5EIhFY5QU/q1/ZHDwxOBk= X-Gm-Message-State: AOJu0YyfeC0UG/sPPAf8YwsIpaheXXbGyJ1WkB/YbQanLk0wBL5QJywP pPdMjK2mi3dFaWQBqqM/+CEbeCu9Ft1eiRO56Q3m7tggRY6V6xQ6SbZzbo+AIHs= 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) 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 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: 13661307 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 90220C25B10 for ; Fri, 10 May 2024 10:49:59 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.719771.1122647 (Exim 4.92) (envelope-from ) id 1s5Np1-0001Mg-Nc; Fri, 10 May 2024 10:49:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 719771.1122647; Fri, 10 May 2024 10:49:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Np1-0001MZ-Kc; Fri, 10 May 2024 10:49:51 +0000 Received: by outflank-mailman (input) for mailman id 719771; Fri, 10 May 2024 10:49:51 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Np1-0007MJ-3Y for xen-devel@lists.xenproject.org; Fri, 10 May 2024 10:49:51 +0000 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [2a00:1450:4864:20::236]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 05c4b305-0ebb-11ef-b4bb-af5377834399; Fri, 10 May 2024 12:49:49 +0200 (CEST) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2e538a264f7so7492571fa.0 for ; Fri, 10 May 2024 03:49:49 -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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 05c4b305-0ebb-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338188; x=1715942988; darn=lists.xenproject.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=Sta0JE2ikyWuGJHzkCb628DYKvp0Hcdfrg5T9n6zjT579Subv1/7vE9N54eiw8h6PJ SMW7sjJtq7yJUl4Egptv95DlR2b/AV53StOH9In8rf4KVZBbJnQbsW8iXUGOIxsCaLsq YWU28a0PikPuueXwzhw1HAqzk8+aL7xvLB8BHXs9wRSgZz1cq0iFbqhlnVH7VRP/WN15 2sxauccTT+fGUtgCoGXU9L8aIuKW/vnLucfq/JO1+CbvID0OQlZNnfeh+M0LhzolLO0l TKrodb0R3Xbjt9B6c9Nv4JWSfEn0xHPzNlih9scZOp1iu+cky1Wl1T5amot0kX1/bSKw o1qg== 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=lhvTLEaUya6QhYtFFnGOFraOc36qBeFg7TkavMWz8KhaC74kZuEp64mSz/Vfnk2bWo LGpC4P/saFpyWmLrELOKCfHKWXdFRBi/YVqgh6z021idPd9KwAWQfnzPyzpxe6Orzjw0 aaHMD/6txJSG0WDt7g7JuOOq4rm8zL6OyjoVv0HVxM6u5rsI7SFEwI7aIs/dlid+DToM 8OIVyxNtQ5n0Owzvvry/KdgEZcA1WwHPILQv7Y+gWtQERz9cWms82wnFRGZr9xsZ0R66 kf+eGTXDirTAy4/iEJJpCkrdEjJTN8ZPNth2jepzxu9SHIeAJ8gS+07fJs4ik15AUaSC iGww== X-Forwarded-Encrypted: i=1; AJvYcCWSH0d1X77BWvtgRG/VWXEWQRHOckbI7qJHcnQ3rW/q14EYNkcxT9DabnIDsHiy4NHJZkcKs6wQLEAARNnhyI0O0Ut4eVAFwhVmDlYqu3k= X-Gm-Message-State: AOJu0YwblU9j3oBhSkACnZGNsjuArUtEpACfPpBFcVkGjBXMSH8DpCAP jpP69SLwWpxwXL0cLKxxw6JP3631Po7llnHNzD/r24XXP99XwUM0UXOjl5QGNNg= 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) 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 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: 13661308 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 8936EC25B10 for ; Fri, 10 May 2024 10:50:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.719773.1122657 (Exim 4.92) (envelope-from ) id 1s5Np6-0001k6-Uo; Fri, 10 May 2024 10:49:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 719773.1122657; Fri, 10 May 2024 10:49:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Np6-0001jx-Rj; Fri, 10 May 2024 10:49:56 +0000 Received: by outflank-mailman (input) for mailman id 719773; Fri, 10 May 2024 10:49:55 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s5Np5-0007sQ-FV for xen-devel@lists.xenproject.org; Fri, 10 May 2024 10:49:55 +0000 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [2a00:1450:4864:20::435]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 092f1925-0ebb-11ef-909d-e314d9c70b13; Fri, 10 May 2024 12:49:54 +0200 (CEST) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-350513d2c6aso461525f8f.2 for ; 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) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 092f1925-0ebb-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715338194; x=1715942994; darn=lists.xenproject.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=IvOZucE8hH8TOcDSfuzDd82e9OeYpCLk4a8VDxP+3ybBISDaV33EnKG1lmBj4cmWV4 u92uqVsh+MASZuM6GUrXRh9SJM4dyDiod5bFjPcMfoTL82szKrNn08kUYaiy/B+Iq4NO s+h/4FaPmdvQfPQ06JgKeRN8FpC94Li6fB0U7bWpYcsNOgqjuDyw49EIPC2zBAJdV7Yl 1ezIzr952wrqZNv5qP9FsH14r0tauQf+h8nH0MAk8OI24xxgLQQ46mjZe/FMKWtY0IXh n6G60PaIVvefTSGhLF+f4/JoNmuybSvKnMZ1qoybm4l5bIe0JvwPoxdsTfqhGdzA5Dfx 6WDA== 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=Gz7Z5ESAqEJWgPL8QbejG/75CdDwGlxSDET06Meov0CAb0G837HeQrbMU6AcIuddoh 0ibHDreKTsdJa49JEXDJ/dOA50hg5Td2nUToVcbBQuAb2/lXUzb6CMQ2AfmBjPRw1yD9 1qOs+iKEnVuoOayAWXZbiXPqqWc3Q7N/VPex9DjRhuDA73zFaOQ7d1S3DtNR9WEayL2K DdtyIYWgxvmmQtackt25IfTVDAOaiNvd4UMwJ1fOuEXDgW1EpnV4jyMDQHS4yWLaUmfS fpPWX8hNxC4+V/pt1nj3acESuDPBlVuhf5ZwhP+6dxcwcVeEakZwp886Rv1VozER3dH+ 3BKQ== X-Forwarded-Encrypted: i=1; AJvYcCX2Ajy/OYd20dAqtzDhnnA4mnlKkYIM95pJb4EhL5T+w668AOXLXs1eFWRzhhEli8Txa0pXlNcBTz67urgRWMvqJNRB1177p4TxFwO72IQ= X-Gm-Message-State: AOJu0Yy5oJ5QvTkviDG0hqTG98Bcu/fstJe40a1lCtU+Iz5fIGI219It ww7qibY365sc+ui1TlcXGYESk09WdZiSmQPA87vt3SGQNco36clewFwGOV3nEig= 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) 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 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");