All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Some confusion about live migration of usb device
@ 2018-09-06 10:25 linzhecheng
  2018-09-06 12:04 ` gerd hoffmann
  0 siblings, 1 reply; 7+ messages in thread
From: linzhecheng @ 2018-09-06 10:25 UTC (permalink / raw)
  To: gerd hoffmann; +Cc: CheneyLin, wangxin (U), qemu-devel

Hi, Gerd

I'm going through relevant codes about live migration of usb devices, it seems that we will not save/load USBpacket in any vmstate, so pending usb packets will be lost after live migration, is it a problem?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Some confusion about live migration of usb device
  2018-09-06 10:25 [Qemu-devel] Some confusion about live migration of usb device linzhecheng
@ 2018-09-06 12:04 ` gerd hoffmann
  2018-09-06 12:10   ` linzhecheng
  0 siblings, 1 reply; 7+ messages in thread
From: gerd hoffmann @ 2018-09-06 12:04 UTC (permalink / raw)
  To: linzhecheng; +Cc: CheneyLin, wangxin (U), qemu-devel

On Thu, Sep 06, 2018 at 10:25:20AM +0000, linzhecheng wrote:
> Hi, Gerd
> 
> I'm going through relevant codes about live migration of usb devices,
> it seems that we will not save/load USBpacket in any vmstate, so
> pending usb packets will be lost after live migration, is it a
> problem?

With usb-host or usb-redir?

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Some confusion about live migration of usb device
  2018-09-06 12:04 ` gerd hoffmann
@ 2018-09-06 12:10   ` linzhecheng
  2018-09-06 13:52     ` gerd hoffmann
  0 siblings, 1 reply; 7+ messages in thread
From: linzhecheng @ 2018-09-06 12:10 UTC (permalink / raw)
  To: gerd hoffmann; +Cc: CheneyLin, wangxin (U), qemu-devel

You had said that copying vmstate of usb-host is pointless, so just unpulg and plug it after migration is all right,
 but will other usb devices like usb-storage devices lose pending USBPackets then?  

> -----Original Message-----
> From: gerd hoffmann [mailto:kraxel@redhat.com]
> Sent: Thursday, September 06, 2018 8:04 PM
> To: linzhecheng <linzhecheng@huawei.com>
> Cc: CheneyLin <linzc@zju.edu.cn>; wangxin (U)
> <wangxinxin.wang@huawei.com>; qemu-devel@nongnu.org
> Subject: Re: Some confusion about live migration of usb device
> 
> On Thu, Sep 06, 2018 at 10:25:20AM +0000, linzhecheng wrote:
> > Hi, Gerd
> >
> > I'm going through relevant codes about live migration of usb devices,
> > it seems that we will not save/load USBpacket in any vmstate, so
> > pending usb packets will be lost after live migration, is it a
> > problem?
> 
> With usb-host or usb-redir?
> 
> cheers,
>   Gerd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Some confusion about live migration of usb device
  2018-09-06 12:10   ` linzhecheng
@ 2018-09-06 13:52     ` gerd hoffmann
  2018-09-06 14:23       ` CheneyLin
  0 siblings, 1 reply; 7+ messages in thread
From: gerd hoffmann @ 2018-09-06 13:52 UTC (permalink / raw)
  To: linzhecheng; +Cc: CheneyLin, wangxin (U), qemu-devel

On Thu, Sep 06, 2018 at 12:10:08PM +0000, linzhecheng wrote:
> You had said that copying vmstate of usb-host is pointless, so just unpulg and plug it after migration is all right,
>  but will other usb devices like usb-storage devices lose pending USBPackets then?  

Ah, emulated usb devices.  The usb host adapters will re-submit any
unfinished usb transfers on the target machine.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Some confusion about live migration of usb device
  2018-09-06 13:52     ` gerd hoffmann
@ 2018-09-06 14:23       ` CheneyLin
  2018-09-07  6:23         ` gerd hoffmann
  0 siblings, 1 reply; 7+ messages in thread
From: CheneyLin @ 2018-09-06 14:23 UTC (permalink / raw)
  To: gerd hoffmann; +Cc: linzhecheng, wangxin (u), qemu-devel




> -----原始邮件-----
> 发件人: "gerd hoffmann" <kraxel@redhat.com>
> 发送时间: 2018-09-06 21:52:23 (星期四)
> 收件人: linzhecheng <linzhecheng@huawei.com>
> 抄送: "wangxin (U)" <wangxinxin.wang@huawei.com>, CheneyLin <linzc@zju.edu.cn>, "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
> 主题: Re: [Qemu-devel] Some confusion about live migration of usb device
> 
> On Thu, Sep 06, 2018 at 12:10:08PM +0000, linzhecheng wrote:
> > You had said that copying vmstate of usb-host is pointless, so just unpulg and plug it after migration is all right,
> >  but will other usb devices like usb-storage devices lose pending USBPackets then?  
> 
> Ah, emulated usb devices.  The usb host adapters will re-submit any
> unfinished usb transfers on the target machine.
You mean target vm usb controllers will re-submit them? 
And what about usb-redir, btw?
> 
> cheers,
>   Gerd
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Some confusion about live migration of usb device
  2018-09-06 14:23       ` CheneyLin
@ 2018-09-07  6:23         ` gerd hoffmann
  2018-09-07  6:27           ` linzhecheng
  0 siblings, 1 reply; 7+ messages in thread
From: gerd hoffmann @ 2018-09-07  6:23 UTC (permalink / raw)
  To: CheneyLin; +Cc: linzhecheng, wangxin (u), qemu-devel

On Thu, Sep 06, 2018 at 10:23:45PM +0800, CheneyLin wrote:
> 
> 
> 
> > -----原始邮件-----
> > 发件人: "gerd hoffmann" <kraxel@redhat.com>
> > 发送时间: 2018-09-06 21:52:23 (星期四)
> > 收件人: linzhecheng <linzhecheng@huawei.com>
> > 抄送: "wangxin (U)" <wangxinxin.wang@huawei.com>, CheneyLin <linzc@zju.edu.cn>, "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
> > 主题: Re: [Qemu-devel] Some confusion about live migration of usb device
> > 
> > On Thu, Sep 06, 2018 at 12:10:08PM +0000, linzhecheng wrote:
> > > You had said that copying vmstate of usb-host is pointless, so just unpulg and plug it after migration is all right,
> > >  but will other usb devices like usb-storage devices lose pending USBPackets then?  
> > 
> > Ah, emulated usb devices.  The usb host adapters will re-submit any
> > unfinished usb transfers on the target machine.
> You mean target vm usb controllers will re-submit them? 

Yes.

> And what about usb-redir, btw?

Basically the same.  But some extra care is needed to make sure the
physical device will not see requests twice when the target starts
replaying unfinished requests.  All usb requests get a unique tag
(USBPacket->id) so the usbredir server (typically spice client) has a
chance to handle this correctly.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] Some confusion about live migration of usb device
  2018-09-07  6:23         ` gerd hoffmann
@ 2018-09-07  6:27           ` linzhecheng
  0 siblings, 0 replies; 7+ messages in thread
From: linzhecheng @ 2018-09-07  6:27 UTC (permalink / raw)
  To: gerd hoffmann, CheneyLin; +Cc: wangxin (U), qemu-devel



> -----Original Message-----
> From: gerd hoffmann [mailto:kraxel@redhat.com]
> Sent: Friday, September 07, 2018 2:23 PM
> To: CheneyLin <linzc@zju.edu.cn>
> Cc: linzhecheng <linzhecheng@huawei.com>; wangxin (U)
> <wangxinxin.wang@huawei.com>; qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] Some confusion about live migration of usb device
> 
> On Thu, Sep 06, 2018 at 10:23:45PM +0800, CheneyLin wrote:
> >
> >
> >
> > > -----原始邮件-----
> > > 发件人: "gerd hoffmann" <kraxel@redhat.com>
> > > 发送时间: 2018-09-06 21:52:23 (星期四)
> > > 收件人: linzhecheng <linzhecheng@huawei.com>
> > > 抄送: "wangxin (U)" <wangxinxin.wang@huawei.com>, CheneyLin
> > > <linzc@zju.edu.cn>, "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
> > > 主题: Re: [Qemu-devel] Some confusion about live migration of usb
> > > device
> > >
> > > On Thu, Sep 06, 2018 at 12:10:08PM +0000, linzhecheng wrote:
> > > > You had said that copying vmstate of usb-host is pointless, so
> > > > just unpulg and plug it after migration is all right,  but will other usb
> devices like usb-storage devices lose pending USBPackets then?
> > >
> > > Ah, emulated usb devices.  The usb host adapters will re-submit any
> > > unfinished usb transfers on the target machine.
> > You mean target vm usb controllers will re-submit them?
> 
> Yes.
> 
> > And what about usb-redir, btw?
> 
> Basically the same.  But some extra care is needed to make sure the physical
> device will not see requests twice when the target starts replaying unfinished
> requests.  All usb requests get a unique tag
> (USBPacket->id) so the usbredir server (typically spice client) has a chance to
> handle this correctly.
I got it! Thank you for patiently answering my questions.
> 
> cheers,
>   Gerd


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-07  6:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 10:25 [Qemu-devel] Some confusion about live migration of usb device linzhecheng
2018-09-06 12:04 ` gerd hoffmann
2018-09-06 12:10   ` linzhecheng
2018-09-06 13:52     ` gerd hoffmann
2018-09-06 14:23       ` CheneyLin
2018-09-07  6:23         ` gerd hoffmann
2018-09-07  6:27           ` linzhecheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.