mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
Pull request
v2: * Fix C11 typedef redefinitions in ahci and libqos malloc [Peter] * Fix lx -> PRIx64 format specifiers in ahci [Peter] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJU4hCxAAoJEJykq7OBq3PIh2EH/02LojwlJwtsUoFuDDOdqVu+ iQsGbGpmtjeaBkiiiQnlN0UHFJk+I05JohagzivchB6p1v0BDnGPMGCRiY2a/URU ZrBt6kvIL6ro6n6ebrMq4+MFbyfgXC6tC8UuBnHBOlJMArHCue8w3BD+FWyYOJGY +zzvWKSNxEkjwPyXuBPJI0eqLCmANnr31LVrh+4gTvXRnpArT+fNTBooCgA6zsRe ChHObhstM/ljy7XZz5TmTXFf/68+WM8AYF+xIHiU3olCcBgH8VPn7lsdBSEuOtxH HNe9tt2M91R+3Zdr2KXu+D4BRARKMlft9GDwLGAvGrYcBr7NNJo3KbKbxoecw4M= =2rE4 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging Pull request v2: * Fix C11 typedef redefinitions in ahci and libqos malloc [Peter] * Fix lx -> PRIx64 format specifiers in ahci [Peter] # gpg: Signature made Mon Feb 16 15:45:53 2015 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/block-pull-request: (65 commits) block: Keep bdrv_check*_request()'s return value block: Remove "growable" from BDS block: Clamp BlockBackend requests qemu-io: Use BlockBackend qemu-io: Remove "growable" option qemu-io: Use blk_new_open() in openfile() qemu-nbd: Use blk_new_open() in main() qemu-img: Use BlockBackend as far as possible qemu-img: Use blk_new_open() in img_rebase() qemu-img: Use blk_new_open() in img_open() block/xen: Use blk_new_open() in blk_connect() blockdev: Use blk_new_open() in blockdev_init() iotests: Add test for driver=qcow2, format=qcow2 block: Add Error parameter to bdrv_find_protocol() block: Add blk_new_open() block: Lift some BDS functions to the BlockBackend iotests: Add test for qemu-img convert to NBD qemu-img: Fix qemu-img convert -n qemu-iotests: Add 093 for IO throttling qemu-iotests: Allow caller to disable underscore convertion for qmp ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
3dc10613c3
57 changed files with 3029 additions and 1547 deletions
75
include/hw/virtio/dataplane/vring-accessors.h
Normal file
75
include/hw/virtio/dataplane/vring-accessors.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
#ifndef VRING_ACCESSORS_H
|
||||
#define VRING_ACCESSORS_H
|
||||
|
||||
#include "hw/virtio/virtio_ring.h"
|
||||
#include "hw/virtio/virtio.h"
|
||||
#include "hw/virtio/virtio-access.h"
|
||||
|
||||
static inline uint16_t vring_get_used_idx(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.used->idx);
|
||||
}
|
||||
|
||||
static inline void vring_set_used_idx(VirtIODevice *vdev, Vring *vring,
|
||||
uint16_t idx)
|
||||
{
|
||||
vring->vr.used->idx = virtio_tswap16(vdev, idx);
|
||||
}
|
||||
|
||||
static inline uint16_t vring_get_avail_idx(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.avail->idx);
|
||||
}
|
||||
|
||||
static inline uint16_t vring_get_avail_ring(VirtIODevice *vdev, Vring *vring,
|
||||
int i)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.avail->ring[i]);
|
||||
}
|
||||
|
||||
static inline void vring_set_used_ring_id(VirtIODevice *vdev, Vring *vring,
|
||||
int i, uint32_t id)
|
||||
{
|
||||
vring->vr.used->ring[i].id = virtio_tswap32(vdev, id);
|
||||
}
|
||||
|
||||
static inline void vring_set_used_ring_len(VirtIODevice *vdev, Vring *vring,
|
||||
int i, uint32_t len)
|
||||
{
|
||||
vring->vr.used->ring[i].len = virtio_tswap32(vdev, len);
|
||||
}
|
||||
|
||||
static inline uint16_t vring_get_used_flags(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.used->flags);
|
||||
}
|
||||
|
||||
static inline uint16_t vring_get_avail_flags(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return virtio_tswap16(vdev, vring->vr.avail->flags);
|
||||
}
|
||||
|
||||
static inline void vring_set_used_flags(VirtIODevice *vdev, Vring *vring,
|
||||
uint16_t flags)
|
||||
{
|
||||
vring->vr.used->flags |= virtio_tswap16(vdev, flags);
|
||||
}
|
||||
|
||||
static inline void vring_clear_used_flags(VirtIODevice *vdev, Vring *vring,
|
||||
uint16_t flags)
|
||||
{
|
||||
vring->vr.used->flags &= virtio_tswap16(vdev, ~flags);
|
||||
}
|
||||
|
||||
static inline unsigned int vring_get_num(Vring *vring)
|
||||
{
|
||||
return vring->vr.num;
|
||||
}
|
||||
|
||||
/* Are there more descriptors available? */
|
||||
static inline bool vring_more_avail(VirtIODevice *vdev, Vring *vring)
|
||||
{
|
||||
return vring_get_avail_idx(vdev, vring) != vring->last_avail_idx;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -31,17 +31,6 @@ typedef struct {
|
|||
bool broken; /* was there a fatal error? */
|
||||
} Vring;
|
||||
|
||||
static inline unsigned int vring_get_num(Vring *vring)
|
||||
{
|
||||
return vring->vr.num;
|
||||
}
|
||||
|
||||
/* Are there more descriptors available? */
|
||||
static inline bool vring_more_avail(Vring *vring)
|
||||
{
|
||||
return vring->vr.avail->idx != vring->last_avail_idx;
|
||||
}
|
||||
|
||||
/* Fail future vring_pop() and vring_push() calls until reset */
|
||||
static inline void vring_set_broken(Vring *vring)
|
||||
{
|
||||
|
@ -54,6 +43,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring *vring);
|
|||
bool vring_enable_notification(VirtIODevice *vdev, Vring *vring);
|
||||
bool vring_should_notify(VirtIODevice *vdev, Vring *vring);
|
||||
int vring_pop(VirtIODevice *vdev, Vring *vring, VirtQueueElement *elem);
|
||||
void vring_push(Vring *vring, VirtQueueElement *elem, int len);
|
||||
void vring_push(VirtIODevice *vdev, Vring *vring, VirtQueueElement *elem,
|
||||
int len);
|
||||
|
||||
#endif /* VRING_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue