static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)

{

    VirtIOBlock *s = opaque;



    if (version_id != 2)

        return -EINVAL;



    virtio_load(&s->vdev, f);

    while (qemu_get_sbyte(f)) {

        VirtIOBlockReq *req = virtio_blk_alloc_request(s);

        qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));

        req->next = s->rq;

        s->rq = req;



        virtqueue_map_sg(req->elem.in_sg, req->elem.in_addr,

            req->elem.in_num, 1);

        virtqueue_map_sg(req->elem.out_sg, req->elem.out_addr,

            req->elem.out_num, 0);

    }



    return 0;

}

static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)

{

    VirtIOBlock *s = opaque;



    if (version_id != 2)

        return -EINVAL;



    virtio_load(&s->vdev, f);

    while (qemu_get_sbyte(f)) {

        VirtIOBlockReq *req = virtio_blk_alloc_request(s);

        qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));

        req->next = s->rq;

        s->rq = req;



        virtqueue_map_sg(req->elem.in_sg, req->elem.in_addr,

            req->elem.in_num, 1);

        virtqueue_map_sg(req->elem.out_sg, req->elem.out_addr,

            req->elem.out_num, 0);

    }



    return 0;

}

    virtio_load(&s->vdev, f);     virtio_load(&s->vdev, f);     virtio_load(&s->vdev, f);     virtio_load(&s->vdev, f);
static int FUNC_0(QEMUFile *VAR_0, void *VAR_1, int VAR_2)

{

    VirtIOBlock *s = VAR_1;



    if (VAR_2 != 2)

        return -EINVAL;



    virtio_load(&s->vdev, VAR_0);

    while (qemu_get_sbyte(VAR_0)) {

        VirtIOBlockReq *req = virtio_blk_alloc_request(s);

        qemu_get_buffer(VAR_0, (unsigned char*)&req->elem, sizeof(req->elem));

        req->next = s->rq;

        s->rq = req;



        virtqueue_map_sg(req->elem.in_sg, req->elem.in_addr,

            req->elem.in_num, 1);

        virtqueue_map_sg(req->elem.out_sg, req->elem.out_addr,

            req->elem.out_num, 0);

    }



    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, void *VAR_1, int VAR_2)
{ VirtIOBlock *s = VAR_1; if (VAR_2 != 2)
return -EINVAL; virtio_load(&s->vdev, VAR_0); while (qemu_get_sbyte(VAR_0)) { VirtIOBlockReq *req = virtio_blk_alloc_request(s); qemu_get_buffer(VAR_0, (unsigned char*)&req->elem, sizeof(req->elem)); req->next = s->rq; s->rq = req; virtqueue_map_sg(req->elem.in_sg, req->elem.in_addr,
req->elem.in_num, 1); virtqueue_map_sg(req->elem.out_sg, req->elem.out_addr,
req->elem.out_num, 0); } return 0; }