static int vhost_user_get_vring_base(struct vhost_dev *dev,

                                     struct vhost_vring_state *ring)

{

    VhostUserMsg msg = {

        .request = VHOST_USER_GET_VRING_BASE,

        .flags = VHOST_USER_VERSION,

        .state = *ring,

        .size = sizeof(*ring),

    };



    vhost_user_write(dev, &msg, NULL, 0);



    if (vhost_user_read(dev, &msg) < 0) {

        return 0;

    }



    if (msg.request != VHOST_USER_GET_VRING_BASE) {

        error_report("Received unexpected msg type. Expected %d received %d",

                     VHOST_USER_GET_VRING_BASE, msg.request);

        return -1;

    }



    if (msg.size != sizeof(m.state)) {

        error_report("Received bad msg size.");

        return -1;

    }



    *ring = msg.state;



    return 0;

}

static int vhost_user_get_vring_base(struct vhost_dev *dev,

                                     struct vhost_vring_state *ring)

{

    VhostUserMsg msg = {

        .request = VHOST_USER_GET_VRING_BASE,

        .flags = VHOST_USER_VERSION,

        .state = *ring,

        .size = sizeof(*ring),

    };



    vhost_user_write(dev, &msg, NULL, 0);



    if (vhost_user_read(dev, &msg) < 0) {

        return 0;

    }



    if (msg.request != VHOST_USER_GET_VRING_BASE) {

        error_report("Received unexpected msg type. Expected %d received %d",

                     VHOST_USER_GET_VRING_BASE, msg.request);

        return -1;

    }



    if (msg.size != sizeof(m.state)) {

        error_report("Received bad msg size.");

        return -1;

    }



    *ring = msg.state;



    return 0;

}

    };         .state = *ring,         .state = *ring,     if (msg.size != sizeof(m.state)) {     *ring = msg.state;
static int FUNC_0(struct vhost_dev *VAR_0,

                                     struct vhost_vring_state *VAR_1)

{

    VhostUserMsg msg = {

        .request = VHOST_USER_GET_VRING_BASE,

        .flags = VHOST_USER_VERSION,

        .state = *VAR_1,

        .size = sizeof(*VAR_1),

    };



    vhost_user_write(VAR_0, &msg, NULL, 0);



    if (vhost_user_read(VAR_0, &msg) < 0) {

        return 0;

    }



    if (msg.request != VHOST_USER_GET_VRING_BASE) {

        error_report("Received unexpected msg type. Expected %d received %d",

                     VHOST_USER_GET_VRING_BASE, msg.request);

        return -1;

    }



    if (msg.size != sizeof(m.state)) {

        error_report("Received bad msg size.");

        return -1;

    }



    *VAR_1 = msg.state;



    return 0;

}

static int FUNC_0(struct vhost_dev *VAR_0,
struct vhost_vring_state *VAR_1)
{ VhostUserMsg msg = { .request = VHOST_USER_GET_VRING_BASE,
.flags = VHOST_USER_VERSION,
.state = *VAR_1,
.size = sizeof(*VAR_1),
}; vhost_user_write(VAR_0, &msg, NULL, 0); if (vhost_user_read(VAR_0, &msg) < 0) { return 0; } if (msg.request != VHOST_USER_GET_VRING_BASE) { error_report("Received unexpected msg type. Expected %d received %d",
VHOST_USER_GET_VRING_BASE, msg.request); return -1; } if (msg.size != sizeof(m.state)) { error_report("Received bad msg size."); return -1; } *VAR_1 = msg.state; return 0; }