Fixe default disk bus selection logic

This commit is contained in:
Daniel P. Berrange 2008-05-15 16:24:26 +00:00
parent 763a59d84d
commit 25f860dc2f
2 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,7 @@
Thu May 15 12:21:08 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_conf.c: Fix default disk bus selection logic
Thu May 15 12:16:08 EST 2008 Daniel P. Berrange <berrange@redhat.com> Thu May 15 12:16:08 EST 2008 Daniel P. Berrange <berrange@redhat.com>
Support xenner bootloader capability Support xenner bootloader capability

View File

@ -698,10 +698,20 @@ static int qemudParseDiskXML(virConnectPtr conn,
} }
if (!bus) { if (!bus) {
if (disk->device == QEMUD_DISK_FLOPPY) if (disk->device == QEMUD_DISK_FLOPPY) {
disk->bus = QEMUD_DISK_BUS_FDC; disk->bus = QEMUD_DISK_BUS_FDC;
} else {
if (STRPREFIX((const char *)target, "hd"))
disk->bus = QEMUD_DISK_BUS_IDE;
else if (STRPREFIX((const char *)target, "sd"))
disk->bus = QEMUD_DISK_BUS_SCSI;
else if (STRPREFIX((const char *)target, "vd"))
disk->bus = QEMUD_DISK_BUS_VIRTIO;
else if (STRPREFIX((const char *)target, "xvd"))
disk->bus = QEMUD_DISK_BUS_XEN;
else else
disk->bus = QEMUD_DISK_BUS_IDE; disk->bus = QEMUD_DISK_BUS_IDE;
}
} else if (STREQ((const char *)bus, "ide")) } else if (STREQ((const char *)bus, "ide"))
disk->bus = QEMUD_DISK_BUS_IDE; disk->bus = QEMUD_DISK_BUS_IDE;
else if (STREQ((const char *)bus, "fdc")) else if (STREQ((const char *)bus, "fdc"))