[pve-devel] [PATCH] allow migration with usbhost device

2016-02-04 Thread Alexandre Derumier
We can migrate a vm with a usbhost device plugged without any problem.

If the target server don't have the usb device, the device is unplugged on 
target vm

If the target server have same kind of usb device (same vendor:productid or 
same usb port),
it's transparent for the vm.

Signed-off-by: Alexandre Derumier 
Reported-by: Edouard Bru 
---
 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 14a18f0..fbd4830 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2297,7 +2297,7 @@ sub check_local_resources {
next if $k =~ m/^usb/ && ($conf->{$k} eq 'spice');
# sockets are safe: they will recreated be on the target side 
post-migrate
next if $k =~ m/^serial/ && ($conf->{$k} eq 'socket');
-   $loc_res = 1 if $k =~ m/^(usb|hostpci|serial|parallel)\d+$/;
+   $loc_res = 1 if $k =~ m/^(hostpci|serial|parallel)\d+$/;
 }
 
 die "VM uses local resources\n" if $loc_res && !$noerr;
-- 
2.1.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] [PATCH] allow migration with usbhost device

2016-02-04 Thread Dietmar Maurer


> On February 4, 2016 at 4:04 PM Alexandre Derumier  wrote:
> 
> 
> We can migrate a vm with a usbhost device plugged without any problem.
> 
> If the target server don't have the usb device, the device is unplugged on
> target vm
> 
> If the target server have same kind of usb device (same vendor:productid or
> same usb port),
> it's transparent for the vm.

That makes no sense to me. After migration the VM is connected to a totally
different usb device!
USB devices are local, and not migratable.

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] [PATCH] allow migration with usbhost device

2016-02-04 Thread Alexandre DERUMIER
>>That makes no sense to me. After migration the VM is connected to a totally 
>>different usb device! 

for example , for usb key, yes, they are different.

But some devices like usb dongles could work without any problem.

(Migrating a vm with propriarity software which need a dongle)


(We have tested it during the training)




- Mail original -
De: "dietmar" <diet...@proxmox.com>
À: "aderumier" <aderum...@odiso.com>, "pve-devel" <pve-devel@pve.proxmox.com>
Envoyé: Jeudi 4 Février 2016 16:57:24
Objet: Re: [pve-devel] [PATCH] allow migration with usbhost device

> On February 4, 2016 at 4:04 PM Alexandre Derumier <aderum...@odiso.com> 
> wrote: 
> 
> 
> We can migrate a vm with a usbhost device plugged without any problem. 
> 
> If the target server don't have the usb device, the device is unplugged on 
> target vm 
> 
> If the target server have same kind of usb device (same vendor:productid or 
> same usb port), 
> it's transparent for the vm. 

That makes no sense to me. After migration the VM is connected to a totally 
different usb device! 
USB devices are local, and not migratable. 
___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] [PATCH] allow migration with usbhost device

2016-02-04 Thread Dietmar Maurer
> for example , for usb key, yes, they are different.
> 
> But some devices like usb dongles could work without any problem.
> 
> (Migrating a vm with propriarity software which need a dongle)

Sure, it can work for special cases. But in general this would be a
dangerous feature. Maybe an extra flag for such cases?

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] [PATCH] allow migration with usbhost device

2016-02-04 Thread Alexandre DERUMIER
>>Sure, it can work for special cases. But in general this would be a 
>>dangerous feature. Maybe an extra flag for such cases? 

Ok no problem.

I think we have already

  -force boolean

Allow to migrate VMs which use local devices. Only root may
use this option.


I think it should work ?




- Mail original -
De: "dietmar" <diet...@proxmox.com>
À: "aderumier" <aderum...@odiso.com>
Cc: "pve-devel" <pve-devel@pve.proxmox.com>
Envoyé: Jeudi 4 Février 2016 17:58:23
Objet: Re: [pve-devel] [PATCH] allow migration with usbhost device

> for example , for usb key, yes, they are different. 
> 
> But some devices like usb dongles could work without any problem. 
> 
> (Migrating a vm with propriarity software which need a dongle) 

Sure, it can work for special cases. But in general this would be a 
dangerous feature. Maybe an extra flag for such cases? 

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] [PATCH] allow migration with usbhost device

2016-02-04 Thread Dietmar Maurer
> >>Sure, it can work for special cases. But in general this would be a 
> >>dangerous feature. Maybe an extra flag for such cases? 
> 
> Ok no problem.
> 
> I think we have already
> 
>   -force boolean
> 
> Allow to migrate VMs which use local devices. Only root
> may
> use this option.
> 
> 
> I think it should work ?

Ah, yes.

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel