]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kvm tools: Rework on virtio transport abstraction.
authorAsias He <asias.hejun@gmail.com>
Sat, 7 Apr 2012 22:48:20 +0000 (06:48 +0800)
committerPekka Enberg <penberg@kernel.org>
Mon, 9 Apr 2012 08:34:46 +0000 (11:34 +0300)
commit65a9ec5c6a98587366aca7eb2424666fd50d53f8
tree8457e1c82fbf61b9765d6cd007776ef13decf739
parent1091610e3bff422b4f515a7f033f5fbe77b6bebd
kvm tools: Rework on virtio transport abstraction.

This patch reworks on virtio transport abstraction.

* Move virtio transport operations to virtio operations and drop
  virtio/trans.c This makes the abstraction much cleaner.

* Rename struct virtio_trans to struct virtio_device

  struct virtio_trans {
       void                    *virtio;
       enum virtio_trans_type  type;
       struct virtio_trans_ops *trans_ops;
       struct virtio_ops       *virtio_ops;
  };

  struct virtio_device {
       void                    *virtio;
       struct virtio_ops       *ops;
  };

  The virtio_trans struct is bit confusing since it also includes virtio
  operations.

* Introduce virtio_init()
  To init device, e.g.
  Before:
virtio_trans_init()
ndev->vtrans.trans_ops->init()
ndev->vtrans.virtio_ops = &net_dev_virtio_ops
  After:
virtio_init()

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
14 files changed:
tools/kvm/Makefile
tools/kvm/include/kvm/virtio-9p.h
tools/kvm/include/kvm/virtio-pci.h
tools/kvm/include/kvm/virtio-trans.h [deleted file]
tools/kvm/include/kvm/virtio.h
tools/kvm/virtio/9p.c
tools/kvm/virtio/balloon.c
tools/kvm/virtio/blk.c
tools/kvm/virtio/console.c
tools/kvm/virtio/core.c
tools/kvm/virtio/net.c
tools/kvm/virtio/pci.c
tools/kvm/virtio/rng.c
tools/kvm/virtio/trans.c [deleted file]