From nobody Thu Nov 6 19:53:33 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15428134787001012.5519133563048; Wed, 21 Nov 2018 07:17:58 -0800 (PST) Received: from localhost ([::1]:39710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPUGL-0001eU-55 for importer@patchew.org; Wed, 21 Nov 2018 10:17:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPUAz-0005Qn-SB for qemu-devel@nongnu.org; Wed, 21 Nov 2018 10:12:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPUAv-0003Vs-JI for qemu-devel@nongnu.org; Wed, 21 Nov 2018 10:12:25 -0500 Received: from smtp03.citrix.com ([162.221.156.55]:55928) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPUAv-0003ST-8A; Wed, 21 Nov 2018 10:12:21 -0500 X-IronPort-AV: E=Sophos;i="5.56,261,1539648000"; d="scan'208";a="71205797" From: Paul Durrant To: , , Date: Wed, 21 Nov 2018 15:11:54 +0000 Message-ID: <20181121151211.15997-2-paul.durrant@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181121151211.15997-1-paul.durrant@citrix.com> References: <20181121151211.15997-1-paul.durrant@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 162.221.156.55 Subject: [Qemu-devel] [PATCH 01/18] xen: re-name XenDevice to XenLegacyDevice... X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Stefano Stabellini , Eduardo Habkost , "Michael S. Tsirkin" , Jason Wang , Greg Kurz , Max Reitz , Paul Durrant , Gerd Hoffmann , Paolo Bonzini , Anthony Perard , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" ...and xen_backend.h to xen-legacy-backend.h Rather than attempting to convert the existing backend infrastructure to be QOM compliant (which would be hard to do in an incremental fashion), subsequent patches will introduce a completely new framework for Xen PV backends. Hence it is necessary to re-name parts of existing code to avoid name clashes. The re-named 'legacy' infrastructure will be removed once all backends have been ported to the new framework. This patch is purely cosmetic. No functional change. Signed-off-by: Paul Durrant Acked-by: Anthony PERARD --- Cc: Stefano Stabellini Cc: Anthony Perard Cc: Greg Kurz Cc: Kevin Wolf Cc: Max Reitz Cc: "Marc-Andr=C3=A9 Lureau" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Cc: Jason Wang Cc: Gerd Hoffmann --- hw/9pfs/xen-9p-backend.c | 16 ++--- hw/block/xen_disk.c | 24 +++---- hw/char/xen_console.c | 12 ++-- hw/display/xenfb.c | 25 ++++---- hw/i386/xen/xen-hvm.c | 2 +- hw/i386/xen/xen-mapcache.c | 2 +- hw/i386/xen/xen_platform.c | 2 +- hw/net/xen_nic.c | 14 ++--- hw/usb/xen-usb.c | 25 ++++---- hw/xen/Makefile.objs | 2 +- hw/xen/xen-common.c | 2 +- hw/xen/{xen_backend.c =3D> xen-legacy-backend.c} | 73 ++++++++++++----= ------ hw/xen/xen_devconfig.c | 2 +- hw/xen/xen_pt.c | 2 +- hw/xen/xen_pt_config_init.c | 2 +- hw/xen/xen_pt_graphics.c | 2 +- hw/xen/xen_pt_msi.c | 2 +- hw/xen/xen_pvdev.c | 20 +++--- hw/xenpv/xen_domainbuild.c | 2 +- hw/xenpv/xen_machine_pv.c | 2 +- .../hw/xen/{xen_backend.h =3D> xen-legacy-backend.h} | 43 +++++++------ include/hw/xen/xen_pvdev.h | 38 +++++------ 22 files changed, 166 insertions(+), 148 deletions(-) rename hw/xen/{xen_backend.c =3D> xen-legacy-backend.c} (89%) rename include/hw/xen/{xen_backend.h =3D> xen-legacy-backend.h} (61%) diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index 3f54a21c76..3859a06fe7 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -12,7 +12,7 @@ =20 #include "hw/hw.h" #include "hw/9pfs/9p.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "hw/9pfs/xen-9pfs.h" #include "qapi/error.h" #include "qemu/config-file.h" @@ -45,7 +45,7 @@ typedef struct Xen9pfsRing { } Xen9pfsRing; =20 typedef struct Xen9pfsDev { - struct XenDevice xendev; /* must be first */ + struct XenLegacyDevice xendev; /* must be first */ V9fsState state; char *path; char *security_model; @@ -56,7 +56,7 @@ typedef struct Xen9pfsDev { Xen9pfsRing *rings; } Xen9pfsDev; =20 -static void xen_9pfs_disconnect(struct XenDevice *xendev); +static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev); =20 static void xen_9pfs_in_sg(Xen9pfsRing *ring, struct iovec *in_sg, @@ -243,7 +243,7 @@ static const V9fsTransport xen_9p_transport =3D { .push_and_notify =3D xen_9pfs_push_and_notify, }; =20 -static int xen_9pfs_init(struct XenDevice *xendev) +static int xen_9pfs_init(struct XenLegacyDevice *xendev) { return 0; } @@ -305,7 +305,7 @@ static void xen_9pfs_evtchn_event(void *opaque) qemu_bh_schedule(ring->bh); } =20 -static void xen_9pfs_disconnect(struct XenDevice *xendev) +static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev) { Xen9pfsDev *xen_9pdev =3D container_of(xendev, Xen9pfsDev, xendev); int i; @@ -321,7 +321,7 @@ static void xen_9pfs_disconnect(struct XenDevice *xende= v) } } =20 -static int xen_9pfs_free(struct XenDevice *xendev) +static int xen_9pfs_free(struct XenLegacyDevice *xendev) { Xen9pfsDev *xen_9pdev =3D container_of(xendev, Xen9pfsDev, xendev); int i; @@ -354,7 +354,7 @@ static int xen_9pfs_free(struct XenDevice *xendev) return 0; } =20 -static int xen_9pfs_connect(struct XenDevice *xendev) +static int xen_9pfs_connect(struct XenLegacyDevice *xendev) { Error *err =3D NULL; int i; @@ -467,7 +467,7 @@ out: return -1; } =20 -static void xen_9pfs_alloc(struct XenDevice *xendev) +static void xen_9pfs_alloc(struct XenLegacyDevice *xendev) { xenstore_write_be_str(xendev, "versions", VERSIONS); xenstore_write_be_int(xendev, "max-rings", MAX_RINGS); diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 36eff94f84..75fe55f2ae 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -25,7 +25,7 @@ #include =20 #include "hw/hw.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "xen_blkif.h" #include "sysemu/blockdev.h" #include "sysemu/iothread.h" @@ -63,7 +63,7 @@ struct ioreq { #define MAX_RING_PAGE_ORDER 4 =20 struct XenBlkDev { - struct XenDevice xendev; /* must be first */ + struct XenLegacyDevice xendev; /* must be first */ char *params; char *mode; char *type; @@ -179,7 +179,7 @@ static void ioreq_release(struct ioreq *ioreq, bool fin= ish) static int ioreq_parse(struct ioreq *ioreq) { struct XenBlkDev *blkdev =3D ioreq->blkdev; - struct XenDevice *xendev =3D &blkdev->xendev; + struct XenLegacyDevice *xendev =3D &blkdev->xendev; size_t len; int i; =20 @@ -243,7 +243,7 @@ err: static int ioreq_grant_copy(struct ioreq *ioreq) { struct XenBlkDev *blkdev =3D ioreq->blkdev; - struct XenDevice *xendev =3D &blkdev->xendev; + struct XenLegacyDevice *xendev =3D &blkdev->xendev; XenGrantCopySegment segs[BLKIF_MAX_SEGMENTS_PER_REQUEST]; int i, count, rc; int64_t file_blk =3D blkdev->file_blk; @@ -289,7 +289,7 @@ static void qemu_aio_complete(void *opaque, int ret) { struct ioreq *ioreq =3D opaque; struct XenBlkDev *blkdev =3D ioreq->blkdev; - struct XenDevice *xendev =3D &blkdev->xendev; + struct XenLegacyDevice *xendev =3D &blkdev->xendev; =20 aio_context_acquire(blkdev->ctx); =20 @@ -608,7 +608,7 @@ static void blk_bh(void *opaque) aio_context_release(blkdev->ctx); } =20 -static void blk_alloc(struct XenDevice *xendev) +static void blk_alloc(struct XenLegacyDevice *xendev) { struct XenBlkDev *blkdev =3D container_of(xendev, struct XenBlkDev, xe= ndev); Error *err =3D NULL; @@ -628,7 +628,7 @@ static void blk_alloc(struct XenDevice *xendev) =20 static void blk_parse_discard(struct XenBlkDev *blkdev) { - struct XenDevice *xendev =3D &blkdev->xendev; + struct XenLegacyDevice *xendev =3D &blkdev->xendev; int enable; =20 blkdev->feature_discard =3D true; @@ -642,7 +642,7 @@ static void blk_parse_discard(struct XenBlkDev *blkdev) } } =20 -static int blk_init(struct XenDevice *xendev) +static int blk_init(struct XenLegacyDevice *xendev) { struct XenBlkDev *blkdev =3D container_of(xendev, struct XenBlkDev, xe= ndev); int info =3D 0; @@ -737,7 +737,7 @@ out_error: return -1; } =20 -static int blk_connect(struct XenDevice *xendev) +static int blk_connect(struct XenLegacyDevice *xendev) { struct XenBlkDev *blkdev =3D container_of(xendev, struct XenBlkDev, xe= ndev); int index, qflags; @@ -941,7 +941,7 @@ static int blk_connect(struct XenDevice *xendev) return 0; } =20 -static void blk_disconnect(struct XenDevice *xendev) +static void blk_disconnect(struct XenLegacyDevice *xendev) { struct XenBlkDev *blkdev =3D container_of(xendev, struct XenBlkDev, xe= ndev); =20 @@ -966,7 +966,7 @@ static void blk_disconnect(struct XenDevice *xendev) } } =20 -static int blk_free(struct XenDevice *xendev) +static int blk_free(struct XenLegacyDevice *xendev) { struct XenBlkDev *blkdev =3D container_of(xendev, struct XenBlkDev, xe= ndev); struct ioreq *ioreq; @@ -992,7 +992,7 @@ static int blk_free(struct XenDevice *xendev) return 0; } =20 -static void blk_event(struct XenDevice *xendev) +static void blk_event(struct XenLegacyDevice *xendev) { struct XenBlkDev *blkdev =3D container_of(xendev, struct XenBlkDev, xe= ndev); =20 diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c index 44f7236382..460adc1ba1 100644 --- a/hw/char/xen_console.c +++ b/hw/char/xen_console.c @@ -26,7 +26,7 @@ #include "qapi/error.h" #include "hw/hw.h" #include "chardev/char-fe.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" =20 #include =20 @@ -39,7 +39,7 @@ struct buffer { }; =20 struct XenConsole { - struct XenDevice xendev; /* must be first */ + struct XenLegacyDevice xendev; /* must be first */ struct buffer buffer; char console[XEN_BUFSIZE]; int ring_ref; @@ -173,7 +173,7 @@ static void xencons_send(struct XenConsole *con) =20 /* -------------------------------------------------------------------- */ =20 -static int con_init(struct XenDevice *xendev) +static int con_init(struct XenLegacyDevice *xendev) { struct XenConsole *con =3D container_of(xendev, struct XenConsole, xen= dev); char *type, *dom, label[32]; @@ -222,7 +222,7 @@ out: return ret; } =20 -static int con_initialise(struct XenDevice *xendev) +static int con_initialise(struct XenLegacyDevice *xendev) { struct XenConsole *con =3D container_of(xendev, struct XenConsole, xen= dev); int limit; @@ -259,7 +259,7 @@ static int con_initialise(struct XenDevice *xendev) return 0; } =20 -static void con_disconnect(struct XenDevice *xendev) +static void con_disconnect(struct XenLegacyDevice *xendev) { struct XenConsole *con =3D container_of(xendev, struct XenConsole, xen= dev); =20 @@ -276,7 +276,7 @@ static void con_disconnect(struct XenDevice *xendev) } } =20 -static void con_event(struct XenDevice *xendev) +static void con_event(struct XenLegacyDevice *xendev) { struct XenConsole *con =3D container_of(xendev, struct XenConsole, xen= dev); =20 diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 0330dc6f61..6202f1150e 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -30,7 +30,7 @@ #include "hw/hw.h" #include "ui/input.h" #include "ui/console.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" =20 #include #include @@ -46,7 +46,7 @@ /* -------------------------------------------------------------------- */ =20 struct common { - struct XenDevice xendev; /* must be first */ + struct XenLegacyDevice xendev; /* must be first */ void *page; }; =20 @@ -342,14 +342,14 @@ static QemuInputHandler xenfb_rel_mouse =3D { .sync =3D xenfb_mouse_sync, }; =20 -static int input_init(struct XenDevice *xendev) +static int input_init(struct XenLegacyDevice *xendev) { xenstore_write_be_int(xendev, "feature-abs-pointer", 1); xenstore_write_be_int(xendev, "feature-raw-pointer", 1); return 0; } =20 -static int input_initialise(struct XenDevice *xendev) +static int input_initialise(struct XenLegacyDevice *xendev) { struct XenInput *in =3D container_of(xendev, struct XenInput, c.xendev= ); int rc; @@ -361,7 +361,7 @@ static int input_initialise(struct XenDevice *xendev) return 0; } =20 -static void input_connected(struct XenDevice *xendev) +static void input_connected(struct XenLegacyDevice *xendev) { struct XenInput *in =3D container_of(xendev, struct XenInput, c.xendev= ); =20 @@ -395,7 +395,7 @@ static void input_connected(struct XenDevice *xendev) } } =20 -static void input_disconnect(struct XenDevice *xendev) +static void input_disconnect(struct XenLegacyDevice *xendev) { struct XenInput *in =3D container_of(xendev, struct XenInput, c.xendev= ); =20 @@ -410,7 +410,7 @@ static void input_disconnect(struct XenDevice *xendev) common_unbind(&in->c); } =20 -static void input_event(struct XenDevice *xendev) +static void input_event(struct XenLegacyDevice *xendev) { struct XenInput *xenfb =3D container_of(xendev, struct XenInput, c.xen= dev); struct xenkbd_page *page =3D xenfb->c.page; @@ -867,7 +867,7 @@ static void xenfb_handle_events(struct XenFB *xenfb) page->out_cons =3D cons; } =20 -static int fb_init(struct XenDevice *xendev) +static int fb_init(struct XenLegacyDevice *xendev) { #ifdef XENFB_TYPE_RESIZE xenstore_write_be_int(xendev, "feature-resize", 1); @@ -875,7 +875,7 @@ static int fb_init(struct XenDevice *xendev) return 0; } =20 -static int fb_initialise(struct XenDevice *xendev) +static int fb_initialise(struct XenLegacyDevice *xendev) { struct XenFB *fb =3D container_of(xendev, struct XenFB, c.xendev); struct xenfb_page *fb_page; @@ -912,7 +912,7 @@ static int fb_initialise(struct XenDevice *xendev) return 0; } =20 -static void fb_disconnect(struct XenDevice *xendev) +static void fb_disconnect(struct XenLegacyDevice *xendev) { struct XenFB *fb =3D container_of(xendev, struct XenFB, c.xendev); =20 @@ -935,7 +935,8 @@ static void fb_disconnect(struct XenDevice *xendev) fb->bug_trigger =3D 0; } =20 -static void fb_frontend_changed(struct XenDevice *xendev, const char *node) +static void fb_frontend_changed(struct XenLegacyDevice *xendev, + const char *node) { struct XenFB *fb =3D container_of(xendev, struct XenFB, c.xendev); =20 @@ -953,7 +954,7 @@ static void fb_frontend_changed(struct XenDevice *xende= v, const char *node) } } =20 -static void fb_event(struct XenDevice *xendev) +static void fb_event(struct XenLegacyDevice *xendev) { struct XenFB *xenfb =3D container_of(xendev, struct XenFB, c.xendev); =20 diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 935a3676c8..1d637639c7 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -16,7 +16,7 @@ #include "hw/i386/pc.h" #include "hw/i386/apic-msidef.h" #include "hw/xen/xen_common.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "qapi/error.h" #include "qapi/qapi-commands-misc.h" #include "qemu/error-report.h" diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c index 4e4f069a24..9134a7bfef 100644 --- a/hw/i386/xen/xen-mapcache.c +++ b/hw/i386/xen/xen-mapcache.c @@ -14,7 +14,7 @@ =20 #include =20 -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "qemu/bitmap.h" =20 #include diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index deb7a0c374..16afb54fee 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -30,7 +30,7 @@ #include "hw/pci/pci.h" #include "hw/irq.h" #include "hw/xen/xen_common.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "trace.h" #include "exec/address-spaces.h" #include "sysemu/block-backend.h" diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 46a8dbfc90..37cda8e4be 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -28,14 +28,14 @@ #include "net/net.h" #include "net/checksum.h" #include "net/util.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" =20 #include =20 /* ------------------------------------------------------------- */ =20 struct XenNetDev { - struct XenDevice xendev; /* must be first */ + struct XenLegacyDevice xendev; /* must be first */ char *mac; int tx_work; int tx_ring_ref; @@ -276,7 +276,7 @@ static NetClientInfo net_xen_info =3D { .receive =3D net_rx_packet, }; =20 -static int net_init(struct XenDevice *xendev) +static int net_init(struct XenLegacyDevice *xendev) { struct XenNetDev *netdev =3D container_of(xendev, struct XenNetDev, xe= ndev); =20 @@ -308,7 +308,7 @@ static int net_init(struct XenDevice *xendev) return 0; } =20 -static int net_connect(struct XenDevice *xendev) +static int net_connect(struct XenLegacyDevice *xendev) { struct XenNetDev *netdev =3D container_of(xendev, struct XenNetDev, xe= ndev); int rx_copy; @@ -363,7 +363,7 @@ static int net_connect(struct XenDevice *xendev) return 0; } =20 -static void net_disconnect(struct XenDevice *xendev) +static void net_disconnect(struct XenLegacyDevice *xendev) { struct XenNetDev *netdev =3D container_of(xendev, struct XenNetDev, xe= ndev); =20 @@ -379,14 +379,14 @@ static void net_disconnect(struct XenDevice *xendev) } } =20 -static void net_event(struct XenDevice *xendev) +static void net_event(struct XenLegacyDevice *xendev) { struct XenNetDev *netdev =3D container_of(xendev, struct XenNetDev, xe= ndev); net_tx_packets(netdev); qemu_flush_queued_packets(qemu_get_queue(netdev->nic)); } =20 -static int net_free(struct XenDevice *xendev) +static int net_free(struct XenLegacyDevice *xendev) { struct XenNetDev *netdev =3D container_of(xendev, struct XenNetDev, xe= ndev); =20 diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index 5b2e21ed18..9b2da6e75d 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -27,7 +27,7 @@ #include "qemu/option.h" #include "hw/sysbus.h" #include "hw/usb.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "monitor/qdev.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" @@ -99,7 +99,7 @@ struct usbback_hotplug { }; =20 struct usbback_info { - struct XenDevice xendev; /* must be first */ + struct XenLegacyDevice xendev; /* must be first */ USBBus bus; void *urb_sring; void *conn_sring; @@ -142,7 +142,7 @@ static int usbback_gnttab_map(struct usbback_req *usbba= ck_req) unsigned int nr_segs, i, prot; uint32_t ref[USBIF_MAX_SEGMENTS_PER_REQUEST]; struct usbback_info *usbif =3D usbback_req->usbif; - struct XenDevice *xendev =3D &usbif->xendev; + struct XenLegacyDevice *xendev =3D &usbif->xendev; struct usbif_request_segment *seg; void *addr; =20 @@ -220,7 +220,7 @@ static int usbback_gnttab_map(struct usbback_req *usbba= ck_req) =20 static int usbback_init_packet(struct usbback_req *usbback_req) { - struct XenDevice *xendev =3D &usbback_req->usbif->xendev; + struct XenLegacyDevice *xendev =3D &usbback_req->usbif->xendev; USBPacket *packet =3D &usbback_req->packet; USBDevice *dev =3D usbback_req->stub->dev; USBEndpoint *ep; @@ -279,7 +279,7 @@ static void usbback_do_response(struct usbback_req *usb= back_req, int32_t status, { struct usbback_info *usbif; struct usbif_urb_response *res; - struct XenDevice *xendev; + struct XenLegacyDevice *xendev; unsigned int notify; =20 usbif =3D usbback_req->usbif; @@ -824,7 +824,7 @@ static void usbback_process_port(struct usbback_info *u= sbif, unsigned port) g_free(busid); } =20 -static void usbback_disconnect(struct XenDevice *xendev) +static void usbback_disconnect(struct XenLegacyDevice *xendev) { struct usbback_info *usbif; unsigned int i; @@ -853,7 +853,7 @@ static void usbback_disconnect(struct XenDevice *xendev) TR_BUS(xendev, "finished\n"); } =20 -static int usbback_connect(struct XenDevice *xendev) +static int usbback_connect(struct XenLegacyDevice *xendev) { struct usbback_info *usbif; struct usbif_urb_sring *urb_sring; @@ -909,7 +909,8 @@ static int usbback_connect(struct XenDevice *xendev) return 0; } =20 -static void usbback_backend_changed(struct XenDevice *xendev, const char *= node) +static void usbback_backend_changed(struct XenLegacyDevice *xendev, + const char *node) { struct usbback_info *usbif; unsigned int i; @@ -922,7 +923,7 @@ static void usbback_backend_changed(struct XenDevice *x= endev, const char *node) } } =20 -static int usbback_init(struct XenDevice *xendev) +static int usbback_init(struct XenLegacyDevice *xendev) { struct usbback_info *usbif; =20 @@ -1001,7 +1002,7 @@ static USBPortOps xen_usb_port_ops =3D { static USBBusOps xen_usb_bus_ops =3D { }; =20 -static void usbback_alloc(struct XenDevice *xendev) +static void usbback_alloc(struct XenLegacyDevice *xendev) { struct usbback_info *usbif; USBPort *p; @@ -1027,7 +1028,7 @@ static void usbback_alloc(struct XenDevice *xendev) xen_be_set_max_grant_refs(xendev, max_grants); } =20 -static int usbback_free(struct XenDevice *xendev) +static int usbback_free(struct XenLegacyDevice *xendev) { struct usbback_info *usbif; struct usbback_req *usbback_req; @@ -1066,7 +1067,7 @@ static int usbback_free(struct XenDevice *xendev) return 0; } =20 -static void usbback_event(struct XenDevice *xendev) +static void usbback_event(struct XenLegacyDevice *xendev) { struct usbback_info *usbif; =20 diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs index 9ea5c73423..3f64a44051 100644 --- a/hw/xen/Makefile.objs +++ b/hw/xen/Makefile.objs @@ -1,5 +1,5 @@ # xen backend driver support -common-obj-$(CONFIG_XEN) +=3D xen_backend.o xen_devconfig.o xen_pvdev.o xe= n-common.o +common-obj-$(CONFIG_XEN) +=3D xen-legacy-backend.o xen_devconfig.o xen_pvd= ev.o xen-common.o =20 obj-$(CONFIG_XEN_PCI_PASSTHROUGH) +=3D xen-host-pci-device.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) +=3D xen_pt.o xen_pt_config_init.o xen_p= t_graphics.o xen_pt_msi.o diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index 6ec14c73ca..ef130b2850 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -10,7 +10,7 @@ =20 #include "qemu/osdep.h" #include "qemu/error-report.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "chardev/char.h" #include "sysemu/accel.h" #include "migration/misc.h" diff --git a/hw/xen/xen_backend.c b/hw/xen/xen-legacy-backend.c similarity index 89% rename from hw/xen/xen_backend.c rename to hw/xen/xen-legacy-backend.c index 9a8e8771ec..2d748665a6 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -30,7 +30,7 @@ #include "hw/boards.h" #include "qemu/log.h" #include "qapi/error.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "hw/xen/xen_pvdev.h" #include "monitor/qdev.h" =20 @@ -49,42 +49,47 @@ const char *xen_protocol; static bool xen_feature_grant_copy; static int debug; =20 -int xenstore_write_be_str(struct XenDevice *xendev, const char *node, cons= t char *val) +int xenstore_write_be_str(struct XenLegacyDevice *xendev, const char *node, + const char *val) { return xenstore_write_str(xendev->be, node, val); } =20 -int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int = ival) +int xenstore_write_be_int(struct XenLegacyDevice *xendev, const char *node, + int ival) { return xenstore_write_int(xendev->be, node, ival); } =20 -int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, in= t64_t ival) +int xenstore_write_be_int64(struct XenLegacyDevice *xendev, const char *no= de, + int64_t ival) { return xenstore_write_int64(xendev->be, node, ival); } =20 -char *xenstore_read_be_str(struct XenDevice *xendev, const char *node) +char *xenstore_read_be_str(struct XenLegacyDevice *xendev, const char *nod= e) { return xenstore_read_str(xendev->be, node); } =20 -int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *= ival) +int xenstore_read_be_int(struct XenLegacyDevice *xendev, const char *node, + int *ival) { return xenstore_read_int(xendev->be, node, ival); } =20 -char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node) +char *xenstore_read_fe_str(struct XenLegacyDevice *xendev, const char *nod= e) { return xenstore_read_str(xendev->fe, node); } =20 -int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *= ival) +int xenstore_read_fe_int(struct XenLegacyDevice *xendev, const char *node, + int *ival) { return xenstore_read_int(xendev->fe, node, ival); } =20 -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, +int xenstore_read_fe_uint64(struct XenLegacyDevice *xendev, const char *no= de, uint64_t *uval) { return xenstore_read_uint64(xendev->fe, node, uval); @@ -92,7 +97,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, con= st char *node, =20 /* ------------------------------------------------------------- */ =20 -int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state) +int xen_be_set_state(struct XenLegacyDevice *xendev, enum xenbus_state sta= te) { int rc; =20 @@ -106,7 +111,7 @@ int xen_be_set_state(struct XenDevice *xendev, enum xen= bus_state state) return 0; } =20 -void xen_be_set_max_grant_refs(struct XenDevice *xendev, +void xen_be_set_max_grant_refs(struct XenLegacyDevice *xendev, unsigned int nr_refs) { assert(xendev->ops->flags & DEVOPS_FLAG_NEED_GNTDEV); @@ -117,7 +122,7 @@ void xen_be_set_max_grant_refs(struct XenDevice *xendev, } } =20 -void *xen_be_map_grant_refs(struct XenDevice *xendev, uint32_t *refs, +void *xen_be_map_grant_refs(struct XenLegacyDevice *xendev, uint32_t *refs, unsigned int nr_refs, int prot) { void *ptr; @@ -135,7 +140,7 @@ void *xen_be_map_grant_refs(struct XenDevice *xendev, u= int32_t *refs, return ptr; } =20 -void xen_be_unmap_grant_refs(struct XenDevice *xendev, void *ptr, +void xen_be_unmap_grant_refs(struct XenLegacyDevice *xendev, void *ptr, unsigned int nr_refs) { assert(xendev->ops->flags & DEVOPS_FLAG_NEED_GNTDEV); @@ -146,7 +151,7 @@ void xen_be_unmap_grant_refs(struct XenDevice *xendev, = void *ptr, } } =20 -static int compat_copy_grant_refs(struct XenDevice *xendev, +static int compat_copy_grant_refs(struct XenLegacyDevice *xendev, bool to_domain, XenGrantCopySegment segs[], unsigned int nr_segs) @@ -195,7 +200,7 @@ static int compat_copy_grant_refs(struct XenDevice *xen= dev, return 0; } =20 -int xen_be_copy_grant_refs(struct XenDevice *xendev, +int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev, bool to_domain, XenGrantCopySegment segs[], unsigned int nr_segs) @@ -259,10 +264,11 @@ int xen_be_copy_grant_refs(struct XenDevice *xendev, /* * get xen backend device, allocate a new one if it doesn't exist. */ -static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int = dev, - struct XenDevOps *ops) +static struct XenLegacyDevice *xen_be_get_xendev(const char *type, int dom, + int dev, + struct XenDevOps *ops) { - struct XenDevice *xendev; + struct XenLegacyDevice *xendev; =20 xendev =3D xen_pv_find_xendev(type, dom, dev); if (xendev) { @@ -314,7 +320,8 @@ static struct XenDevice *xen_be_get_xendev(const char *= type, int dom, int dev, * Node specifies the changed field. node =3D NULL means * update all fields (used for initialization). */ -static void xen_be_backend_changed(struct XenDevice *xendev, const char *n= ode) +static void xen_be_backend_changed(struct XenLegacyDevice *xendev, + const char *node) { if (node =3D=3D NULL || strcmp(node, "online") =3D=3D 0) { if (xenstore_read_be_int(xendev, "online", &xendev->online) =3D=3D= -1) { @@ -330,7 +337,8 @@ static void xen_be_backend_changed(struct XenDevice *xe= ndev, const char *node) } } =20 -static void xen_be_frontend_changed(struct XenDevice *xendev, const char *= node) +static void xen_be_frontend_changed(struct XenLegacyDevice *xendev, + const char *node) { int fe_state; =20 @@ -373,7 +381,7 @@ static void xen_be_frontend_changed(struct XenDevice *x= endev, const char *node) * only affects the xendev->be_state variable as xenbus should * already be put into that state by xend. */ -static int xen_be_try_setup(struct XenDevice *xendev) +static int xen_be_try_setup(struct XenLegacyDevice *xendev) { char token[XEN_BUFSIZE]; int be_state; @@ -417,7 +425,7 @@ static int xen_be_try_setup(struct XenDevice *xendev) * * Goes to InitWait on success. */ -static int xen_be_try_init(struct XenDevice *xendev) +static int xen_be_try_init(struct XenLegacyDevice *xendev) { int rc =3D 0; =20 @@ -446,7 +454,7 @@ static int xen_be_try_init(struct XenDevice *xendev) * * Goes to Connected on success. */ -static int xen_be_try_initialise(struct XenDevice *xendev) +static int xen_be_try_initialise(struct XenLegacyDevice *xendev) { int rc =3D 0; =20 @@ -487,7 +495,7 @@ static int xen_be_try_initialise(struct XenDevice *xend= ev) * frontend being Connected. Note that this may be called more * than once since the backend state is not modified. */ -static void xen_be_try_connected(struct XenDevice *xendev) +static void xen_be_try_connected(struct XenLegacyDevice *xendev) { if (!xendev->ops->connected) { return; @@ -510,7 +518,8 @@ static void xen_be_try_connected(struct XenDevice *xend= ev) * * Goes to Closed when done. */ -static void xen_be_disconnect(struct XenDevice *xendev, enum xenbus_state = state) +static void xen_be_disconnect(struct XenLegacyDevice *xendev, + enum xenbus_state state) { if (xendev->be_state !=3D XenbusStateClosing && xendev->be_state !=3D XenbusStateClosed && @@ -529,7 +538,7 @@ static void xen_be_disconnect(struct XenDevice *xendev,= enum xenbus_state state) /* * Try to reset xendev, for reconnection by another frontend instance. */ -static int xen_be_try_reset(struct XenDevice *xendev) +static int xen_be_try_reset(struct XenLegacyDevice *xendev) { if (xendev->fe_state !=3D XenbusStateInitialising) { return -1; @@ -543,7 +552,7 @@ static int xen_be_try_reset(struct XenDevice *xendev) /* * state change dispatcher function */ -void xen_be_check_state(struct XenDevice *xendev) +void xen_be_check_state(struct XenLegacyDevice *xendev) { int rc =3D 0; =20 @@ -587,7 +596,7 @@ void xen_be_check_state(struct XenDevice *xendev) =20 static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops) { - struct XenDevice *xendev; + struct XenLegacyDevice *xendev; char path[XEN_BUFSIZE], token[XEN_BUFSIZE]; char **dev =3D NULL; unsigned int cdev, j; @@ -620,7 +629,7 @@ static int xenstore_scan(const char *type, int dom, str= uct XenDevOps *ops) void xenstore_update_be(char *watch, char *type, int dom, struct XenDevOps *ops) { - struct XenDevice *xendev; + struct XenLegacyDevice *xendev; char path[XEN_BUFSIZE], *bepath; unsigned int len, dev; =20 @@ -651,7 +660,7 @@ void xenstore_update_be(char *watch, char *type, int do= m, } } =20 -void xenstore_update_fe(char *watch, struct XenDevice *xendev) +void xenstore_update_fe(char *watch, struct XenLegacyDevice *xendev) { char *node; unsigned int len; @@ -753,7 +762,7 @@ void xen_be_register_common(void) #endif } =20 -int xen_be_bind_evtchn(struct XenDevice *xendev) +int xen_be_bind_evtchn(struct XenLegacyDevice *xendev) { if (xendev->local_port !=3D -1) { return 0; @@ -789,7 +798,7 @@ static const TypeInfo xendev_type_info =3D { .name =3D TYPE_XENBACKEND, .parent =3D TYPE_XENSYSDEV, .class_init =3D xendev_class_init, - .instance_size =3D sizeof(struct XenDevice), + .instance_size =3D sizeof(struct XenLegacyDevice), }; =20 static void xen_sysbus_class_init(ObjectClass *klass, void *data) diff --git a/hw/xen/xen_devconfig.c b/hw/xen/xen_devconfig.c index aebc19bd71..1b30bd7691 100644 --- a/hw/xen/xen_devconfig.c +++ b/hw/xen/xen_devconfig.c @@ -1,5 +1,5 @@ #include "qemu/osdep.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "qemu/option.h" #include "sysemu/blockdev.h" =20 diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index f1f3a3727c..b20bf3a453 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -59,7 +59,7 @@ #include "hw/pci/pci.h" #include "hw/xen/xen.h" #include "hw/i386/pc.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "xen_pt.h" #include "qemu/range.h" #include "exec/address-spaces.h" diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index 47f9010c75..81112049b6 100644 --- a/hw/xen/xen_pt_config_init.c +++ b/hw/xen/xen_pt_config_init.c @@ -15,7 +15,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/timer.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "xen_pt.h" =20 #define XEN_PT_MERGE_VALUE(value, data, val_mask) \ diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c index 135c8df1e7..130cc6cbf0 100644 --- a/hw/xen/xen_pt_graphics.c +++ b/hw/xen/xen_pt_graphics.c @@ -5,7 +5,7 @@ #include "qapi/error.h" #include "xen_pt.h" #include "xen-host-pci-device.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" =20 static unsigned long igd_guest_opregion; static unsigned long igd_host_opregion; diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c index cc514f9157..fb4b887b92 100644 --- a/hw/xen/xen_pt_msi.c +++ b/hw/xen/xen_pt_msi.c @@ -11,7 +11,7 @@ =20 #include "qemu/osdep.h" =20 -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "xen_pt.h" #include "hw/i386/apic-msidef.h" =20 diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index aed783e844..61de091002 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "hw/qdev-core.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "hw/xen/xen_pvdev.h" =20 /* private */ @@ -34,7 +34,7 @@ struct xs_dirs { static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =3D QTAILQ_HEAD_INITIALIZER(xs_cleanup); =20 -static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =3D +static QTAILQ_HEAD(XenLegacyDeviceHead, XenLegacyDevice) xendevs =3D QTAILQ_HEAD_INITIALIZER(xendevs); =20 /* ------------------------------------------------------------- */ @@ -195,7 +195,7 @@ const char *xenbus_strstate(enum xenbus_state state) * 2 =3D=3D noisy debug messages (logfile only). * 3 =3D=3D will flood your log (logfile only). */ -void xen_pv_printf(struct XenDevice *xendev, int msg_level, +void xen_pv_printf(struct XenLegacyDevice *xendev, int msg_level, const char *fmt, ...) { va_list args; @@ -230,7 +230,7 @@ void xen_pv_printf(struct XenDevice *xendev, int msg_le= vel, =20 void xen_pv_evtchn_event(void *opaque) { - struct XenDevice *xendev =3D opaque; + struct XenLegacyDevice *xendev =3D opaque; evtchn_port_t port; =20 port =3D xenevtchn_pending(xendev->evtchndev); @@ -247,7 +247,7 @@ void xen_pv_evtchn_event(void *opaque) } } =20 -void xen_pv_unbind_evtchn(struct XenDevice *xendev) +void xen_pv_unbind_evtchn(struct XenLegacyDevice *xendev) { if (xendev->local_port =3D=3D -1) { return; @@ -258,16 +258,16 @@ void xen_pv_unbind_evtchn(struct XenDevice *xendev) xendev->local_port =3D -1; } =20 -int xen_pv_send_notify(struct XenDevice *xendev) +int xen_pv_send_notify(struct XenLegacyDevice *xendev) { return xenevtchn_notify(xendev->evtchndev, xendev->local_port); } =20 /* ------------------------------------------------------------- */ =20 -struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev) +struct XenLegacyDevice *xen_pv_find_xendev(const char *type, int dom, int = dev) { - struct XenDevice *xendev; + struct XenLegacyDevice *xendev; =20 QTAILQ_FOREACH(xendev, &xendevs, next) { if (xendev->dom !=3D dom) { @@ -287,7 +287,7 @@ struct XenDevice *xen_pv_find_xendev(const char *type, = int dom, int dev) /* * release xen backend device. */ -void xen_pv_del_xendev(struct XenDevice *xendev) +void xen_pv_del_xendev(struct XenLegacyDevice *xendev) { if (xendev->ops->free) { xendev->ops->free(xendev); @@ -312,7 +312,7 @@ void xen_pv_del_xendev(struct XenDevice *xendev) qdev_unplug(&xendev->qdev, NULL); } =20 -void xen_pv_insert_xendev(struct XenDevice *xendev) +void xen_pv_insert_xendev(struct XenLegacyDevice *xendev) { QTAILQ_INSERT_TAIL(&xendevs, xendev, next); } diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index 188acaca16..deb28cf596 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" #include "qemu/units.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "xen_domainbuild.h" #include "qemu/timer.h" #include "qemu/log.h" diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 44d67b87c4..8c86fb7031 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -26,7 +26,7 @@ #include "qemu/error-report.h" #include "hw/hw.h" #include "hw/boards.h" -#include "hw/xen/xen_backend.h" +#include "hw/xen/xen-legacy-backend.h" #include "xen_domainbuild.h" #include "sysemu/block-backend.h" =20 diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen-legacy-backe= nd.h similarity index 61% rename from include/hw/xen/xen_backend.h rename to include/hw/xen/xen-legacy-backend.h index 9c17fdd85d..20cb47b5bf 100644 --- a/include/hw/xen/xen_backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -11,7 +11,7 @@ #define TYPE_XENBACKEND "xen-backend" =20 #define XENBACKEND_DEVICE(obj) \ - OBJECT_CHECK(XenDevice, (obj), TYPE_XENBACKEND) + OBJECT_CHECK(XenLegacyDevice, (obj), TYPE_XENBACKEND) =20 /* variables */ extern struct xs_handle *xenstore; @@ -20,32 +20,37 @@ extern DeviceState *xen_sysdev; extern BusState *xen_sysbus; =20 int xenstore_mkdir(char *path, int p); -int xenstore_write_be_str(struct XenDevice *xendev, const char *node, cons= t char *val); -int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int = ival); -int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, in= t64_t ival); -char *xenstore_read_be_str(struct XenDevice *xendev, const char *node); -int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *= ival); -void xenstore_update_fe(char *watch, struct XenDevice *xendev); +int xenstore_write_be_str(struct XenLegacyDevice *xendev, const char *node, + const char *val); +int xenstore_write_be_int(struct XenLegacyDevice *xendev, const char *node, + int ival); +int xenstore_write_be_int64(struct XenLegacyDevice *xendev, const char *no= de, + int64_t ival); +char *xenstore_read_be_str(struct XenLegacyDevice *xendev, const char *nod= e); +int xenstore_read_be_int(struct XenLegacyDevice *xendev, const char *node, + int *ival); +void xenstore_update_fe(char *watch, struct XenLegacyDevice *xendev); void xenstore_update_be(char *watch, char *type, int dom, struct XenDevOps *ops); -char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node); -int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *= ival); -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, +char *xenstore_read_fe_str(struct XenLegacyDevice *xendev, const char *nod= e); +int xenstore_read_fe_int(struct XenLegacyDevice *xendev, const char *node, + int *ival); +int xenstore_read_fe_uint64(struct XenLegacyDevice *xendev, const char *no= de, uint64_t *uval); =20 -void xen_be_check_state(struct XenDevice *xendev); +void xen_be_check_state(struct XenLegacyDevice *xendev); =20 /* xen backend driver bits */ int xen_be_init(void); void xen_be_register_common(void); int xen_be_register(const char *type, struct XenDevOps *ops); -int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state); -int xen_be_bind_evtchn(struct XenDevice *xendev); -void xen_be_set_max_grant_refs(struct XenDevice *xendev, +int xen_be_set_state(struct XenLegacyDevice *xendev, enum xenbus_state sta= te); +int xen_be_bind_evtchn(struct XenLegacyDevice *xendev); +void xen_be_set_max_grant_refs(struct XenLegacyDevice *xendev, unsigned int nr_refs); -void *xen_be_map_grant_refs(struct XenDevice *xendev, uint32_t *refs, +void *xen_be_map_grant_refs(struct XenLegacyDevice *xendev, uint32_t *refs, unsigned int nr_refs, int prot); -void xen_be_unmap_grant_refs(struct XenDevice *xendev, void *ptr, +void xen_be_unmap_grant_refs(struct XenLegacyDevice *xendev, void *ptr, unsigned int nr_refs); =20 typedef struct XenGrantCopySegment { @@ -59,17 +64,17 @@ typedef struct XenGrantCopySegment { size_t len; } XenGrantCopySegment; =20 -int xen_be_copy_grant_refs(struct XenDevice *xendev, +int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev, bool to_domain, XenGrantCopySegment segs[], unsigned int nr_segs); =20 -static inline void *xen_be_map_grant_ref(struct XenDevice *xendev, +static inline void *xen_be_map_grant_ref(struct XenLegacyDevice *xendev, uint32_t ref, int prot) { return xen_be_map_grant_refs(xendev, &ref, 1, prot); } =20 -static inline void xen_be_unmap_grant_ref(struct XenDevice *xendev, +static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev, void *ptr) { return xen_be_unmap_grant_refs(xendev, ptr, 1); diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index d473e9b34d..83e5174d90 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -6,7 +6,7 @@ =20 #define XEN_BUFSIZE 1024 =20 -struct XenDevice; +struct XenLegacyDevice; =20 /* driver uses grant tables -> open gntdev device (xendev->gnttabdev) */ #define DEVOPS_FLAG_NEED_GNTDEV 1 @@ -16,19 +16,21 @@ struct XenDevice; struct XenDevOps { size_t size; uint32_t flags; - void (*alloc)(struct XenDevice *xendev); - int (*init)(struct XenDevice *xendev); - int (*initialise)(struct XenDevice *xendev); - void (*connected)(struct XenDevice *xendev); - void (*event)(struct XenDevice *xendev); - void (*disconnect)(struct XenDevice *xendev); - int (*free)(struct XenDevice *xendev); - void (*backend_changed)(struct XenDevice *xendev, const char *nod= e); - void (*frontend_changed)(struct XenDevice *xendev, const char *no= de); + void (*alloc)(struct XenLegacyDevice *xendev); + int (*init)(struct XenLegacyDevice *xendev); + int (*initialise)(struct XenLegacyDevice *xendev); + void (*connected)(struct XenLegacyDevice *xendev); + void (*event)(struct XenLegacyDevice *xendev); + void (*disconnect)(struct XenLegacyDevice *xendev); + int (*free)(struct XenLegacyDevice *xendev); + void (*backend_changed)(struct XenLegacyDevice *xendev, + const char *node); + void (*frontend_changed)(struct XenLegacyDevice *xendev, + const char *node); int (*backend_register)(void); }; =20 -struct XenDevice { +struct XenLegacyDevice { DeviceState qdev; const char *type; int dom; @@ -49,7 +51,7 @@ struct XenDevice { xengnttab_handle *gnttabdev; =20 struct XenDevOps *ops; - QTAILQ_ENTRY(XenDevice) next; + QTAILQ_ENTRY(XenLegacyDevice) next; }; =20 /* ------------------------------------------------------------- */ @@ -66,14 +68,14 @@ void xenstore_update(void *unused); const char *xenbus_strstate(enum xenbus_state state); =20 void xen_pv_evtchn_event(void *opaque); -void xen_pv_insert_xendev(struct XenDevice *xendev); -void xen_pv_del_xendev(struct XenDevice *xendev); -struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev); +void xen_pv_insert_xendev(struct XenLegacyDevice *xendev); +void xen_pv_del_xendev(struct XenLegacyDevice *xendev); +struct XenLegacyDevice *xen_pv_find_xendev(const char *type, int dom, int = dev); =20 -void xen_pv_unbind_evtchn(struct XenDevice *xendev); -int xen_pv_send_notify(struct XenDevice *xendev); +void xen_pv_unbind_evtchn(struct XenLegacyDevice *xendev); +int xen_pv_send_notify(struct XenLegacyDevice *xendev); =20 -void xen_pv_printf(struct XenDevice *xendev, int msg_level, +void xen_pv_printf(struct XenLegacyDevice *xendev, int msg_level, const char *fmt, ...) GCC_FMT_ATTR(3, 4); =20 #endif /* QEMU_HW_XEN_PVDEV_H */ --=20 2.11.0