* src/qemu_driver.c: fix qemudDiskDeviceName to handle disk devices

too, patch by Guido Günther
daniel
This commit is contained in:
Daniel Veillard 2008-10-17 09:24:07 +00:00
parent aadb84a547
commit f009e2aae2
2 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,8 @@
Fri Oct 17 11:20:48 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/qemu_driver.c: fix qemudDiskDeviceName to handle disk devices
too, patch by Guido Günther
Fri Oct 17 11:16:30 CEST 2008 Daniel Veillard <veillard@redhat.com> Fri Oct 17 11:16:30 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/domain_conf.c: fix virDiskNameToBusDeviceIndex() to allow 0 * src/domain_conf.c: fix virDiskNameToBusDeviceIndex() to allow 0

View File

@ -2342,8 +2342,8 @@ static int qemudDomainUndefine(virDomainPtr dom) {
} }
/* Return the disks name for use in monitor commands */ /* Return the disks name for use in monitor commands */
static char *qemudDiskDeviceName(virDomainPtr dom, static char *qemudDiskDeviceName(const virDomainPtr dom,
virDomainDiskDefPtr disk) { const virDomainDiskDefPtr disk) {
int busid, devid; int busid, devid;
int ret; int ret;
@ -2358,10 +2358,16 @@ static char *qemudDiskDeviceName(virDomainPtr dom,
switch (disk->bus) { switch (disk->bus) {
case VIR_DOMAIN_DISK_BUS_IDE: case VIR_DOMAIN_DISK_BUS_IDE:
ret = asprintf(&devname, "ide%d-cd%d", busid, devid); if (disk->device== VIR_DOMAIN_DISK_DEVICE_DISK)
ret = asprintf(&devname, "ide%d-hd%d", busid, devid);
else
ret = asprintf(&devname, "ide%d-cd%d", busid, devid);
break; break;
case VIR_DOMAIN_DISK_BUS_SCSI: case VIR_DOMAIN_DISK_BUS_SCSI:
ret = asprintf(&devname, "scsi%d-cd%d", busid, devid); if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK)
ret = asprintf(&devname, "scsi%d-hd%d", busid, devid);
else
ret = asprintf(&devname, "scsi%d-cd%d", busid, devid);
break; break;
case VIR_DOMAIN_DISK_BUS_FDC: case VIR_DOMAIN_DISK_BUS_FDC:
ret = asprintf(&devname, "floppy%d", devid); ret = asprintf(&devname, "floppy%d", devid);