~ubuntu-branches/ubuntu/saucy/qemu/saucy-proposed

« back to all changes in this revision

Viewing changes to hw/vhost.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-05-28 08:18:30 UTC
  • mfrom: (1.8.2) (10.1.37 sid)
  • Revision ID: package-import@ubuntu.com-20130528081830-87xl2z9fq516a814
Tags: 1.5.0+dfsg-2ubuntu1
* Merge 1.5.0+dfs-2 from debian unstable.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - Dropped patches:
    * 0001-fix-wrong-output-with-info-chardev-for-tcp-socket.patch
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * gridcentric patch - updated
    * linaro arm patches from qemu-linaro rebasing branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef VHOST_H
2
 
#define VHOST_H
3
 
 
4
 
#include "hw/hw.h"
5
 
#include "hw/virtio.h"
6
 
#include "exec/memory.h"
7
 
 
8
 
/* Generic structures common for any vhost based device. */
9
 
struct vhost_virtqueue {
10
 
    int kick;
11
 
    int call;
12
 
    void *desc;
13
 
    void *avail;
14
 
    void *used;
15
 
    int num;
16
 
    unsigned long long used_phys;
17
 
    unsigned used_size;
18
 
    void *ring;
19
 
    unsigned long long ring_phys;
20
 
    unsigned ring_size;
21
 
    EventNotifier masked_notifier;
22
 
};
23
 
 
24
 
typedef unsigned long vhost_log_chunk_t;
25
 
#define VHOST_LOG_PAGE 0x1000
26
 
#define VHOST_LOG_BITS (8 * sizeof(vhost_log_chunk_t))
27
 
#define VHOST_LOG_CHUNK (VHOST_LOG_PAGE * VHOST_LOG_BITS)
28
 
 
29
 
struct vhost_memory;
30
 
struct vhost_dev {
31
 
    MemoryListener memory_listener;
32
 
    int control;
33
 
    struct vhost_memory *mem;
34
 
    int n_mem_sections;
35
 
    MemoryRegionSection *mem_sections;
36
 
    struct vhost_virtqueue *vqs;
37
 
    int nvqs;
38
 
    /* the first virtuque which would be used by this vhost dev */
39
 
    int vq_index;
40
 
    unsigned long long features;
41
 
    unsigned long long acked_features;
42
 
    unsigned long long backend_features;
43
 
    bool started;
44
 
    bool log_enabled;
45
 
    vhost_log_chunk_t *log;
46
 
    unsigned long long log_size;
47
 
    bool force;
48
 
};
49
 
 
50
 
int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath,
51
 
                   bool force);
52
 
void vhost_dev_cleanup(struct vhost_dev *hdev);
53
 
bool vhost_dev_query(struct vhost_dev *hdev, VirtIODevice *vdev);
54
 
int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev);
55
 
void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev);
56
 
int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);
57
 
void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev);
58
 
 
59
 
/* Test and clear masked event pending status.
60
 
 * Should be called after unmask to avoid losing events.
61
 
 */
62
 
bool vhost_virtqueue_pending(struct vhost_dev *hdev, int n);
63
 
 
64
 
/* Mask/unmask events from this vq.
65
 
 */
66
 
void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n,
67
 
                          bool mask);
68
 
#endif