Commit 2d0ed5e6 authored by Paul Durrant's avatar Paul Durrant Committed by Anthony PERARD
Browse files

xen: re-name XenDevice to XenLegacyDevice...



...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: default avatarPaul Durrant <paul.durrant@citrix.com>
Acked-by: default avatarAnthony Perard <anthony.perard@citrix.com>
Signed-off-by: default avatarAnthony PERARD <anthony.perard@citrix.com>
parent 92dbfcc6
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@

#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;

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;

static void xen_9pfs_disconnect(struct XenDevice *xendev);
static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev);

static void xen_9pfs_in_sg(Xen9pfsRing *ring,
                           struct iovec *in_sg,
@@ -243,7 +243,7 @@ static const V9fsTransport xen_9p_transport = {
    .push_and_notify = xen_9pfs_push_and_notify,
};

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);
}

static void xen_9pfs_disconnect(struct XenDevice *xendev)
static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev)
{
    Xen9pfsDev *xen_9pdev = container_of(xendev, Xen9pfsDev, xendev);
    int i;
@@ -321,7 +321,7 @@ static void xen_9pfs_disconnect(struct XenDevice *xendev)
    }
}

static int xen_9pfs_free(struct XenDevice *xendev)
static int xen_9pfs_free(struct XenLegacyDevice *xendev)
{
    Xen9pfsDev *xen_9pdev = container_of(xendev, Xen9pfsDev, xendev);
    int i;
@@ -354,7 +354,7 @@ static int xen_9pfs_free(struct XenDevice *xendev)
    return 0;
}

static int xen_9pfs_connect(struct XenDevice *xendev)
static int xen_9pfs_connect(struct XenLegacyDevice *xendev)
{
    Error *err = NULL;
    int i;
@@ -467,7 +467,7 @@ out:
    return -1;
}

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);
+12 −12
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#include <sys/uio.h>

#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

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 finish)
static int ioreq_parse(struct ioreq *ioreq)
{
    struct XenBlkDev *blkdev = ioreq->blkdev;
    struct XenDevice *xendev = &blkdev->xendev;
    struct XenLegacyDevice *xendev = &blkdev->xendev;
    size_t len;
    int i;

@@ -243,7 +243,7 @@ err:
static int ioreq_grant_copy(struct ioreq *ioreq)
{
    struct XenBlkDev *blkdev = ioreq->blkdev;
    struct XenDevice *xendev = &blkdev->xendev;
    struct XenLegacyDevice *xendev = &blkdev->xendev;
    XenGrantCopySegment segs[BLKIF_MAX_SEGMENTS_PER_REQUEST];
    int i, count, rc;
    int64_t file_blk = blkdev->file_blk;
@@ -289,7 +289,7 @@ static void qemu_aio_complete(void *opaque, int ret)
{
    struct ioreq *ioreq = opaque;
    struct XenBlkDev *blkdev = ioreq->blkdev;
    struct XenDevice *xendev = &blkdev->xendev;
    struct XenLegacyDevice *xendev = &blkdev->xendev;

    aio_context_acquire(blkdev->ctx);

@@ -608,7 +608,7 @@ static void blk_bh(void *opaque)
    aio_context_release(blkdev->ctx);
}

static void blk_alloc(struct XenDevice *xendev)
static void blk_alloc(struct XenLegacyDevice *xendev)
{
    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
    Error *err = NULL;
@@ -628,7 +628,7 @@ static void blk_alloc(struct XenDevice *xendev)

static void blk_parse_discard(struct XenBlkDev *blkdev)
{
    struct XenDevice *xendev = &blkdev->xendev;
    struct XenLegacyDevice *xendev = &blkdev->xendev;
    int enable;

    blkdev->feature_discard = true;
@@ -642,7 +642,7 @@ static void blk_parse_discard(struct XenBlkDev *blkdev)
    }
}

static int blk_init(struct XenDevice *xendev)
static int blk_init(struct XenLegacyDevice *xendev)
{
    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
    int info = 0;
@@ -737,7 +737,7 @@ out_error:
    return -1;
}

static int blk_connect(struct XenDevice *xendev)
static int blk_connect(struct XenLegacyDevice *xendev)
{
    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
    int index, qflags;
@@ -941,7 +941,7 @@ static int blk_connect(struct XenDevice *xendev)
    return 0;
}

static void blk_disconnect(struct XenDevice *xendev)
static void blk_disconnect(struct XenLegacyDevice *xendev)
{
    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);

@@ -966,7 +966,7 @@ static void blk_disconnect(struct XenDevice *xendev)
    }
}

static int blk_free(struct XenDevice *xendev)
static int blk_free(struct XenLegacyDevice *xendev)
{
    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
    struct ioreq *ioreq;
@@ -992,7 +992,7 @@ static int blk_free(struct XenDevice *xendev)
    return 0;
}

static void blk_event(struct XenDevice *xendev)
static void blk_event(struct XenLegacyDevice *xendev)
{
    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);

+6 −6
Original line number Diff line number Diff line
@@ -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"

#include <xen/io/console.h>

@@ -39,7 +39,7 @@ struct buffer {
};

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)

/* -------------------------------------------------------------------- */

static int con_init(struct XenDevice *xendev)
static int con_init(struct XenLegacyDevice *xendev)
{
    struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
    char *type, *dom, label[32];
@@ -222,7 +222,7 @@ out:
    return ret;
}

static int con_initialise(struct XenDevice *xendev)
static int con_initialise(struct XenLegacyDevice *xendev)
{
    struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
    int limit;
@@ -259,7 +259,7 @@ static int con_initialise(struct XenDevice *xendev)
    return 0;
}

static void con_disconnect(struct XenDevice *xendev)
static void con_disconnect(struct XenLegacyDevice *xendev)
{
    struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);

@@ -276,7 +276,7 @@ static void con_disconnect(struct XenDevice *xendev)
    }
}

static void con_event(struct XenDevice *xendev)
static void con_event(struct XenLegacyDevice *xendev)
{
    struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);

+13 −12
Original line number Diff line number Diff line
@@ -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"

#include <xen/event_channel.h>
#include <xen/io/fbif.h>
@@ -46,7 +46,7 @@
/* -------------------------------------------------------------------- */

struct common {
    struct XenDevice  xendev;  /* must be first */
    struct XenLegacyDevice  xendev;  /* must be first */
    void              *page;
};

@@ -342,14 +342,14 @@ static QemuInputHandler xenfb_rel_mouse = {
    .sync  = xenfb_mouse_sync,
};

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;
}

static int input_initialise(struct XenDevice *xendev)
static int input_initialise(struct XenLegacyDevice *xendev)
{
    struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
    int rc;
@@ -361,7 +361,7 @@ static int input_initialise(struct XenDevice *xendev)
    return 0;
}

static void input_connected(struct XenDevice *xendev)
static void input_connected(struct XenLegacyDevice *xendev)
{
    struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);

@@ -395,7 +395,7 @@ static void input_connected(struct XenDevice *xendev)
    }
}

static void input_disconnect(struct XenDevice *xendev)
static void input_disconnect(struct XenLegacyDevice *xendev)
{
    struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);

@@ -410,7 +410,7 @@ static void input_disconnect(struct XenDevice *xendev)
    common_unbind(&in->c);
}

static void input_event(struct XenDevice *xendev)
static void input_event(struct XenLegacyDevice *xendev)
{
    struct XenInput *xenfb = container_of(xendev, struct XenInput, c.xendev);
    struct xenkbd_page *page = xenfb->c.page;
@@ -867,7 +867,7 @@ static void xenfb_handle_events(struct XenFB *xenfb)
    page->out_cons = cons;
}

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;
}

static int fb_initialise(struct XenDevice *xendev)
static int fb_initialise(struct XenLegacyDevice *xendev)
{
    struct XenFB *fb = 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;
}

static void fb_disconnect(struct XenDevice *xendev)
static void fb_disconnect(struct XenLegacyDevice *xendev)
{
    struct XenFB *fb = container_of(xendev, struct XenFB, c.xendev);

@@ -935,7 +935,8 @@ static void fb_disconnect(struct XenDevice *xendev)
    fb->bug_trigger    = 0;
}

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 = container_of(xendev, struct XenFB, c.xendev);

@@ -953,7 +954,7 @@ static void fb_frontend_changed(struct XenDevice *xendev, const char *node)
    }
}

static void fb_event(struct XenDevice *xendev)
static void fb_event(struct XenLegacyDevice *xendev)
{
    struct XenFB *xenfb = container_of(xendev, struct XenFB, c.xendev);

+1 −1
Original line number Diff line number Diff line
@@ -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"
Loading