Bug 694357 - virsh attach-disk failed after libvirt update
Summary: virsh attach-disk failed after libvirt update
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Scott Radvan
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-07 05:40 UTC by Takashi Sato
Modified: 2018-11-14 13:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-11 14:03:59 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Takashi Sato 2011-04-07 05:40:18 UTC
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:

Comment 1 Takashi Sato 2011-04-07 05:43:19 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.