Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Run virsh attach-device with --persistent option,it returns error with "persistent attach of device is not supported"
Version-Release number of selected component (if applicable):
libvirt-0.9.4-7.el6.x86_64
How reproducible:
always
Steps to Reproduce:
1.Start a kvm guest
2.Prepare a pci-device xml as following:
# cat host.xml
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
</source>
</hostdev>
3.# virsh attach-device rhel5u6 host.xml --persistent
error: Failed to attach device from host.xml
error: unsupported configuration: persistent attach of device is not supported
Actual results:
As steps 3,attach-device doesn't support --persistent option
Expected results:
# virsh help attach-device
NAME
attach-device - attach device from an XML file
SYNOPSIS
attach-device<domain> <file> [--persistent]
DESCRIPTION
Attach device from an XML<file>.
OPTIONS
[--domain]<string> domain name, id or uuid
[--file]<string> XML file
--persistent persist device attachment
attach-device with --persistent option works well
Additional info:
There is a bug 599325 about this issue,it closed duplicate of bug 598792 which has been verified with libvirt-0.9.1-1.el6.
So I file a new one only for command attach-device.
In fact, for qemu driver, the function qemuDomainAttachDeviceConfig only supports VIR_DOMAIN_DEVICE_DISK, VIR_DOMAIN_DEVICE_NET and VIR_DOMAIN_DEVICE_LEASE device types, when dev->type is VIR_DOMAIN_DEVICE_HOSTDEV, 'default' branch will be hit.
As document said, if attach-device supports --persistent option, the following codes should add 'VIR_DOMAIN_DEVICE_HOSTDEV' branch and implementation.
* src/qemu/qemu_driver.c:
static int
qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev)
{
......
switch (dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
disk = dev->data.disk;
......
case VIR_DOMAIN_DEVICE_NET:
net = dev->data.net;
......
case VIR_DOMAIN_DEVICE_LEASE:
lease = dev->data.lease;
......
default:
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("persistent attach of device is not supported"));
......
}
Alex
This feature has been implemented with --config option.
SYNOPSIS
attach-device <domain> <file> [--config]
commit edb6fc3a7f0de4a4881862287b412b66b8153768
Author: Laine Stump <laine>
Date: Wed Mar 7 16:05:34 2012 -0500
qemu: support persistent hotplug of <hostdev> devices
For some reason, although live hotplug of <hostdev> devices is
supported, persistent hotplug is not. This patch adds the proper
VIR_DOMAIN_DEVICE_HOSTDEV cases to the switches in
qemuDomainAttachDeviceConfig and qemuDomainDetachDeviceConfig.
Description of problem: Run virsh attach-device with --persistent option,it returns error with "persistent attach of device is not supported" Version-Release number of selected component (if applicable): libvirt-0.9.4-7.el6.x86_64 How reproducible: always Steps to Reproduce: 1.Start a kvm guest 2.Prepare a pci-device xml as following: # cat host.xml <hostdev mode='subsystem' type='pci' managed='yes'> <source> <address domain='0x0000' bus='0x03' slot='0x00' function='0x1'/> </source> </hostdev> 3.# virsh attach-device rhel5u6 host.xml --persistent error: Failed to attach device from host.xml error: unsupported configuration: persistent attach of device is not supported Actual results: As steps 3,attach-device doesn't support --persistent option Expected results: # virsh help attach-device NAME attach-device - attach device from an XML file SYNOPSIS attach-device<domain> <file> [--persistent] DESCRIPTION Attach device from an XML<file>. OPTIONS [--domain]<string> domain name, id or uuid [--file]<string> XML file --persistent persist device attachment attach-device with --persistent option works well Additional info: There is a bug 599325 about this issue,it closed duplicate of bug 598792 which has been verified with libvirt-0.9.1-1.el6. So I file a new one only for command attach-device.