Hide Forgot
Description of problem: After libvirt package was updated from 0.6.3 to 0.8.2 and restarted libvirtd, virsh attack-disk command failed with following error. --- virsh # attach-disk hachi-test /root/disk.iso hdc --type cdrom error: Failed to attach disk error: internal error missing disk device alias name for hdc --- This continues until guest OS reboots. Version-Release number of selected component (if applicable): libvirt-0.8.2 How reproducible: Steps to Reproduce: . Set up KVM environment with libvirt-0.6.3 (and libvirtd-python-0.6.3) and configure guest OS and run it. 2. Update libvirt and libvirt-python packages to 0.8.2 without stopping guest OS instance. 3. Restart libvirtd # service libvirtd restart 4. Now virsh attach-disk command fails. virsh # attach-disk hachi-test /root/disk.iso hdc --type cdrom Actual results: error: Failed to attach disk error: internal error missing disk device alias name for hdc Expected results: No error. Additional info:
static int qemudDomainChangeEjectableMedia(struct qemud_driver *driver, virDomainObjPtr vm, virDomainDiskDefPtr disk, { unsigned long long qemuCmdFlags) : origdisk = NULL; for (i = 0 ; i < vm->def->ndisks ; i++) { if (vm->def->disks[i]->bus == disk->bus && STREQ(vm->def->disks[i]->dst, disk->dst)) { origdisk = vm->def->disks[i]; break; } } if (!origdisk) { qemuReportError(VIR_ERR_INTERNAL_ERROR, _("No device with bus '%s' and target '%s'"), virDomainDiskBusTypeToString(disk->bus), disk->dst); return -1; } if (!origdisk->info.alias) { qemuReportError(VIR_ERR_INTERNAL_ERROR, _("missing disk device alias name for %s"), origdisk- >dst); return -1; } } == That is, origdisk->info.alias was not available. And this data structure is defined as follows: == struct _virDomainDiskDef { int type; int device; int bus; char *src; char *dst; char *driverName; char *driverType; char *serial; int cachemode; int error_policy; unsigned int readonly : 1; unsigned int shared : 1; virDomainDeviceInfo info; <<<<<<<<<<<<<<<<< virStorageEncryptionPtr encryption; }; == This is the version of libvirt-0.8.2. And I found that the member "virDomainDeviceInfo info" does not exist on the version of libvirt-0.6.3: == struct _virDomainDiskDef { int type; int device; int bus; char *src; char *dst; char *driverName; char *driverType; int cachemode; unsigned int readonly : 1; unsigned int shared : 1; int slotnum; /* pci slot number for unattach */ }; == So there might be a compatibility issue between libvirtd and kvm after the update.