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.
Bug 1360963 - Migrate a guest with ccid smartcard from RHEL7.3 to RHEL7.2 failed.
Summary: Migrate a guest with ccid smartcard from RHEL7.3 to RHEL7.2 failed.
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-28 03:28 UTC by Fangge Jin
Modified: 2016-09-07 16:13 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-07 16:13:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Fangge Jin 2016-07-28 03:28:39 UTC
Description of problem:
Start a guest with ccid smartcard on RHEL7.3 host, then migrate it RHEL7.2 host, migration failed with error "Controllers must use the 'pci' address type"

# virsh migrate rhel7.2 qemu+ssh://10.66.4.113/system --live --verbose
error: internal error: Controllers must use the 'pci' address type

Version-Release number of selected component:
RHEL7.2:
libvirt-1.2.17-13.el7.x86_64
qemu-kvm-rhev-2.3.0-31.el7.x86_64

RHEL7.3:
libvirt-2.0.0-3.el7.x86_64
qemu-kvm-rhev-2.6.0-15.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
0. On rhel7.3 host, prepare a guest xml with smartcard:
# cat rhel7.2.xml
...
    <smartcard mode='passthrough' type='spicevmc'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
...

1. # virsh define rhel7.2.xml

2. # virsh dumpxml rhel7.2
...
    <controller type='ccid' index='0'>
      <address type='usb' bus='0' port='1'/>
    </controller>                             
===> The above three lines are added by libvirt automatically.
...
    <smartcard mode='passthrough' type='spicevmc'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
...

3. # virsh start rhel7.2

4. Migrate the guest to RHEL7.2 host


Actual results:
Migration failed

Expected results:
Migration can succeed.


Additional info:
If define the guest on RHEL7.2 host with exactly same xml, the dumpxml is as:
# virsh define rhel7.2.xml

# virsh dumpxml rhel7.2
...
    <controller type='ccid' index='0'/>
...
    <smartcard mode='passthrough' type='spicevmc'>
      <address type='ccid' controller='0' slot='0'/>
    </smartcard>
...

Comment 2 Ján Tomko 2016-08-16 14:31:07 UTC
Since older libvirt does not support specifying USB addresses for usb-ccid controllers, such domain cannot be reliably migrated.

We can try omitting the USB address in migration XML, which should work as long as QEMU on the destination makes up the same address as we gave it on the source.

But if it does not, there can be a clash with other devices which have an address assigned in the XML.

If that fails, WONTFIX/CANTFIX?

Comment 3 Dr. David Alan Gilbert 2016-08-16 16:09:35 UTC
I'd recommend not setting the USB address except on hosts with a new machine type; that way machine types that can migrate backwards are as safe/broken as they were before, but new machines are safe.

Note that QEMU migration previously worked reliably with USB devices as long as they were either:
  a) Added in the same order on both command lines
  b) The only device on a particular USB controller

So actually most USB migrations worked; it was normally only hotplugging which broke things; so we shouldn't make it any worse than that, and thus I think it needs fixing.

Comment 4 Dr. David Alan Gilbert 2016-08-16 16:09:51 UTC
I'd recommend not setting the USB address except on VMs with a new machine type; that way machine types that can migrate backwards are as safe/broken as they were before, but new machines are safe.

Note that QEMU migration previously worked reliably with USB devices as long as they were either:
  a) Added in the same order on both command lines
  b) The only device on a particular USB controller

So actually most USB migrations worked; it was normally only hotplugging which broke things; so we shouldn't make it any worse than that, and thus I think it needs fixing.

Comment 5 Ján Tomko 2016-08-17 16:18:03 UTC
Thanks, that would work for downstream.

But upstream we cannot make assumptions on libvirt versions based on the machine type version. And I realized that depending on the use case, the solution I proposed in comment 2 might break more things than fix. I have sent a mail to the upstream list to see if anyone has a better idea:
https://www.redhat.com/archives/libvir-list/2016-August/msg00875.html

Comment 6 Dr. David Alan Gilbert 2016-08-17 16:29:48 UTC
(In reply to Ján Tomko from comment #5)
> Thanks, that would work for downstream.
> 
> But upstream we cannot make assumptions on libvirt versions based on the
> machine type version. And I realized that depending on the use case, the
> solution I proposed in comment 2 might break more things than fix. I have
> sent a mail to the upstream list to see if anyone has a better idea:
> https://www.redhat.com/archives/libvir-list/2016-August/msg00875.html

Hmm that's tricky then.
My other suggestion would be not adding addresses unless an addr=auto tag was in the xml, but then when do you add that tag? Only if you somehow know all your libvirts you could migrate to are going to do it.

Dave

Comment 9 Ján Tomko 2016-09-07 16:13:35 UTC
I'm afraid this cannot be reasonably fixed, apart from reverting the address assignment completely.


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