Re: [pve-devel] [PATCH 2/2] now if the QMP command starts with guest-+ , it will bind dynamicly to the VMID.qga socket. To test the function vmtime is implemented which return the vm UNIX Time.

2014-11-25 Thread Alexandre DERUMIER
I thought about IP address and disk usage: guest-network-get-interfaces guest-get-fsinfo So maybe 1 call each minute is enough for this ? But seems guest-get-fsinfo does not return useful data :-/ Yes, I only display mountpoint. (could be useful for hot-unplug protection). Note that both

Re: [pve-devel] [PATCH 2/2] now if the QMP command starts with guest-+ , it will bind dynamicly to the VMID.qga socket. To test the function vmtime is implemented which return the vm UNIX Time.

2014-11-25 Thread Dietmar Maurer
I thought about IP address and disk usage: guest-network-get-interfaces guest-get-fsinfo So maybe 1 call each minute is enough for this ? yes But seems guest-get-fsinfo does not return useful data :-/ Yes, I only display mountpoint. (could be useful for hot-unplug protection).

Re: [pve-devel] vm_deviceunplug question

2014-11-25 Thread Alexandre DERUMIER
This is because for virtio disk we remove the controller + drive, (1controller - 1 drive) and for scsi we only remove the drive (1controller - 256 drives) - Mail original - De: Dietmar Maurer diet...@proxmox.com À: Alexandre DERUMIER (aderum...@odiso.com) aderum...@odiso.com Cc:

Re: [pve-devel] vm_deviceunplug question

2014-11-25 Thread Dietmar Maurer
This is because for virtio disk we remove the controller + drive, (1controller - 1 drive) and for scsi we only remove the drive (1controller - 256 drives) I cannot see that: 3001 if ($deviceid =~ m/^(scsi)(\d+)$/) { 3002 return undef if !qemu_devicedel($vmid, $deviceid); 3003

[pve-devel] [PATCH v5 02/19] parse_vm_config: correctly handle $descr

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 96eb6ec..e020740 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1782,7 +1782,7 @@ sub

[pve-devel] [PATCH v5 04/19] write_vm_config : write pending change

2014-11-25 Thread Dietmar Maurer
example: $conf-{pending}-{virtio1} $conf-{pending}-{delete} = net0,net1 [PENDING] virtio1: ... delete: net0,net1 Signed-off-by: Alexandre Derumier aderum...@odiso.com Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 32 +--- 1 file

[pve-devel] [PATCH v5 03/19] parse_vm_config: only allow 'delete' inside [PENDING]

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index e020740..9b03e6a 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1792,22 +1792,24 @@

[pve-devel] [PATCH v5 00/19] qemu-server: implement pending changes

2014-11-25 Thread Dietmar Maurer
Based on Alexandres patches (sent to pve-devel list): qemu-server : implement pending changes v2 pending changes hotplug v2 Changes in v5: - implement network hotplug - cleanup error handling in vm_deviceunplug and vm_deviceplug - bug fixes Changes in v4: - implement API/CLI to get

[pve-devel] [PATCH v5 09/19] implement trivial hotplug

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 47 ++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 8524180..2a702d2 100644 --- a/PVE/QemuServer.pm +++

[pve-devel] [PATCH v5 01/19] parse_vm_config : parse pending changes

2014-11-25 Thread Dietmar Maurer
From: Alexandre Derumier aderum...@odiso.com example: [PENDING] virtio1:... delete:net0,net1 $conf-{pending}-{virtio1} $conf-{pending}-{del}-{net0} $conf-{pending}-{del}-{net1} Signed-off-by: Alexandre Derumier aderum...@odiso.com Signed-off-by: Dietmar Maurer diet...@proxmox.com ---

[pve-devel] [PATCH v5 08/19] fix balloon consistency check (consider pending changes)

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index d6a70c0..a8841c2 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -945,10 +945,9 @@ my $update_vm_api

[pve-devel] [PATCH v5 05/19] update_vm_api: always write into pending section

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 99 -- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 0787074..222c44f 100644 --- a/PVE/API2/Qemu.pm +++

[pve-devel] [PATCH v5 10/19] vmconfig_hotplug_pending: implement tablet hotplug

2014-11-25 Thread Dietmar Maurer
Remove special case: now, we only hotplug if 'hotplug' is enabled. Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 71 - 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/PVE/QemuServer.pm

[pve-devel] [PATCH v5 13/19] vmconfig_hotplug_pending: improve hotplug error handling

2014-11-25 Thread Dietmar Maurer
Simplify code, and allow to partially apply pending changes using a new $selection parameter. Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 12 - PVE/QemuServer.pm | 149 ++--- 2 files changed, 95 insertions(+),

[pve-devel] [PATCH v5 17/19] vmconfig_hotplug_pending : add update_net

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Alexandre Derumier aderum...@odiso.com Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 44 ++- PVE/QemuServer.pm | 67 - pve-bridge|8 +-- 3 files

[pve-devel] [PATCH v5 11/19] vmconfig_cleanup_pending: new method to clenup setting in [PENDING]

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm |8 +--- PVE/QemuServer.pm | 32 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index a8841c2..8c7c076 100644 ---

[pve-devel] [PATCH v5 06/19] implement vmconfig_apply_pending for stopped VM

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 191 ++ 1 file changed, 119 insertions(+), 72 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 222c44f..41d75d0 100644 --- a/PVE/API2/Qemu.pm +++

[pve-devel] [PATCH v5 14/19] implement API/CLI to get pending changes

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 86 +- qm | 27 + 2 files changed, 112 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index

[pve-devel] [PATCH v5 07/19] vm_start: apply pending changes

2014-11-25 Thread Dietmar Maurer
I move related helper methods into PVE::QemuServer. Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 111 - PVE/QemuServer.pm | 103 + 2 files changed, 111

[pve-devel] [PATCH v5 19/19] vm_deviceplug: always raise exception on error

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 92 - 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 14989f8..243d069 100644 --- a/PVE/QemuServer.pm +++

[pve-devel] [PATCH v5 18/19] vm_deviceunplug: raise expection if something fail

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 81 +++-- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index c568dfd..14989f8 100644 --- a/PVE/QemuServer.pm +++

[pve-devel] [PATCH v5 15/19] rename qemu_bridgeadd to qemu_add_pci_bridge

2014-11-25 Thread Dietmar Maurer
To make it obvious that we add a PCI device, and not a network bridge. Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 391376e..a8828be 100644

[pve-devel] [PATCH v5 16/19] vmconfig_hotplug_pending: correctly skip values

2014-11-25 Thread Dietmar Maurer
Do not use $skip variable (simply raise an exception) Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index a8828be..6642928 100644 ---

[pve-devel] [PATCH 2/2] now if the QMP command starts with guest-+ , it will bind dynamicly to the VMID.qga socket.

2014-11-25 Thread Wolfgang Link
Signed-off-by: Wolfgang Link wolfg...@linksystems.org --- PVE/QMPClient.pm | 54 + PVE/QemuServer.pm | 16 +--- 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/PVE/QMPClient.pm b/PVE/QMPClient.pm index

[pve-devel] [PATCH 1/2] This are the condensed changes form http://pve.proxmox.com/pipermail/pve-devel/2013-March/006913.html is added to see the orgin work!

2014-11-25 Thread Wolfgang Link
From: Alexandre Derumier aderum...@odiso.com This patch series add code to send command to quest guest agent. The procotol is qmp, so I have reuse as much as possible the current qmpclient the only big difference is that we can't pass an id to a request, so we must send a guest-sync command

Re: [pve-devel] vm_deviceunplug question

2014-11-25 Thread Alexandre DERUMIER
I cannot see that: 3001 if ($deviceid =~ m/^(scsi)(\d+)$/) { 3002 return undef if !qemu_devicedel($vmid, $deviceid); 3003 return undef if !qemu_drivedel($vmid, $deviceid); 3004 } so you also remove the device using qemu_devicedel()? What do I miss? for virtio: -device

Re: [pve-devel] vm_deviceunplug question

2014-11-25 Thread Dietmar Maurer
for scsi: -device virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5 -drive file=/var/lib/vz/images/115/vm-115-disk-34.raw,if=none,id=drive-scsi0 -device scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive- scsi0,id=scsi0 we remove scsi-hd device and drive. (this is not a pci

Re: [pve-devel] vm_deviceunplug question

2014-11-25 Thread Alexandre DERUMIER
Please can you also review the latest hotplug changes, especially the error handling? I think we get better error messages this way. Yes, I wanted to fix that since a long time, thanks. About network hotplug, I have exception if I try to change the bridge for example, and conf-{hotplug} = 0. I

Re: [pve-devel] vm_deviceunplug question

2014-11-25 Thread Dietmar Maurer
Yes, I wanted to fix that since a long time, thanks. OK About network hotplug, I have exception if I try to change the bridge for example, and conf-{hotplug} = 0. I think this is because be always call vm_deviceplug($storecfg, $conf, $vmid, $opt, $newnet); at the end of

[pve-devel] [PATCH v6 04/22] write_vm_config : write pending change

2014-11-25 Thread Dietmar Maurer
example: $conf-{pending}-{virtio1} $conf-{pending}-{delete} = net0,net1 [PENDING] virtio1: ... delete: net0,net1 Signed-off-by: Alexandre Derumier aderum...@odiso.com Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 32 +--- 1 file

[pve-devel] [PATCH v6 11/22] vmconfig_cleanup_pending: new method to clenup setting in [PENDING]

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm |8 +--- PVE/QemuServer.pm | 32 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index a8841c2..8c7c076 100644 ---

[pve-devel] [PATCH v6 02/22] parse_vm_config: correctly handle $descr

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 96eb6ec..e020740 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1782,7 +1782,7 @@ sub

[pve-devel] [PATCH v6 01/22] parse_vm_config : parse pending changes

2014-11-25 Thread Dietmar Maurer
From: Alexandre Derumier aderum...@odiso.com example: [PENDING] virtio1:... delete:net0,net1 $conf-{pending}-{virtio1} $conf-{pending}-{del}-{net0} $conf-{pending}-{del}-{net1} Signed-off-by: Alexandre Derumier aderum...@odiso.com Signed-off-by: Dietmar Maurer diet...@proxmox.com ---

[pve-devel] [PATCH v6 06/22] implement vmconfig_apply_pending for stopped VM

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 191 ++ 1 file changed, 119 insertions(+), 72 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 222c44f..41d75d0 100644 --- a/PVE/API2/Qemu.pm +++

[pve-devel] [PATCH v6 03/22] parse_vm_config: only allow 'delete' inside [PENDING]

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index e020740..9b03e6a 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1792,22 +1792,24 @@

[pve-devel] [PATCH v6 00/22] qemu-server: implement pending changes

2014-11-25 Thread Dietmar Maurer
Based on Alexandres patches (sent to pve-devel list): qemu-server : implement pending changes v2 pending changes hotplug v2 Changes in v6: - implement disk hotplug - vmconfig_update_net: do not call vm_deviceplug() if hotplug == 0 - remove unused code Changes in v5: - implement

[pve-devel] [PATCH v6 12/22] code cleanup, delete trailing white space

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 2644117..dd06f2f 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3480,7

[pve-devel] [PATCH v6 05/22] update_vm_api: always write into pending section

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 99 -- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 0787074..222c44f 100644 --- a/PVE/API2/Qemu.pm +++

[pve-devel] [PATCH v6 21/22] vmconfig_update_net: do not call vm_deviceplug() if hotplug == 0

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 4a44ac8..24c77ef 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3699,10 +3699,16 @@ sub

[pve-devel] [PATCH v6 20/22] vmconfig_hotplug_pending : add update_disk

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Alexandre Derumier aderum...@odiso.com Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 94 ++--- PVE/QemuServer.pm | 92 +++ 2 files changed, 94

[pve-devel] [PATCH v6 22/22] remove unused code

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 138 -- 1 file changed, 29 insertions(+), 109 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 064d7ad..3d1a7e7 100644 --- a/PVE/API2/Qemu.pm +++

[pve-devel] [PATCH v6 19/22] vm_deviceplug: always raise exception on error

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 92 - 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 14989f8..243d069 100644 --- a/PVE/QemuServer.pm +++

[pve-devel] [PATCH v6 13/22] vmconfig_hotplug_pending: improve hotplug error handling

2014-11-25 Thread Dietmar Maurer
Simplify code, and allow to partially apply pending changes using a new $selection parameter. Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 12 - PVE/QemuServer.pm | 149 ++--- 2 files changed, 95 insertions(+),

[pve-devel] [PATCH v6 09/22] implement trivial hotplug

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 47 ++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 8524180..2a702d2 100644 --- a/PVE/QemuServer.pm +++

[pve-devel] [PATCH v6 14/22] implement API/CLI to get pending changes

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 86 +- qm | 27 + 2 files changed, 112 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index

[pve-devel] [PATCH v6 15/22] rename qemu_bridgeadd to qemu_add_pci_bridge

2014-11-25 Thread Dietmar Maurer
To make it obvious that we add a PCI device, and not a network bridge. Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 391376e..a8828be 100644

[pve-devel] [PATCH v6 17/22] vmconfig_hotplug_pending : add update_net

2014-11-25 Thread Dietmar Maurer
Signed-off-by: Alexandre Derumier aderum...@odiso.com Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 44 ++- PVE/QemuServer.pm | 67 - pve-bridge|8 +-- 3 files

[pve-devel] [PATCH v6 16/22] vmconfig_hotplug_pending: correctly skip values

2014-11-25 Thread Dietmar Maurer
Do not use $skip variable (simply raise an exception) Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/QemuServer.pm | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index a8828be..6642928 100644 ---

[pve-devel] [PATCH v6 07/22] vm_start: apply pending changes

2014-11-25 Thread Dietmar Maurer
I move related helper methods into PVE::QemuServer. Signed-off-by: Dietmar Maurer diet...@proxmox.com --- PVE/API2/Qemu.pm | 111 - PVE/QemuServer.pm | 103 + 2 files changed, 111

[pve-devel] Qemu-Guest-Agent implementing problems

2014-11-25 Thread Wolfgang
Hi at all, I have some problems by implementing the qga. There are 4 commands (guest-shutdown, guest-suspend-disk, guest-suspend-ram, guest-suspend-hybrid) which does NOT return a response on success. How should i handle this. Have anyone an Idea? greetings

Re: [pve-devel] [PATCH v6 21/22] vmconfig_update_net: do not call vm_deviceplug() if hotplug == 0

2014-11-25 Thread Alexandre DERUMIER
Ok, It's working fine now - Mail original - De: Dietmar Maurer diet...@proxmox.com À: pve-devel@pve.proxmox.com Envoyé: Mardi 25 Novembre 2014 12:24:28 Objet: [pve-devel] [PATCH v6 21/22] vmconfig_update_net: do not call vm_deviceplug() if hotplug == 0 Signed-off-by: Dietmar

Re: [pve-devel] Qemu-Guest-Agent implementing problems

2014-11-25 Thread Dietmar Maurer
I guess we need to use the 'mux_eof' callback for that case. See 'man IO::Multiplex' for details. There are 4 commands (guest-shutdown, guest-suspend-disk, guest-suspend- ram, guest-suspend-hybrid) which does NOT return a response on success. How should i handle this. Have anyone an Idea?