mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
qdev-ify virtio-blk.
First user of the new drive property. With this patch applied host and guest config can be specified separately, like this: -drive if=none,id=disk1,file=/path/to/disk.img -device virtio-blk-pci,drive=disk1 You can set any property for virtio-blk-pci now. You can set the pci address via addr=. You can switch the device into 0.10 compat mode using class=0x0180. As this is per device you can have one 0.10 and one 0.11 virtio block device in a single virtual machine. Old syntax continues to work. Internally it does the same as the two lines above though. One side effect this has is a different initialization order, which might result in a different pci address being assigned by default. Long term plan here is to have this working for all block devices, i.e. once all scsi is properly qdev-ified you will be able to do something like this: -drive if=none,id=sda,file=/path/to/disk.img -device lsi,id=lsi,addr=<pciaddr> -device scsi-disk,drive=sda,bus=lsi.0,lun=<n> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-Id:
This commit is contained in:
parent
14b41872fd
commit
d176c495b6
8 changed files with 25 additions and 44 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "hw.h"
|
||||
#include "qdev.h"
|
||||
#include "sysemu.h"
|
||||
|
||||
/* from Linux's linux/virtio_config.h */
|
||||
|
||||
|
@ -161,7 +162,7 @@ void virtio_bind_device(VirtIODevice *vdev, const VirtIOBindings *binding,
|
|||
void *opaque);
|
||||
|
||||
/* Base devices. */
|
||||
VirtIODevice *virtio_blk_init(DeviceState *dev);
|
||||
VirtIODevice *virtio_blk_init(DeviceState *dev, DriveInfo *dinfo);
|
||||
VirtIODevice *virtio_net_init(DeviceState *dev);
|
||||
VirtIODevice *virtio_console_init(DeviceState *dev);
|
||||
VirtIODevice *virtio_balloon_init(DeviceState *dev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue