Auto-add disk controllers based on defined disks

Existing applications using libvirt are not aware of the disk
controller concept. Thus, after parsing the <disk> definitions
in the XML, it is neccessary to create <controller> elements
to satisfy all requested disks, as per their defined drive
addresses

* src/conf/domain_conf.c, src/conf/domain_conf.h,
  src/libvirt_private.syms: Add virDomainDefAddDiskControllers()
  method for populating disk controllers, and call it after
  parsing disk definitions.
* src/qemu/qemu_conf.c: Call virDomainDefAddDiskControllers()
  when doing ARGV -> XML conversion
* tests/qemuxml2argvdata/qemuxml2argv*.xml: Add disk controller
  data to all data files which don't have it already
This commit is contained in:
Daniel P. Berrange
2010-01-05 13:31:20 +00:00
parent 2224989c39
commit b030084f07
80 changed files with 181 additions and 0 deletions

View File

@@ -23,5 +23,6 @@
<source file='/tmp/usbdisk.img'/>
<target dev='sda' bus='usb'/>
</disk>
<controller type='ide' index='0'/>
</devices>
</domain>