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 861331 - Allow non-seamless migration of vms with usb-redir devices
Summary: Allow non-seamless migration of vms with usb-redir devices
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Hans de Goede
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-28 07:56 UTC by Hans de Goede
Modified: 2013-02-21 07:40 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.327.el6
Doc Type: Release Note
Doc Text:
Guest Live Migration Using USB Forwarding via SPICE In Red Hat Enterprise Linux 6.4, KVM supports live migration of guests using USB forwarding via SPICE, while maintaining existing USB device redirection for all configured devices.
Clone Of:
Environment:
Last Closed: 2013-02-21 07:40:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0527 0 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2013-02-20 21:51:08 UTC

Description Hans de Goede 2012-09-28 07:56:49 UTC
In 6.4 we will have / allow migration of vms with usb-redir devices. Currently the receiving side of the migration will fail the migration if it detects that it is non seamless. This also means that vms with usb-redir devices saved to disk cannot be restored!

I've posted a patch-set upstream:
http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg04880.html
http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg04879.html

Which changes the usb-redir device to not fail migration in the non-seamless case, instead it will
report the devices as disconnected to the guest immediately after the migration.

This allows migration of vms with a non-seamless capable client connected and also allows restoring vms saved to disk, as such I believe it is desirable to have this behavior in RHEL-6 too.

Comment 3 Qunfang Zhang 2012-10-16 04:58:15 UTC
Reproduced on qemu-kvm-0.12.1.2-2.323.el6, migration failed on the destination side with usb-redir devices.
Steps:
1. Boot guest with usb redirection
-device usb-ehci,id=ehci,addr=0x7 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=ehci.0,debug=3

2. Connect spice client with spicy tools (provided by spice-gtk-tools)

3. Select "Auto redirect newly plugged in USB devices" in "Option" menu. And then plug a USB disk to spice client host.
  
4. Migrate guest.
(qemu) __com.redhat_spice_migrate_info $dst_host_ip $dst_host_port 
(qemu) migrate -d tcp:$dst_host_ip:5800

Result:
Migration failed on dst host:

(qemu) red_dispatcher_loadvm_commands: 
qemu-kvm: usb-redir error: get_parser called with closed chardev, failing migration
qemu: warning: error while loading state for instance 0x0 of device '0000:00:07.0/1/usb-redir'

Verified on qemu-kvm-0.12.1.2-2.327.el6:

(1) seamless-migration (seamless-migration=on):
Test with the same steps as above, migration finished successfully and the usb disk is still over there, can read/write the USB disk.

(2) Non seamless migration (seamless-migraton=off):
Migration could finish successfully. But usb disk is gone inside guest after migration.  
Some qemu log:

(qemu) main_channel_link: add main channel client
red_dispatcher_loadvm_commands: 
main_channel_send_item: Init msg for client 0x7fbba91286d0 was not sent yet (client is probably during semi-seamless migration). Ignoring msg type 103
main_channel_send_item: Init msg for client 0x7fbba91286d0 was not sent yet (client is probably during semi-seamless migration). Ignoring msg type 116
qemu-kvm: usb-redir warning: usb-redir connection broken during migration

Hi, Hans
I have two questions:
(1) Is it the expected result that the usb-redir connection broken during migration with the non seamless migration? Why? 
(2) What does it mean in your bug description: "This allows migration of vms with a non-seamless capable client connected and also allows restoring vms saved to disk"?  What does the "allows restoring vms saved to disk"? 


Thanks,
Qunfang

Comment 4 Hans de Goede 2012-10-16 08:07:05 UTC
(In reply to comment #3)
> Hi, Hans
> I have two questions:
> (1) Is it the expected result that the usb-redir connection broken during
> migration with the non seamless migration?

Yes

> Why? 

Successfull migration with USB-devices enabled requires seamless migration. The reason we
want to also allow it without seamless is because of 2:

> (2) What does it mean in your bug description: "This allows migration of vms
> with a non-seamless capable client connected and also allows restoring vms
> saved to disk"?  What does the "allows restoring vms saved to disk"? 

What I mean is that it allows migrate to / from disk, which can be used to save
the state of a vm to disk to later restore it. Without this patch the restoring
would be impossible, as it would detect a non seamless migration and abort the
migrate from disk.

Regards,

Hans

Comment 5 Qunfang Zhang 2012-10-17 09:27:43 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Hi, Hans
> > I have two questions:
> > (1) Is it the expected result that the usb-redir connection broken during
> > migration with the non seamless migration?
> 
> Yes
> 
> > Why? 
> 
> Successfull migration with USB-devices enabled requires seamless migration.
> The reason we
> want to also allow it without seamless is because of 2:
> 
> > (2) What does it mean in your bug description: "This allows migration of vms
> > with a non-seamless capable client connected and also allows restoring vms
> > saved to disk"?  What does the "allows restoring vms saved to disk"? 
> 
> What I mean is that it allows migrate to / from disk, which can be used to
> save
> the state of a vm to disk to later restore it. Without this patch the
> restoring
> would be impossible, as it would detect a non seamless migration and abort
> the
> migrate from disk.
> 
> Regards,
> 
> Hans

OK, so this bug can be verified pass, right? BTW, when do we plan to allow the successfully migration with usb-redirection devices with non seamless migration? Do we have a bz to track it? 

Thanks,
Qunfang

Comment 6 Hans de Goede 2012-10-17 10:23:56 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Hi, Hans
> > > I have two questions:
> > > (1) Is it the expected result that the usb-redir connection broken during
> > > migration with the non seamless migration?
> > 
> > Yes
> > 
> > > Why? 
> > 
> > Successfull migration with USB-devices enabled requires seamless migration.
> > The reason we
> > want to also allow it without seamless is because of 2:
> > 
> > > (2) What does it mean in your bug description: "This allows migration of vms
> > > with a non-seamless capable client connected and also allows restoring vms
> > > saved to disk"?  What does the "allows restoring vms saved to disk"? 
> > 
> > What I mean is that it allows migrate to / from disk, which can be used to
> > save
> > the state of a vm to disk to later restore it. Without this patch the
> > restoring
> > would be impossible, as it would detect a non seamless migration and abort
> > the
> > migrate from disk.
> > 
> > Regards,
> > 
> > Hans
> 
> OK, so this bug can be verified pass, right?

Right.

> BTW, when do we plan to allow
> the successfully migration with usb-redirection devices with non seamless
> migration?

Never, migration with usb-redirection devices connected, and keeping them
connected after migration is only supported with seamless migraton.

Comment 7 Qunfang Zhang 2012-10-17 11:40:42 UTC
OK, get it and thank you.

Comment 9 errata-xmlrpc 2013-02-21 07:40:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0527.html


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