allow if=none for drive_add

Allow adding unconnected host drives by specifying if=none like it is
possible with -drive.  They can be put in use with drive attributes,
like this:

  drive_add dummy if=none,id=mydisk,file=/some/disk.img
  device_add virtio-blk-pci,drive=mydisk

which is the monitor aequivalent to these command line switches:

  -drive if=none,id=mydisk,file=/some/disk.img
  -device virtio-blk-pci,drive=mydisk

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Gerd Hoffmann 2009-09-25 21:42:48 +02:00 committed by Anthony Liguori
parent 4db49dc087
commit 7101174e5c
1 changed files with 3 additions and 0 deletions

View File

@ -91,6 +91,9 @@ void drive_hot_add(Monitor *mon, const QDict *qdict)
dinfo->bus,
dinfo->unit);
break;
case IF_NONE:
monitor_printf(mon, "OK\n");
break;
default:
monitor_printf(mon, "Can't hot-add drive to type %d\n", type);
goto err;