[pve-devel] [PATCH manager] Update french translation

2017-12-20 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 po/fr.po | 369 ++-
 1 file changed, 153 insertions(+), 216 deletions(-)

diff --git a/po/fr.po b/po/fr.po
index 48e03045..b55a8f32 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: pve-manager 2.0\n"
 "Report-Msgid-Bugs-To: <supp...@proxmox.com>\n"
 "POT-Creation-Date: Tue Jul  4 09:33:07 2017\n"
-"PO-Revision-Date: 2016-04-07 13:14+0100\n"
+"PO-Revision-Date: 2017-12-20 12:26+0100\n"
 "Last-Translator: Emmanuel Kasper <e.kas...@proxmox.com>\n"
 "Language-Team: French\n"
 "Language: fr\n"
@@ -16,7 +16,7 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
-"X-Generator: Poedit 1.6.10\n"
+"X-Generator: Poedit 1.8.11\n"
 "X-Poedit-SourceCharset: UTF-8\n"
 "X-Poedit-KeywordsList: gettext\n"
 "X-Poedit-Basepath: ../www/manager\n"
@@ -30,7 +30,7 @@ msgstr "/chemin/repertoire/"
 
 #: ../www/manager6/lxc/ResourceEdit.js:491
 msgid "ACLs"
-msgstr ""
+msgstr "ACLs"
 
 #: ../www/manager6/qemu/Options.js:160 ../www/manager6/qemu/Options.js:165
 msgid "ACPI support"
@@ -76,7 +76,7 @@ msgstr "Adresse"
 #: ../www/manager6/grid/FirewallAliases.js:78 ../www/manager6/lxc/Config.js:234
 #: ../www/manager6/qemu/Config.js:265
 msgid "Alias"
-msgstr ""
+msgstr "Alias"
 
 #: ../www/manager6/dc/Backup.js:31 ../www/manager6/dc/Backup.js:118
 #: ../www/manager6/dc/Backup.js:323 ../www/manager6/storage/DirEdit.js:79
@@ -106,7 +106,7 @@ msgstr "Toujours"
 
 #: ../www/manager6/lxc/Options.js:56
 msgid "Architecture"
-msgstr ""
+msgstr "Architecture"
 
 #: ../www/manager6/StateProvider.js:183
 msgid "Are you sure you want to navigate away from this page?"
@@ -129,9 +129,8 @@ msgid "Are you sure you want to remove this entry"
 msgstr "Êtes vous certain de vouloir supprimer cet élément?"
 
 #: ../www/manager6/node/Disks.js:246
-#, fuzzy
 msgid "Attribute"
-msgstr "User Attribute Name"
+msgstr "Attribut"
 
 #: ../www/manager6/dc/Config.js:102
 msgid "Authentication"
@@ -171,7 +170,7 @@ msgstr "Sauvegarder maintenant"
 
 #: ../www/manager6/qemu/MemoryEdit.js:76
 msgid "Ballooning"
-msgstr ""
+msgstr "Ballooning"
 
 #: ../www/manager6/dc/AuthEdit.js:53
 msgid "Base Domain Name"
@@ -195,9 +194,8 @@ msgid "Block Size"
 msgstr "Taille des blocs"
 
 #: ../www/manager6/qemu/BootOrderEdit.js:159 ../www/manager6/qemu/Options.js:91
-#, fuzzy
 msgid "Boot Order"
-msgstr "Ordre de boot"
+msgstr "Ordre de démarrage"
 
 #: ../www/manager6/qemu/BootOrderEdit.js:119
 #: ../www/manager6/qemu/BootOrderEdit.js:128
@@ -207,9 +205,8 @@ msgstr "Périphérique de boot"
 
 #: ../www/manager6/panel/GuestStatusView.js:65
 #: ../www/manager6/panel/TemplateStatusView.js:43
-#, fuzzy
 msgid "Bootdisk size"
-msgstr "Taille du disque"
+msgstr "Taille du disque de démarrage"
 
 #: ../www/manager6/form/BridgeSelector.js:22 ../www/manager6/lxc/Network.js:129
 #: ../www/manager6/lxc/Network.js:492 ../www/manager6/qemu/NetworkEdit.js:68
@@ -226,32 +223,27 @@ msgid "Bridged mode"
 msgstr "Accès par pont"
 
 #: ../www/manager6/window/Settings.js:106
-#, fuzzy
 msgid "Browser Settings"
-msgstr "Paramètres"
+msgstr "Paramètres Navigateur Web"
 
 #: ../www/manager6/node/Config.js:35
-#, fuzzy
 msgid "Bulk Actions"
-msgstr "Action"
+msgstr "Actions de groupe"
 
 #: ../www/manager6/node/CmdMenu.js:64 ../www/manager6/node/CmdMenu.js:71
 #: ../www/manager6/node/Config.js:67 ../www/manager6/node/Config.js:72
-#, fuzzy
 msgid "Bulk Migrate"
-msgstr "Migration"
+msgstr "Migration en groupe"
 
 #: ../www/manager6/node/CmdMenu.js:34 ../www/manager6/node/CmdMenu.js:41
 #: ../www/manager6/node/Config.js:41 ../www/manager6/node/Config.js:46
-#, fuzzy
 msgid "Bulk Start"
-msgstr "Démarrer"
+msgstr "Démarrage en groupe"
 
 #: ../www/manager6/node/CmdMenu.js:49 ../www/manager6/node/CmdMenu.js:56
 #: ../www/manager6/node/Config.js:54 ../www/manager6/node/Config.js:59
-#, fuzzy
 msgid "Bulk Stop"
-msgstr "Stopper"
+msgstr "Arrêt en groupe"
 
 #: ../www/manager6/form/ControllerSelector.js:99
 msgid "Bus/Device"
@@ -304,12 +296,11 @@ msgstr "Utilisation CPU"
 
 #: ../www/manager6/Utils.js:1087 ../www/manager6/node/StatusView.js:89
 msgid

[pve-devel] [PATCH manager] Allow change of Datacenter wide default console without browser refresh

2017-12-19 Thread Emmanuel Kasper
The previous implementation was relying on PVE.VersionInfo.console,
which is set after login and never refreshed after that.

We execute the API call before setting the button handler, otherwise
the browser would fire its popup blocker

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/Utils.js|  4 ++--
 www/manager6/button/ConsoleButton.js | 25 -
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 578ba81e..1dc72260 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1180,9 +1180,9 @@ Ext.define('PVE.Utils', { utilities: {
}
 },
 
-defaultViewer: function(allowSpice) {
+defaultViewer: function(allowSpice, dcViewer) {
var vncdefault = 'html5';
-   var dv = PVE.VersionInfo.console || vncdefault;
+   var dv = dcViewer || vncdefault;
if (dv === 'vv' && !allowSpice) {
dv = vncdefault;
}
diff --git a/www/manager6/button/ConsoleButton.js 
b/www/manager6/button/ConsoleButton.js
index a3bf7464..f75a7d48 100644
--- a/www/manager6/button/ConsoleButton.js
+++ b/www/manager6/button/ConsoleButton.js
@@ -18,14 +18,10 @@ Ext.define('PVE.button.ConsoleButton', {
var me = this;
 
me.enableSpice = enable;
+   me.setButtonHandler();
me.down('#spicemenu').setDisabled(!enable);
 },
 
-handler: function() {
-   var me = this;
-   PVE.Utils.openDefaultConsoleWindow(me.enableSpice, me.consoleType, 
me.vmid,
-  me.nodename, me.consoleName);
-},
 
 menu: [
{
@@ -61,6 +57,24 @@ Ext.define('PVE.button.ConsoleButton', {
}
 ],
 
+setButtonHandler: function() {
+   var me = this;
+
+   PVE.Utils.API2Request({
+   url: '/api2/extjs/cluster/options',
+   method: 'GET',
+   success: function(response) {
+   var dcViewer = response.result.data.console;
+   var defViewer = PVE.Utils.defaultViewer(me.enableSpice, 
dcViewer);
+
+   me.setHandler(function() {
+   PVE.Utils.openConsoleWindow(defViewer, me.consoleType,
+   me.vmid, me.nodename, me.consoleName);
+   });
+   }
+   });
+},
+
 initComponent: function() {
 var me = this;
 
@@ -69,5 +83,6 @@ Ext.define('PVE.button.ConsoleButton', {
}
 
me.callParent();
+   me.setButtonHandler();
 }
 });
-- 
2.11.0


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


[pve-devel] [PATCH manager 2/4] Add new icon for xtermjs consoles, based on xtermjs logo

2017-12-19 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/images/Makefile|   4 
 www/images/xtermjs.png | Bin 0 -> 729 bytes
 2 files changed, 4 insertions(+)
 create mode 100644 www/images/xtermjs.png

diff --git a/www/images/Makefile b/www/images/Makefile
index c76d7aee..798132a7 100644
--- a/www/images/Makefile
+++ b/www/images/Makefile
@@ -22,6 +22,9 @@ all:
 # ceph logos are from
 #  http://ceph.com/logos/
 
+# xtermjs.png is a cropped version of the logo found on
+# https://github.com/xtermjs/xterm.js
+
 GNOME_IMAGES = \
checked.png \
unchecked.png   \
@@ -43,6 +46,7 @@ IMAGES = ${GNOME_IMAGES}  \
virt-viewer.png \
tigervnc.png\
novnc.png   \
+   xtermjs.png \
favicon.ico \
snapshot.png\
computer-on.png \
diff --git a/www/images/xtermjs.png b/www/images/xtermjs.png
new file mode 100644
index 
..b999d36d3c40a2805b90f8939cb3d4cd3585eb55
GIT binary patch
literal 729
zcmV;~0w(>5P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV6VoOIv0RI60
z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru;S3TF7!bPL-;w|T0%l1>
zK~y-)U6V~n6;T+5pPB1lQlgf3h=jmR<@}_f$fcknh=^JU3Bhn7P{9ZiArW-Zs;os2
z1Z|313{z<tM41#VQVOvmYkstaL{>(3vIq;sd%1U7c;;drIGi)z`JTg^_x(OeH?(G;
zoRzWQI^Ga~ZfLlUN7DAOOcj8n?Uw=jfGUyyMbZuJ5HKPFS>TN8c$Wd{8k>0cdLn{L
zfezr3$o##)4EZqbTv8z+pfJ_9{yJZIB9PzJHsG-~!+%a9zOjK)+?GRtz9W1+Nq(
zt^kcdA#hMp;=@5I_|f_(kh05*3E(bJ3@ifIEK@xPAnS%EE~OKACiYdp;P#p=mAOp1
z8n^*$5KnwynQAvc>%#y!qFu+!0LOt3B2-(rzWnx5>f<IPxm3i)fKvd?7l)YW+mEzb
zak1Y4JO|=H2Dn+*GjIn<x<DAVS*Gf?KUrYBI{~cl5tv_fLp!1yS}5jU-Ox^kVHgRD
zW~g~iUi$|?OvH2Ids!|j+1NWzWzzO#%T%fF8T|i(H6sDs5@$

[pve-devel] [PATCH manager 4/4] Set Console Button icon style at definition time

2017-12-19 Thread Emmanuel Kasper
This will allow the 'Upgrade' button to get an icon too.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/button/ConsoleButton.js | 2 ++
 www/manager6/lxc/Config.js   | 3 +--
 www/manager6/node/Config.js  | 3 +--
 www/manager6/qemu/Config.js  | 3 +--
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/www/manager6/button/ConsoleButton.js 
b/www/manager6/button/ConsoleButton.js
index 635504f2..c5bb8276 100644
--- a/www/manager6/button/ConsoleButton.js
+++ b/www/manager6/button/ConsoleButton.js
@@ -6,6 +6,8 @@ Ext.define('PVE.button.ConsoleButton', {
 
 consoleName: undefined,
 
+iconCls: 'fa fa-terminal',
+
 enableSpice: true,
 
 nodename: undefined,
diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index bcff47ba..56dcb944 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -128,8 +128,7 @@ Ext.define('PVE.lxc.Config', {
consoleType: 'lxc',
consoleName: vm.name,
nodename: nodename,
-   vmid: vmid,
-   iconCls: 'fa fa-terminal'
+   vmid: vmid
});
 
Ext.apply(me, {
diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js
index 4d6b51ef..1b1cc801 100644
--- a/www/manager6/node/Config.js
+++ b/www/manager6/node/Config.js
@@ -106,8 +106,7 @@ Ext.define('PVE.node.Config', {
disabled: !caps.nodes['Sys.Console'],
text: gettext('Shell'),
consoleType: 'shell',
-   nodename: nodename,
-   iconCls: 'fa fa-terminal'
+   nodename: nodename
});
 
me.items = [];
diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index db0f3152..68d5a268 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -172,8 +172,7 @@ Ext.define('PVE.qemu.Config', {
consoleType: 'kvm',
consoleName: vm.name,
nodename: nodename,
-   vmid: vmid,
-   iconCls: 'fa fa-terminal'
+   vmid: vmid
});
 
Ext.apply(me, {
-- 
2.11.0


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


[pve-devel] [PATCH manager 3/4] Use the new xterm.js icon with the corresponding Menu Item

2017-12-19 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/css/ext6-pve.css | 6 ++
 www/manager6/button/ConsoleButton.js | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/www/css/ext6-pve.css b/www/css/ext6-pve.css
index c8fabd6f..2c6de752 100644
--- a/www/css/ext6-pve.css
+++ b/www/css/ext6-pve.css
@@ -201,6 +201,7 @@
 .pve-itype-icon-virt-viewer,
 .pve-itype-icon-tigervnc,
 .pve-itype-icon-novnc,
+.pve-itype-icon-xtermjs,
 .pve-itype-icon-display,
 .pve-itype-icon-memory,
 .pve-itype-icon-processor,
@@ -324,6 +325,11 @@
 background-image:url(../images/virt-viewer.png);
 }
 
+.pve-itype-icon-xtermjs
+{
+background-image:url(../images/xtermjs.png);
+}
+
 .pve-itype-icon-usb
 {
 background-image:url(../images/icon-usb.png);
diff --git a/www/manager6/button/ConsoleButton.js 
b/www/manager6/button/ConsoleButton.js
index 1392c555..635504f2 100644
--- a/www/manager6/button/ConsoleButton.js
+++ b/www/manager6/button/ConsoleButton.js
@@ -52,7 +52,7 @@ Ext.define('PVE.button.ConsoleButton', {
{
text: 'xterm.js',
itemId: 'xtermjs',
-   iconCls: 'fa fa-terminal',
+   iconCls: 'pve-itype-icon-xtermjs',
type: 'xtermjs',
handler: function(button) {
var me = this.up('button');
-- 
2.11.0


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


[pve-devel] [PATCH manager 1/4] jslint: remove trailing comma after last objects property

2017-12-19 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/button/ConsoleButton.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/www/manager6/button/ConsoleButton.js 
b/www/manager6/button/ConsoleButton.js
index a3bf7464..1392c555 100644
--- a/www/manager6/button/ConsoleButton.js
+++ b/www/manager6/button/ConsoleButton.js
@@ -36,7 +36,7 @@ Ext.define('PVE.button.ConsoleButton', {
handler: function(button) {
var me = this.up('button');
PVE.Utils.openConsoleWindow(button.type, me.consoleType, 
me.vmid, me.nodename, me.consoleName);
-   },
+   }
},
{
xterm: 'menuitem',
@@ -47,7 +47,7 @@ Ext.define('PVE.button.ConsoleButton', {
handler: function(button) {
var me = this.up('button');
PVE.Utils.openConsoleWindow(button.type, me.consoleType, 
me.vmid, me.nodename, me.consoleName);
-   },
+   }
},
{
text: 'xterm.js',
@@ -57,7 +57,7 @@ Ext.define('PVE.button.ConsoleButton', {
handler: function(button) {
var me = this.up('button');
PVE.Utils.openConsoleWindow(button.type, me.consoleType, 
me.vmid, me.nodename, me.consoleName);
-   },
+   }
}
 ],
 
-- 
2.11.0


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


[pve-devel] [PATCH manager 2/2] Set ZFS over ISCSI window to proper title

2017-12-18 Thread Emmanuel Kasper
This will now Display 'ZFS over iSCSI'.
This was reported by users during a Proxmox Training.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
NB: Strings returned by format_storage_type() are not gettext'ed.
This is fine, as nobody should try to translate 'LVM-thin' or 'ZFS over ISCSI'
in a foreign language.

 www/manager6/storage/ZFSEdit.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/storage/ZFSEdit.js b/www/manager6/storage/ZFSEdit.js
index 22f24cb2..5ffb695f 100644
--- a/www/manager6/storage/ZFSEdit.js
+++ b/www/manager6/storage/ZFSEdit.js
@@ -145,7 +145,7 @@ Ext.define('PVE.storage.ZFSEdit', {
});
 
Ext.apply(me, {
-   subject: 'ZFS Storage',
+   subject: PVE.Utils.format_storage_type('zfs'),
isAdd: true,
items: [ ipanel ]
});
-- 
2.11.0


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


[pve-devel] [PATCH manager 1/2] Fix Indentation to use Proxmox style

2017-12-18 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/storage/ZFSEdit.js | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/www/manager6/storage/ZFSEdit.js b/www/manager6/storage/ZFSEdit.js
index bc9d8baf..22f24cb2 100644
--- a/www/manager6/storage/ZFSEdit.js
+++ b/www/manager6/storage/ZFSEdit.js
@@ -132,12 +132,12 @@ Ext.define('PVE.storage.ZFSEdit', {
me.isCreate = !me.storageId;
 
if (me.isCreate) {
-me.url = '/api2/extjs/storage';
-me.method = 'POST';
-} else {
-me.url = '/api2/extjs/storage/' + me.storageId;
-me.method = 'PUT';
-}
+   me.url = '/api2/extjs/storage';
+   me.method = 'POST';
+   } else {
+   me.url = '/api2/extjs/storage/' + me.storageId;
+   me.method = 'PUT';
+   }
 
var ipanel = Ext.create('PVE.storage.ZFSInputPanel', {
isCreate: me.isCreate,
@@ -145,25 +145,25 @@ Ext.define('PVE.storage.ZFSEdit', {
});
 
Ext.apply(me, {
-subject: 'ZFS Storage',
+   subject: 'ZFS Storage',
isAdd: true,
items: [ ipanel ]
});
 
me.callParent();
 
-if (!me.isCreate) {
-me.load({
-success:  function(response, options) {
-var values = response.result.data;
-if (values.nodes) {
-values.nodes = values.nodes.split(',');
-}
-values.enable = values.disable ? 0 : 1;
+   if (!me.isCreate) {
+   me.load({
+   success:  function(response, options) {
+   var values = response.result.data;
+   if (values.nodes) {
+   values.nodes = values.nodes.split(',');
+   }
+   values.enable = values.disable ? 0 : 1;
values.writecache = values.nowritecache ? 0 : 1;
-ipanel.setValues(values);
-}
-});
-}
+   ipanel.setValues(values);
+   }
+   });
+   }
 }
 });
-- 
2.11.0


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


Re: [pve-devel] PVE Minimal Debian Appliance

2017-12-18 Thread Emmanuel Kasper
On 12/18/2017 12:09 AM, c.mo...@web.de wrote:
> Hello!
> 
> Can you consider to provide a PVE Minimal Debian Appliance considering
> things like
> "Removing Packages for dealing with hardware. This is not usually done
> within a container" und "Removing Packages for interactive use."

BTW, the Bitname Makefile you refer provides a tarball for running
Docker Containers, not LXC containers.

See
https://forum.proxmox.com/threads/docker-support-in-proxmox.27474/page-5#post-188828
for the relation between these.

Concerning the Debian tarballs we distribute, the only hardware related
stuff we ship is hwclock, which comes from the package util-linux, which
is mandatory for any Debian based system.

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


Re: [pve-devel] [PATCH docs v2 2/3] Update path to Backup.txt in new git repo

2017-12-13 Thread Emmanuel Kasper
Any feedback on this and serie ? I clicked again on that old link while
doing a PVE training ...

On 11/21/2017 04:58 PM, Emmanuel Kasper wrote:
> Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
> ---
>  vzdump.adoc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/vzdump.adoc b/vzdump.adoc
> index f21a75f..babf407 100644
> --- a/vzdump.adoc
> +++ b/vzdump.adoc
> @@ -85,7 +85,7 @@ consistency.
>  
>  A technical overview of the Proxmox VE live backup for QemuServer can
>  be found online
> -https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt[here].
> +https://git.proxmox.com/?p=pve-qemu.git;a=blob_plain;f=backup.txt[here].
>  
>  NOTE: Proxmox VE live backup provides snapshot-like semantics on any
>  storage type. It does not require that the underlying storage supports
> 

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


[pve-devel] [PATCH pve-container 2/2] Return proper error message when CT is not running for pct exec

2017-12-13 Thread Emmanuel Kasper
instead of the uglier
lx-attach: : attach.c: lxc_attach: 794 Failed to attach and multiple tabs

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 src/PVE/CLI/pct.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index 1818551..d44ed6c 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -191,6 +191,9 @@ __PACKAGE__->register_method ({
# test if container exists on this node
PVE::LXC::Config->load_config($vmid);
 
+   die "Error: container '$vmid' not running!\n"
+   if !PVE::LXC::check_running($vmid);
+
exec('lxc-attach', '-n', $param->{vmid}, '--', @args);
 }});
 
-- 
2.11.0


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


[pve-devel] [PATCH pve-container 1/2] Test for arguments at beginning of 'pct exec'

2017-12-13 Thread Emmanuel Kasper
Also derefence the given parameters once, for readability

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 src/PVE/CLI/pct.pm | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
index 05fcb29..1818551 100755
--- a/src/PVE/CLI/pct.pm
+++ b/src/PVE/CLI/pct.pm
@@ -184,13 +184,14 @@ __PACKAGE__->register_method ({
 code => sub {
my ($param) = @_;
 
+   my $vmid = $param->{vmid};
+   my @args = @{$param->{'extra-args'}};
+   die "missing command" if !@args;
+
# test if container exists on this node
-   PVE::LXC::Config->load_config($param->{vmid});
+   PVE::LXC::Config->load_config($vmid);
 
-   if (!@{$param->{'extra-args'}}) {
-   die "missing command";
-   }
-   exec('lxc-attach', '-n', $param->{vmid}, '--', 
@{$param->{'extra-args'}});
+   exec('lxc-attach', '-n', $param->{vmid}, '--', @args);
 }});
 
 __PACKAGE__->register_method ({
-- 
2.11.0


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


Re: [pve-devel] [PATCH qemu-server] Use schema default values as default values

2017-12-12 Thread Emmanuel Kasper
On 11/20/2017 02:38 PM, Fabian Grünbichler wrote:
> On Wed, Nov 15, 2017 at 11:58:29AM +0100, Emmanuel Kasper wrote:
>> Any feedback on this ?
> 
> there already is a "load_defaults" in QemuServer.pm, I'd re-use that.
> what about options with default values besides those four?

I have only those four occurences where defaults where redefined in the
vmstatus() sub.
I sent a new version of the patch using load_defaults()

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


[pve-devel] [PATCH qemu-server v3] Use default values from load_defaults() when none is specified in conf

2017-12-12 Thread Emmanuel Kasper
This also fixes a bug where VMs with no memory defined in the config
where reported as using 0MB instead of 512.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
changes since V1:
 use load_defaults() instead of $confdesc for consistency with the 
 rest of the codebase

 PVE/QemuServer.pm | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 1d1ae29..42c412a 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2591,6 +2591,8 @@ sub vmstatus {
 my $storecfg = PVE::Storage::config();
 
 my $list = vzlist();
+my $defaults = load_defaults();
+
 my ($uptime) = PVE::ProcFSTools::read_proc_uptime(1);
 
 my $cpucount = $cpuinfo->{cpus} || 1;
@@ -2616,16 +2618,19 @@ sub vmstatus {
$d->{maxdisk} = 0;
}
 
-   $d->{cpus} = ($conf->{sockets} || 1) * ($conf->{cores} || 1);
+   $d->{cpus} = ($conf->{sockets} || $defaults->{sockets})
+   * ($conf->{cores} || $defaults->{cores});
$d->{cpus} = $cpucount if $d->{cpus} > $cpucount;
$d->{cpus} = $conf->{vcpus} if $conf->{vcpus};
 
$d->{name} = $conf->{name} || "VM $vmid";
-   $d->{maxmem} = $conf->{memory} ? $conf->{memory}*(1024*1024) : 0;
+   $d->{maxmem} = $conf->{memory} ? $conf->{memory}*(1024*1024)
+   : $defaults->{memory}*(1024*1024);
 
if ($conf->{balloon}) {
$d->{balloon_min} = $conf->{balloon}*(1024*1024);
-   $d->{shares} = defined($conf->{shares}) ? $conf->{shares} : 1000;
+   $d->{shares} = defined($conf->{shares}) ? $conf->{shares}
+   : $defaults->{shares};
}
 
$d->{uptime} = 0;
-- 
2.11.0


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


[pve-devel] [RFC PATCH] Explain that concurrent modifications of the VM config are the error cause

2017-12-11 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
While doing PVE trainings last week, I noticed that this error message
was not clear to most people when it popped up on the GUI.

Reusing here the wording that apt uses when called multiple times
( Unable to lock the administration directory (/var/lib/dpkg/), 
is another process using it?) 

Is is worth to return the PID of the process holding the flock ? 

 src/PVE/Tools.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 6d579d8..9bce28f 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -196,7 +196,7 @@ sub lock_file_full {
weaken $lockhash->{$filename};
$local_fh = eval { run_with_timeout($timeout, $get_locked_file) };
if ($@) {
-   $@ = "can't lock file '$filename' - $@";
+   $@ = "can't lock file '$filename', is another process using it ? - 
$@";
return undef;
}
$check = 1;
-- 
2.11.0


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


[pve-devel] [PATCH manager v3 1/3] Fix JSLint type confusion warnings

2017-12-01 Thread Emmanuel Kasper
The type confusion warnings arose from string and integer concatenation,
and object properties of the name which were alternatively set with
strings and integers.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 29 ++---
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index cbec59d2..43337c36 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -1,5 +1,3 @@
-// fixme: howto avoid jslint type confusion?
-/*jslint confusion: true */
 Ext.define('PVE.qemu.HardwareView', {
 extend: 'PVE.grid.PendingObjectGrid',
 alias: ['widget.PVE.qemu.HardwareView'],
@@ -47,7 +45,7 @@ Ext.define('PVE.qemu.HardwareView', {
header: gettext('Memory'),
editor: caps.vms['VM.Config.Memory'] ? 'PVE.qemu.MemoryEdit' : 
undefined,
never_delete: true,
-   defaultValue: 512,
+   defaultValue: '512',
tdCls: 'pve-itype-icon-memory',
renderer: function(value, metaData, record) {
var balloon =  me.getObjectValue('balloon');
@@ -65,7 +63,7 @@ Ext.define('PVE.qemu.HardwareView', {
editor: (caps.vms['VM.Config.CPU'] || 
caps.vms['VM.Config.HWType']) ? 
'PVE.qemu.ProcessorEdit' : undefined,
tdCls: 'pve-itype-icon-processor',
-   defaultValue: 1,
+   defaultValue: '1',
multiKey: ['sockets', 'cpu', 'cores', 'numa', 'vcpus', 
'cpulimit', 'cpuunits'],
renderer: function(value, metaData, record, rowIndex, colIndex, 
store, pending) {
 
@@ -77,8 +75,9 @@ Ext.define('PVE.qemu.HardwareView', {
var cpulimit = me.getObjectValue('cpulimit', undefined, 
pending);
var cpuunits = me.getObjectValue('cpuunits', undefined, 
pending);
 
-   var res = (sockets*cores) + ' (' + sockets + ' sockets, ' + 
cores + ' cores)';
-   
+   var res = Ext.String.format('{0} ({1} sockets, {2} cores)',
+   sockets*cores, sockets, cores);
+
if (model) {
res += ' [' + model + ']';
}
@@ -149,7 +148,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
 
for (i = 0; i < 4; i++) {
-   confid = "ide" + i;
+   confid = "ide" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -160,7 +159,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 6; i++) {
-   confid = "sata" + i;
+   confid = "sata" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -171,7 +170,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 16; i++) {
-   confid = "scsi" + i;
+   confid = "scsi" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -182,7 +181,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 16; i++) {
-   confid = "virtio" + i;
+   confid = "virtio" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -193,7 +192,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 32; i++) {
-   confid = "net" + i;
+   confid = "net" + i.toString();
rows[confid] = {
group: 2,
tdCls: 'pve-itype-icon-network',
@@ -210,7 +209,7 @@ Ext.define('PVE.qemu.HardwareView', {
header: gettext('EFI Disk')
};
for (i = 0; i < 5; i++) {
-   confid = "usb" + i;
+   confid = "usb" + i.toString();
rows[confid] = {
group: 4,
tdCls: 'pve-itype-icon-usb',
@@ -220,7 +219,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 4; i++) {
-   confid = "hostpci" + i;
+   confid = "hostpci" + i.toString();
rows[confid] = {
group: 5,
tdCls: 'pve-itype-icon-pci',
@@ -229,11 +228,11 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 8; i++) {
-   rows["unused" + i] = {
+   rows["unused" + i.toString()] = {
group: 6,
tdCls: 'pve-itype-icon-storage',
editor: caps.vms['VM.Config.Disk'] ? 'PVE

[pve-devel] [PATCH manager v3 0/3] Introduce Detach Button for used disks

2017-12-01 Thread Emmanuel Kasper
change since V1:
 * do not call gettext twice on the same string
 * use 'render' event instead of 'boxready' when computing an optimal box size

changes since V2:
 * call gettext straight away on strings, since we need this to have
 the po files correctly generated
 * do no save the optimal size as a button property

Emmanuel Kasper (3):
  Fix JSLint type confusion warnings
  Fix #1526:  Use 'detach' instead of 'remove' when the disk is used
  Add a proper confirmation message when we detach an used disk

 www/manager6/qemu/HardwareView.js | 70 ++-
 1 file changed, 47 insertions(+), 23 deletions(-)

-- 
2.11.0


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


[pve-devel] [PATCH manager v3 2/3] Fix #1526: Use 'detach' instead of 'remove' when the disk is used

2017-12-01 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 28 +++-
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index 43337c36..bc22cc98 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -396,6 +396,8 @@ Ext.define('PVE.qemu.HardwareView', {
 
var remove_btn = new PVE.button.Button({
text: gettext('Remove'),
+   defaultText: gettext('Remove'),
+   altText: gettext('Detach'),
selModel: sm,
disabled: true,
dangerous: true,
@@ -423,6 +425,22 @@ Ext.define('PVE.qemu.HardwareView', {
Ext.Msg.alert('Error', response.htmlStatus);
}
});
+   },
+   listeners: {
+   render: function(btn) {
+   // hack: calculate an optimal button width on first display
+   // to prevent the whole toolbar to move when we switch
+   // between the "Remove" and "Detach" labels
+   var def = btn.getSize().width;
+
+   btn.setText(btn.altText);
+   var alt = btn.getSize().width;
+
+   btn.setText(btn.defaultText);
+
+   var optimal = alt > def ? alt : def;
+   btn.setSize({ width: optimal });
+   }
}
});
 
@@ -504,22 +522,22 @@ Ext.define('PVE.qemu.HardwareView', {
var rowdef = rows[key];
 
var pending = rec.data['delete'] || me.hasPendingChanges(key);
-   var isDisk = !key.match(/^unused\d+/) &&
+   var isUsedDisk = !key.match(/^unused\d+/) &&
rowdef.tdCls == 'pve-itype-icon-storage' &&
(value && !value.match(/media=cdrom/));
 
var isEfi = (key === 'efidisk0');
 
-
remove_btn.setDisabled(rec.data['delete'] || (rowdef.never_delete 
=== true));
+   remove_btn.setText(isUsedDisk ? remove_btn.altText : 
remove_btn.defaultText);
 
edit_btn.setDisabled(rec.data['delete'] || !rowdef.editor);
 
-   resize_btn.setDisabled(pending || !isDisk);
+   resize_btn.setDisabled(pending || !isUsedDisk);
 
-   move_btn.setDisabled(pending || !isDisk);
+   move_btn.setDisabled(pending || !isUsedDisk);
 
-   diskthrottle_btn.setDisabled(pending || !isDisk || isEfi);
+   diskthrottle_btn.setDisabled(pending || !isUsedDisk || isEfi);
 
revert_btn.setDisabled(!pending);
 
-- 
2.11.0


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


[pve-devel] [PATCH manager v3 3/3] Add a proper confirmation message when we detach an used disk

2017-12-01 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index bc22cc98..112410c2 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -402,9 +402,16 @@ Ext.define('PVE.qemu.HardwareView', {
disabled: true,
dangerous: true,
confirmMsg: function(rec) {
-   var msg = Ext.String.format(gettext('Are you sure you want to 
remove entry {0}'),
-   "'" + me.renderKey(rec.data.key, 
{}, rec) + "'");
-   if (rec.data.key.match(/^unused\d+$/)) {
+   var warn = gettext('Are you sure you want to remove entry {0}');
+   if (this.text === this.altText) {
+   warn = gettext('Are you sure you want to detach entry {0}');
+   }
+
+   var entry = rec.data.key;
+   var msg = Ext.String.format(warn, "'"
+   + me.renderKey(entry, {}, rec) + "'");
+
+   if (entry.match(/^unused\d+$/)) {
msg += " " + gettext('This will permanently erase all 
data.');
}
 
-- 
2.11.0


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


Re: [pve-devel] XenServer to Proxmox in a single step

2017-11-28 Thread Emmanuel Kasper
On 11/23/2017 02:22 PM, Gandalf Corvotempesta wrote:
> Here you are:
> 
> https://pastebin.com/raw/4E6rTuqe

For discoverability I would advise you to post this too on one of the
free git hosting services.


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


[pve-devel] [PATCH manager] Add each host SSL fingerprint to each node status

2017-11-22 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 PVE/API2/Nodes.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index b7210d4d..15437dc9 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -1746,6 +1746,7 @@ __PACKAGE__->register_method ({
 
foreach my $node (@$nodelist) {
my $entry = PVE::API2Tools::extract_node_stats($node, $members, 
$rrd);
+   $entry->{ssl_fingerprint} = 
PVE::Cluster::get_node_fingerprint($node);
push @$res, $entry;
}
 
-- 
2.11.0


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


[pve-devel] [PATCH cluster 0/2] Prepare SSL finger information via API call

2017-11-22 Thread Emmanuel Kasper
The two following patches + third patch for pve-manager makes the ssl
fingerprint of each host available via the /nodes API call.

Use cases
 * on the short term add an easy way to provide the cached_fingerprints
 parameter of the pve-apiclient. Other API provides could use that too
 instead of simply disabling SSL host verification when addressing hosts
 with self signed certificates
 * on the long term, provide the info necessary to build a cluster
 using only API calls


Emmanuel Kasper (2):
  Refactor host fingerprint calculation in two extra subs
  Add utility method to get a SSL finger print from a nodename

 data/PVE/Cluster.pm | 57 ++---
 1 file changed, 46 insertions(+), 11 deletions(-)

-- 
2.11.0


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


[pve-devel] [PATCH cluster 1/2] Refactor host fingerprint calculation in two extra subs

2017-11-22 Thread Emmanuel Kasper
This will be used later for feeding an extra API call

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 data/PVE/Cluster.pm | 51 ---
 1 file changed, 40 insertions(+), 11 deletions(-)

diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm
index fef5842..5d69f0c 100644
--- a/data/PVE/Cluster.pm
+++ b/data/PVE/Cluster.pm
@@ -1443,6 +1443,42 @@ cfs_register_file('datacenter.cfg',
  \_datacenter_config,
  \_datacenter_config);
 
+sub get_node_ssl_cert {
+my ($node) = @_;
+
+my $cert_path = "/etc/pve/nodes/$node/pve-ssl.pem";
+my $custom_cert_path = "/etc/pve/nodes/$node/pveproxy-ssl.pem";
+
+my $cert;
+
+eval {
+   my $bio = Net::SSLeay::BIO_new_file($cert_path, 'r');
+   $cert = Net::SSLeay::PEM_read_bio_X509($bio);
+   Net::SSLeay::BIO_free($bio);
+};
+
+my $err = $@;
+
+if ($err || !defined($cert)) {
+   die "unable to read host SSL cert at $cert_path $err\n";
+}
+return $cert;
+}
+
+sub get_cert_fingerprint {
+my ($cert) = @_;
+my $fingerprint;
+eval {
+   $fingerprint = Net::SSLeay::X509_get_fingerprint($cert, 'sha256');
+};
+
+my $err = $@;
+if ($err || !defined($fingerprint) || $fingerprint eq '') {
+   die "unable to fingerprint the SSL cert $err\n";
+}
+return $fingerprint;
+}
+
 # X509 Certificate cache helper
 
 my $cert_cache_nodes = {};
@@ -1470,29 +1506,22 @@ sub update_cert_cache {
}
};
 
-   my $cert_path = "/etc/pve/nodes/$node/pve-ssl.pem";
-   my $custom_cert_path = "/etc/pve/nodes/$node/pveproxy-ssl.pem";
-
-   $cert_path = $custom_cert_path if -f $custom_cert_path;
-
my $cert;
eval {
-   my $bio = Net::SSLeay::BIO_new_file($cert_path, 'r');
-   $cert = Net::SSLeay::PEM_read_bio_X509($bio);
-   Net::SSLeay::BIO_free($bio);
+   $cert = get_node_ssl_cert($node);
};
my $err = $@;
-   if ($err || !defined($cert)) {
+   if ($err) {
&$clear_old() if $clear;
next;
}
 
my $fp;
eval {
-   $fp = Net::SSLeay::X509_get_fingerprint($cert, 'sha256');
+   $fp = get_cert_fingerprint($cert);
};
$err = $@;
-   if ($err || !defined($fp) || $fp eq '') {
+   if ($err) {
&$clear_old() if $clear;
next;
}
-- 
2.11.0


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


[pve-devel] [PATCH cluster 2/2] Add utility method to get a SSL finger print from a nodename

2017-11-22 Thread Emmanuel Kasper
This will be used to feed an extra field for an API call

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 data/PVE/Cluster.pm | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm
index 5d69f0c..051e815 100644
--- a/data/PVE/Cluster.pm
+++ b/data/PVE/Cluster.pm
@@ -1479,6 +1479,12 @@ sub get_cert_fingerprint {
 return $fingerprint;
 }
 
+sub get_node_fingerprint {
+my ($node) = @_;
+my $cert = get_node_ssl_cert($node);
+return get_cert_fingerprint($cert);
+}
+
 # X509 Certificate cache helper
 
 my $cert_cache_nodes = {};
-- 
2.11.0


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


[pve-devel] [PATCH docs v2 1/3] Fix vzdump backup stop mode description

2017-11-21 Thread Emmanuel Kasper
The VM goes to normal operation after the backup is started, not at end of
backup.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 vzdump.adoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vzdump.adoc b/vzdump.adoc
index 7643ec6..f21a75f 100644
--- a/vzdump.adoc
+++ b/vzdump.adoc
@@ -64,8 +64,8 @@ depending on the guest type.
 This mode provides the highest consistency of the backup, at the cost
 of a downtime in the VM operation.  It works by executing an orderly
 shutdown of the VM, and then runs a background Qemu process to backup
-the VM data. After the backup is complete, the Qemu process resumes
-the VM to full operation mode if it was previously running.
+the VM data. After the backup is started, the VM goes to full
+operation mode if it was previously running.
 
 `suspend` mode::
 
-- 
2.11.0


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


[pve-devel] [PATCH docs v2 2/3] Update path to Backup.txt in new git repo

2017-11-21 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 vzdump.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vzdump.adoc b/vzdump.adoc
index f21a75f..babf407 100644
--- a/vzdump.adoc
+++ b/vzdump.adoc
@@ -85,7 +85,7 @@ consistency.
 
 A technical overview of the Proxmox VE live backup for QemuServer can
 be found online
-https://git.proxmox.com/?p=pve-qemu-kvm.git;a=blob;f=backup.txt[here].
+https://git.proxmox.com/?p=pve-qemu.git;a=blob_plain;f=backup.txt[here].
 
 NOTE: Proxmox VE live backup provides snapshot-like semantics on any
 storage type. It does not require that the underlying storage supports
-- 
2.11.0


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


[pve-devel] [PATCH docs v2 3/3] Explain why shut down VMs appear as running when backed up

2017-11-21 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 vzdump.adoc | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/vzdump.adoc b/vzdump.adoc
index babf407..da8ea19 100644
--- a/vzdump.adoc
+++ b/vzdump.adoc
@@ -89,7 +89,10 @@ 
https://git.proxmox.com/?p=pve-qemu.git;a=blob_plain;f=backup.txt[here].
 
 NOTE: Proxmox VE live backup provides snapshot-like semantics on any
 storage type. It does not require that the underlying storage supports
-snapshots.
+snapshots. Also please note that since the backups are done via 
+a background Qemu process, a stopped VM will appear as running for a 
+short amount of time while the VM disks are being read by Qemu.
+However the VM itself is not booted, only its disk(s) are read.
 
 .Backup modes for Containers:
 
-- 
2.11.0


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


Re: [pve-devel] [PATCH docs] Fix vzdump backup stop mode description

2017-11-21 Thread Emmanuel Kasper
On 11/21/2017 12:26 PM, Dietmar Maurer wrote:
> IMHO it is still not clear that this provides snapshot semantics ...
> (snapshot of the stopped VM).
Actually, a note a bit below the backup modes actually mention that :)
But we were still missing an explanation on the VM apparently running
when a stopped backup VM is being backup, so I will add that in a v2.



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


[pve-devel] [PATCH docs] Fix vzdump backup stop mode description

2017-11-21 Thread Emmanuel Kasper
The VM goes to normal operation after the backup is started, not at end of
backup.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 vzdump.adoc | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/vzdump.adoc b/vzdump.adoc
index 7643ec6..d354732 100644
--- a/vzdump.adoc
+++ b/vzdump.adoc
@@ -64,8 +64,11 @@ depending on the guest type.
 This mode provides the highest consistency of the backup, at the cost
 of a downtime in the VM operation.  It works by executing an orderly
 shutdown of the VM, and then runs a background Qemu process to backup
-the VM data. After the backup is complete, the Qemu process resumes
-the VM to full operation mode if it was previously running.
+the VM data. After the backup is started, the VM goes to full
+operation mode if it was previously running. +
+By starting the backup background process when the VM is shut down, we
+make sure that no pending writes are contained in the VM page cache when we
+start the backup, thus ensuring consistency of the backup data.
 
 `suspend` mode::
 
-- 
2.11.0


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


Re: [pve-devel] [PATCH qemu-server] Use schema default values as default values

2017-11-15 Thread Emmanuel Kasper
Any feedback on this ?

On 10/23/2017 10:45 AM, Emmanuel Kasper wrote:
> This fix a bug where VMs where the memory parameter was not
> set where reported as having 0MB instead of 512 via `qm list`
> 
> Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
> ---
>  PVE/QemuServer.pm | 14 +++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 2b6fda9..6706e75 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2576,6 +2576,11 @@ sub vmstatus {
>  
>  my $cpucount = $cpuinfo->{cpus} || 1;
>  
> +my $def_sockets = $confdesc->{sockets}->{default};
> +my $def_cores = $confdesc->{cores}->{default};
> +my $def_memory = $confdesc->{memory}->{default};
> +my $def_shares = $confdesc->{shares}->{default};
> +
>  foreach my $vmid (keys %$list) {
>   next if $opt_vmid && ($vmid ne $opt_vmid);
>  
> @@ -2597,16 +2602,19 @@ sub vmstatus {
>   $d->{maxdisk} = 0;
>   }
>  
> - $d->{cpus} = ($conf->{sockets} || 1) * ($conf->{cores} || 1);
> + $d->{cpus} = ($conf->{sockets} || $def_sockets)
> + * ($conf->{cores} || $def_cores);
>   $d->{cpus} = $cpucount if $d->{cpus} > $cpucount;
>   $d->{cpus} = $conf->{vcpus} if $conf->{vcpus};
>  
>   $d->{name} = $conf->{name} || "VM $vmid";
> - $d->{maxmem} = $conf->{memory} ? $conf->{memory}*(1024*1024) : 0;
> + $d->{maxmem} = ($conf->{memory} ? $conf->{memory} : $def_memory)
> + * (1024*1024);
>  
>   if ($conf->{balloon}) {
>   $d->{balloon_min} = $conf->{balloon}*(1024*1024);
> - $d->{shares} = defined($conf->{shares}) ? $conf->{shares} : 1000;
> + $d->{shares} = defined($conf->{shares}) ? $conf->{shares}
> + : $def_shares;
>   }
>  
>   $d->{uptime} = 0;
> 

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


[pve-devel] [PATCH manager v2 3/3] Add a proper confirmation message when we detach an used disk

2017-11-15 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index 2cd0c940..e6bc0231 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -402,9 +402,16 @@ Ext.define('PVE.qemu.HardwareView', {
disabled: true,
dangerous: true,
confirmMsg: function(rec) {
-   var msg = Ext.String.format(gettext('Are you sure you want to 
remove entry {0}'),
-   "'" + me.renderKey(rec.data.key, 
{}, rec) + "'");
-   if (rec.data.key.match(/^unused\d+$/)) {
+   var warn = 'Are you sure you want to remove entry {0}';
+   if (this.text === this.altText) {
+   warn = 'Are you sure you want to detach entry {0}';
+   }
+
+   var entry = rec.data.key;
+   var msg = Ext.String.format(gettext(warn), "'"
+   + me.renderKey(entry, {}, rec) + "'");
+
+   if (entry.match(/^unused\d+$/)) {
msg += " " + gettext('This will permanently erase all 
data.');
}
 
-- 
2.11.0


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


[pve-devel] [PATCH manager v2 1/3] Fix JSLint type confusion warnings

2017-11-15 Thread Emmanuel Kasper
The type confusion warnings arose from string and integer concatenation,
and object properties of the name which were alternatively set with
strings and integers.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 29 ++---
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index cbec59d2..43337c36 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -1,5 +1,3 @@
-// fixme: howto avoid jslint type confusion?
-/*jslint confusion: true */
 Ext.define('PVE.qemu.HardwareView', {
 extend: 'PVE.grid.PendingObjectGrid',
 alias: ['widget.PVE.qemu.HardwareView'],
@@ -47,7 +45,7 @@ Ext.define('PVE.qemu.HardwareView', {
header: gettext('Memory'),
editor: caps.vms['VM.Config.Memory'] ? 'PVE.qemu.MemoryEdit' : 
undefined,
never_delete: true,
-   defaultValue: 512,
+   defaultValue: '512',
tdCls: 'pve-itype-icon-memory',
renderer: function(value, metaData, record) {
var balloon =  me.getObjectValue('balloon');
@@ -65,7 +63,7 @@ Ext.define('PVE.qemu.HardwareView', {
editor: (caps.vms['VM.Config.CPU'] || 
caps.vms['VM.Config.HWType']) ? 
'PVE.qemu.ProcessorEdit' : undefined,
tdCls: 'pve-itype-icon-processor',
-   defaultValue: 1,
+   defaultValue: '1',
multiKey: ['sockets', 'cpu', 'cores', 'numa', 'vcpus', 
'cpulimit', 'cpuunits'],
renderer: function(value, metaData, record, rowIndex, colIndex, 
store, pending) {
 
@@ -77,8 +75,9 @@ Ext.define('PVE.qemu.HardwareView', {
var cpulimit = me.getObjectValue('cpulimit', undefined, 
pending);
var cpuunits = me.getObjectValue('cpuunits', undefined, 
pending);
 
-   var res = (sockets*cores) + ' (' + sockets + ' sockets, ' + 
cores + ' cores)';
-   
+   var res = Ext.String.format('{0} ({1} sockets, {2} cores)',
+   sockets*cores, sockets, cores);
+
if (model) {
res += ' [' + model + ']';
}
@@ -149,7 +148,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
 
for (i = 0; i < 4; i++) {
-   confid = "ide" + i;
+   confid = "ide" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -160,7 +159,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 6; i++) {
-   confid = "sata" + i;
+   confid = "sata" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -171,7 +170,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 16; i++) {
-   confid = "scsi" + i;
+   confid = "scsi" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -182,7 +181,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 16; i++) {
-   confid = "virtio" + i;
+   confid = "virtio" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -193,7 +192,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 32; i++) {
-   confid = "net" + i;
+   confid = "net" + i.toString();
rows[confid] = {
group: 2,
tdCls: 'pve-itype-icon-network',
@@ -210,7 +209,7 @@ Ext.define('PVE.qemu.HardwareView', {
header: gettext('EFI Disk')
};
for (i = 0; i < 5; i++) {
-   confid = "usb" + i;
+   confid = "usb" + i.toString();
rows[confid] = {
group: 4,
tdCls: 'pve-itype-icon-usb',
@@ -220,7 +219,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 4; i++) {
-   confid = "hostpci" + i;
+   confid = "hostpci" + i.toString();
rows[confid] = {
group: 5,
tdCls: 'pve-itype-icon-pci',
@@ -229,11 +228,11 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 8; i++) {
-   rows["unused" + i] = {
+   rows["unused" + i.toString()] = {
group: 6,
tdCls: 'pve-itype-icon-storage',
editor: caps.vms['VM.Config.Disk'] ? 'PVE

[pve-devel] [PATCH manager v2 0/3] Introduce 'Detach' text for used disks

2017-11-15 Thread Emmanuel Kasper
change since V2:
 * do not call gettext twice on the same string
 * use 'render' event instead of 'boxready' when computing an optimal box size

Emmanuel Kasper (3):
  Fix JSLint type confusion warnings
  Fix #1526:  Use 'detach' instead of 'remove' when the disk is used
  Add a proper confirmation message when we detach an used disk

 www/manager6/qemu/HardwareView.js | 70 ++-
 1 file changed, 47 insertions(+), 23 deletions(-)

-- 
2.11.0


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


[pve-devel] [PATCH manager v2 2/3] Fix #1526: Use 'detach' instead of 'remove' when the disk is used

2017-11-15 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 28 +++-
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index 43337c36..2cd0c940 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -396,6 +396,8 @@ Ext.define('PVE.qemu.HardwareView', {
 
var remove_btn = new PVE.button.Button({
text: gettext('Remove'),
+   defaultText: gettext('Remove'),
+   altText: gettext('Detach'),
selModel: sm,
disabled: true,
dangerous: true,
@@ -423,6 +425,22 @@ Ext.define('PVE.qemu.HardwareView', {
Ext.Msg.alert('Error', response.htmlStatus);
}
});
+   },
+   listeners: {
+   render: function(btn) {
+   // hack: calculate an optimal button width on first display
+   // to prevent the whole toolbar to move when we switch
+   // between the "Remove" and "Detach" labels
+   var def = btn.getSize().width;
+
+   btn.setText(btn.altText);
+   var alt = btn.getSize().width;
+
+   btn.setText(btn.defaultText);
+
+   btn.optimal = alt > def ? alt : def;
+   btn.setSize({ width: btn.optimal});
+   }
}
});
 
@@ -504,22 +522,22 @@ Ext.define('PVE.qemu.HardwareView', {
var rowdef = rows[key];
 
var pending = rec.data['delete'] || me.hasPendingChanges(key);
-   var isDisk = !key.match(/^unused\d+/) &&
+   var isUsedDisk = !key.match(/^unused\d+/) &&
rowdef.tdCls == 'pve-itype-icon-storage' &&
(value && !value.match(/media=cdrom/));
 
var isEfi = (key === 'efidisk0');
 
-
remove_btn.setDisabled(rec.data['delete'] || (rowdef.never_delete 
=== true));
+   remove_btn.setText(isUsedDisk ? remove_btn.altText : 
remove_btn.defaultText);
 
edit_btn.setDisabled(rec.data['delete'] || !rowdef.editor);
 
-   resize_btn.setDisabled(pending || !isDisk);
+   resize_btn.setDisabled(pending || !isUsedDisk);
 
-   move_btn.setDisabled(pending || !isDisk);
+   move_btn.setDisabled(pending || !isUsedDisk);
 
-   diskthrottle_btn.setDisabled(pending || !isDisk || isEfi);
+   diskthrottle_btn.setDisabled(pending || !isUsedDisk || isEfi);
 
revert_btn.setDisabled(!pending);
 
-- 
2.11.0


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


Re: [pve-devel] [PATCH manager] buildsys: add excludes to dh_fixperms

2017-11-13 Thread Emmanuel Kasper
Tested-By: Emmanuel Kasper <e.kas...@proxmox.com>
Acked-By: Emmanuel Kasper <e.kas...@proxmox.com>

On 11/13/2017 10:37 AM, Wolfgang Bumiller wrote:
> Instead of fixing up permissions manually as the make
> install target is actually responsible for this (and already
> doing it).
> 
> Signed-off-by: Wolfgang Bumiller <w.bumil...@proxmox.com>
> ---
>  debian/rules | 6 +-
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/debian/rules b/debian/rules
> index 8c618219..f2c2cb77 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -7,11 +7,7 @@ override_dh_strip_nondeterminism:
>   dh_strip_nondeterminism -X.png
>  
>  override_dh_fixperms:
> - dh_fixperms
> - find debian -name 'pvemailforward' -exec chown root:www-data {} +
> - find debian -name 'pvemailforward' -exec chmod 2755 {} +
> - find debian -type d -name 'pveproxy' -exec chown www-data:www-data {} +
> - find debian -type d -name 'pveproxy' -exec chmod 700 {} +
> + dh_fixperms -Xpvemailforward -Xvar/log/pveproxy
>  
>  %:
>   dh $@
> 

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


[pve-devel] [PATCH manager 0/3] Change 'remove' to 'detach' when removing an used disk

2017-11-13 Thread Emmanuel Kasper
A fix for #1526

Emmanuel Kasper (3):
  Fix JSLint type confusion warnings
  Fix #1526:  Use 'detach' instead of 'remove' when the disk is used
  Add a proper confirmation message when we detach an used disk

 www/manager6/qemu/HardwareView.js | 67 +--
 1 file changed, 44 insertions(+), 23 deletions(-)

-- 
2.11.0


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


[pve-devel] [PATCH manager 1/3] Fix JSLint type confusion warnings

2017-11-13 Thread Emmanuel Kasper
The type confusion warnings arose from string and integer concatenation,
and object properties of the name which were alternatively set with
strings or intergers.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 29 ++---
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index cbec59d2..43337c36 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -1,5 +1,3 @@
-// fixme: howto avoid jslint type confusion?
-/*jslint confusion: true */
 Ext.define('PVE.qemu.HardwareView', {
 extend: 'PVE.grid.PendingObjectGrid',
 alias: ['widget.PVE.qemu.HardwareView'],
@@ -47,7 +45,7 @@ Ext.define('PVE.qemu.HardwareView', {
header: gettext('Memory'),
editor: caps.vms['VM.Config.Memory'] ? 'PVE.qemu.MemoryEdit' : 
undefined,
never_delete: true,
-   defaultValue: 512,
+   defaultValue: '512',
tdCls: 'pve-itype-icon-memory',
renderer: function(value, metaData, record) {
var balloon =  me.getObjectValue('balloon');
@@ -65,7 +63,7 @@ Ext.define('PVE.qemu.HardwareView', {
editor: (caps.vms['VM.Config.CPU'] || 
caps.vms['VM.Config.HWType']) ? 
'PVE.qemu.ProcessorEdit' : undefined,
tdCls: 'pve-itype-icon-processor',
-   defaultValue: 1,
+   defaultValue: '1',
multiKey: ['sockets', 'cpu', 'cores', 'numa', 'vcpus', 
'cpulimit', 'cpuunits'],
renderer: function(value, metaData, record, rowIndex, colIndex, 
store, pending) {
 
@@ -77,8 +75,9 @@ Ext.define('PVE.qemu.HardwareView', {
var cpulimit = me.getObjectValue('cpulimit', undefined, 
pending);
var cpuunits = me.getObjectValue('cpuunits', undefined, 
pending);
 
-   var res = (sockets*cores) + ' (' + sockets + ' sockets, ' + 
cores + ' cores)';
-   
+   var res = Ext.String.format('{0} ({1} sockets, {2} cores)',
+   sockets*cores, sockets, cores);
+
if (model) {
res += ' [' + model + ']';
}
@@ -149,7 +148,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
 
for (i = 0; i < 4; i++) {
-   confid = "ide" + i;
+   confid = "ide" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -160,7 +159,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 6; i++) {
-   confid = "sata" + i;
+   confid = "sata" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -171,7 +170,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 16; i++) {
-   confid = "scsi" + i;
+   confid = "scsi" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -182,7 +181,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 16; i++) {
-   confid = "virtio" + i;
+   confid = "virtio" + i.toString();
rows[confid] = {
group: 1,
tdCls: 'pve-itype-icon-storage',
@@ -193,7 +192,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 32; i++) {
-   confid = "net" + i;
+   confid = "net" + i.toString();
rows[confid] = {
group: 2,
tdCls: 'pve-itype-icon-network',
@@ -210,7 +209,7 @@ Ext.define('PVE.qemu.HardwareView', {
header: gettext('EFI Disk')
};
for (i = 0; i < 5; i++) {
-   confid = "usb" + i;
+   confid = "usb" + i.toString();
rows[confid] = {
group: 4,
tdCls: 'pve-itype-icon-usb',
@@ -220,7 +219,7 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 4; i++) {
-   confid = "hostpci" + i;
+   confid = "hostpci" + i.toString();
rows[confid] = {
group: 5,
tdCls: 'pve-itype-icon-pci',
@@ -229,11 +228,11 @@ Ext.define('PVE.qemu.HardwareView', {
};
}
for (i = 0; i < 8; i++) {
-   rows["unused" + i] = {
+   rows["unused" + i.toString()] = {
group: 6,
tdCls: 'pve-itype-icon-storage',
editor: caps.vms['VM.Config.Disk'] ? 'PVE

[pve-devel] [PATCH manager 2/3] Fix #1526: Use 'detach' instead of 'remove' when the disk is used

2017-11-13 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 25 -
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index 43337c36..3b0f00f6 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -396,6 +396,8 @@ Ext.define('PVE.qemu.HardwareView', {
 
var remove_btn = new PVE.button.Button({
text: gettext('Remove'),
+   defaultText: gettext('Remove'),
+   altText: gettext('Detach'),
selModel: sm,
disabled: true,
dangerous: true,
@@ -423,6 +425,19 @@ Ext.define('PVE.qemu.HardwareView', {
Ext.Msg.alert('Error', response.htmlStatus);
}
});
+   },
+   listeners: {
+   boxready: function(btn, initWidth, initHeight) {
+   // hack: calculate an optimal button width on first display
+   // to prevent the whole toolbar to move when we switch
+   // between the "Remove" and "Detach" labels
+   btn.setText(btn.altText);
+   var newWidth = btn.getSize().width;
+   btn.setText(btn.defaultText);
+
+   btn.optimalWidth = newWidth > initWidth ? newWidth : 
initWidth;
+   btn.setSize({ width: btn.optimalWidth});
+   }
}
});
 
@@ -504,22 +519,22 @@ Ext.define('PVE.qemu.HardwareView', {
var rowdef = rows[key];
 
var pending = rec.data['delete'] || me.hasPendingChanges(key);
-   var isDisk = !key.match(/^unused\d+/) &&
+   var isUsedDisk = !key.match(/^unused\d+/) &&
rowdef.tdCls == 'pve-itype-icon-storage' &&
(value && !value.match(/media=cdrom/));
 
var isEfi = (key === 'efidisk0');
 
-
remove_btn.setDisabled(rec.data['delete'] || (rowdef.never_delete 
=== true));
+   remove_btn.setText(gettext(isUsedDisk ? remove_btn.altText : 
remove_btn.defaultText));
 
edit_btn.setDisabled(rec.data['delete'] || !rowdef.editor);
 
-   resize_btn.setDisabled(pending || !isDisk);
+   resize_btn.setDisabled(pending || !isUsedDisk);
 
-   move_btn.setDisabled(pending || !isDisk);
+   move_btn.setDisabled(pending || !isUsedDisk);
 
-   diskthrottle_btn.setDisabled(pending || !isDisk || isEfi);
+   diskthrottle_btn.setDisabled(pending || !isUsedDisk || isEfi);
 
revert_btn.setDisabled(!pending);
 
-- 
2.11.0


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


[pve-devel] [PATCH manager 3/3] Add a proper confirmation message when we detach an used disk

2017-11-13 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js 
b/www/manager6/qemu/HardwareView.js
index 3b0f00f6..605958e1 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -402,9 +402,16 @@ Ext.define('PVE.qemu.HardwareView', {
disabled: true,
dangerous: true,
confirmMsg: function(rec) {
-   var msg = Ext.String.format(gettext('Are you sure you want to 
remove entry {0}'),
-   "'" + me.renderKey(rec.data.key, 
{}, rec) + "'");
-   if (rec.data.key.match(/^unused\d+$/)) {
+   var warn = 'Are you sure you want to remove entry {0}';
+   if (this.text === this.altText) {
+   warn = 'Are you sure you want to detach entry {0}';
+   }
+
+   var entry = rec.data.key;
+   var msg = Ext.String.format(gettext(warn), "'"
+   + me.renderKey(entry, {}, rec) + "'");
+
+   if (entry.match(/^unused\d+$/)) {
msg += " " + gettext('This will permanently erase all 
data.');
}
 
-- 
2.11.0


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


Re: [pve-devel] Call to translaters: Proxmox VE has new features and need your translations !

2017-11-09 Thread Emmanuel Kasper
On 11/09/2017 03:00 PM, Jostein Hove-Henriksen wrote:
> I've updated the Norwegian bokmål (nb) and Norwegian nynorsk (nn)
> translation.
> 
> (I'll see if I can learn more about /git/ later...)

Thanks Jostein, I had a look at both files, and they look good to me.
Did you already sign our Contributor License Agreement ?

https://pve.proxmox.com/wiki/Developer_Documentation#Software_License_and_Copyright

We need the CLA to commit the translations in the code base.

Emmanuel

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


[pve-devel] Call to translaters: Proxmox VE has new features and need your translations !

2017-11-09 Thread Emmanuel Kasper
Dear Pve Translators (and dear future PVE translators) !

We always add new features to the PVE gui like Storage Replication, Ceph
Dashboard, but unfortunately the translations tend to lag
behind for many languages, resulting in a mix of English and Locale
language when a different language is selected.

We try to maintain the translation ourselves
for German, French and Italian, but we have 17 other languages besides that.

This is the number of untranslated strings that we currently have as
of Pve 5.1:

sv.po:   147
tr.po:   140
pt_BR.po:140
pl.po:   140
da.po:   140
ca.po:   140
ru.po:   139
sl.po:   138
zh_CN.po:112
fa.po:   111
eu.po:   109
es.po:   89
gl.po:   88
nn.po:   67
nb.po:   67
hu.po:   66
ja.po:   21


You can easily bring your own language up to date by doing these 4 easy
steps:

1. clone the git repository containing the translations

git clone git://git.proxmox.com/git/pve-manager.git

2. open the translation of your native language with poedit, vim, well
you know

3. then iterate through the strings to translate.

 A) Please check on the GUI where the element appears to know the
context. For instance "Attribute" can mean different things depending on
where it happens.

B) It is perfectly fine, and even sometimes recommended to use the
same word as in english (for instance for LXC, DHCP, NFS, kernel, etc
...)
In that case, just copy the English word.

4. send the updated po my_language.po file to pve-devel@pve.proxmox.com

If you know more about git, you can also send a proper formatted patch
as explained in https://pve.proxmox.com/wiki/Developer_Documentation
We follow the same mail based workflows as many Linux projects.

Emmanuel






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


[pve-devel] [PATCH manager 5/6] Do not translate PC hardware specific terms

2017-11-08 Thread Emmanuel Kasper
The SKU (Stock Keeping Unit) field was never translated anyway in our po files,
probably because nobody knew what the initials meant.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/Smbios1Edit.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/qemu/Smbios1Edit.js b/www/manager6/qemu/Smbios1Edit.js
index 0412bc26..866627f2 100644
--- a/www/manager6/qemu/Smbios1Edit.js
+++ b/www/manager6/qemu/Smbios1Edit.js
@@ -61,7 +61,7 @@ Ext.define('PVE.qemu.Smbios1InputPanel', {
},
{
xtype: 'textfield',
-   fieldLabel: gettext('SKU'),
+   fieldLabel: 'SKU',
regex: /^\S+$/,
name: 'sku'
},
-- 
2.11.0


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


[pve-devel] [PATCH manager 4/6] Do not translate Qemu specific terms

2017-11-08 Thread Emmanuel Kasper
Multiqueue is the proper name as used by Qemu, as seen in
https://www.linux-kvm.org/page/Multiqueue

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/qemu/HDEdit.js  | 2 +-
 www/manager6/qemu/NetworkEdit.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 2b860d8f..ee44a9b7 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -309,7 +309,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
{
xtype: 'pvecheckbox',
disabled: me.confid && !me.confid.match(/^(virtio|scsi)/),
-   fieldLabel: gettext('IO thread'),
+   fieldLabel: 'IO thread',
reference: 'iothread',
name: 'iothread'
});
diff --git a/www/manager6/qemu/NetworkEdit.js b/www/manager6/qemu/NetworkEdit.js
index 7e994823..9339d846 100644
--- a/www/manager6/qemu/NetworkEdit.js
+++ b/www/manager6/qemu/NetworkEdit.js
@@ -151,7 +151,7 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
{
xtype: 'pveIntegerField',
name: 'queues',
-   fieldLabel: gettext('Multiqueues'),
+   fieldLabel: 'Multiqueue',
minValue: 1,
maxValue: 8,
value: '',
-- 
2.11.0


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


[pve-devel] [PATCH manager 3/6] Do not translate IT specific terms

2017-11-08 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/grid/Replication.js | 2 +-
 www/manager6/lxc/Network.js  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/grid/Replication.js b/www/manager6/grid/Replication.js
index 2c8f3cf9..654a8368 100644
--- a/www/manager6/grid/Replication.js
+++ b/www/manager6/grid/Replication.js
@@ -310,7 +310,7 @@ Ext.define('PVE.grid.ReplicaView', {
disabled: true
},
{
-   text: gettext('ID'),
+   text: 'ID',
dataIndex: 'id',
width: 60,
hidden: true
diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
index 1620a7a6..504ee6be 100644
--- a/www/manager6/lxc/Network.js
+++ b/www/manager6/lxc/Network.js
@@ -479,7 +479,7 @@ Ext.define('PVE.lxc.NetworkView', {
],
columns: [
{
-   header: gettext('ID'),
+   header: 'ID',
width: 50,
dataIndex: 'id'
},
-- 
2.11.0


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


[pve-devel] [PATCH manager 2/6] Do not translate PC hardware specific terms

2017-11-08 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/form/HotplugFeatureSelector.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/form/HotplugFeatureSelector.js 
b/www/manager6/form/HotplugFeatureSelector.js
index 71187cf6..cb373b69 100644
--- a/www/manager6/form/HotplugFeatureSelector.js
+++ b/www/manager6/form/HotplugFeatureSelector.js
@@ -7,7 +7,7 @@ Ext.define('PVE.form.HotplugFeatureSelector', {
 items: [
{ boxLabel: gettext('Disk'),name: 'hotplug', inputValue: 'disk',   
submitValue: false, checked: true },
{ boxLabel: gettext('Network'), name: 'hotplug', inputValue: 
'network',submitValue: false, checked: true },
-   { boxLabel: gettext('USB'), name: 'hotplug', inputValue: 'usb',
submitValue: false, checked: true },
+   { boxLabel: 'USB',  name: 'hotplug', inputValue: 'usb',
submitValue: false, checked: true },
{ boxLabel: gettext('Memory'),  name: 'hotplug', inputValue: 'memory', 
submitValue: false },
{ boxLabel: gettext('CPU'), name: 'hotplug', inputValue: 'cpu',
submitValue: false }
 ],
-- 
2.11.0


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


[pve-devel] [PATCH manager 6/6] Do not translate Unix/Linux specific terms

2017-11-08 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/lxc/ResourceEdit.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/lxc/ResourceEdit.js b/www/manager6/lxc/ResourceEdit.js
index 9770de8d..48e5b57a 100644
--- a/www/manager6/lxc/ResourceEdit.js
+++ b/www/manager6/lxc/ResourceEdit.js
@@ -498,7 +498,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
 
me.acl = Ext.createWidget('pveKVComboBox', {
name: 'acl',
-   fieldLabel: gettext('ACLs'),
+   fieldLabel: 'ACLs',
comboItems: [['Default', 'Default'], ['1', 'On'], ['0', 'Off']],
value: 'Default',
allowBlank: true
-- 
2.11.0


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


[pve-devel] [PATCH manager 0/6] Do not add useless gettext entries to translate

2017-11-08 Thread Emmanuel Kasper
This patch series removes some terms which were never translated
because the english term is the best fit.
We can get rid of the gettext entries so that the translater work
is reduced in all languages.

Dietmar, can you have a look on this as you're the one
with the strongest interest here ?

I split the removals in multiple patch so that the committer can apply / reject
the removals individually.

Emmanuel Kasper (6):
  Do not translate Ceph specific terms
  Do not translate PC hardware specific terms
  Do not translate IT specific terms
  Do not translate Qemu specific terms
  Do not translate PC hardware specific terms
  Do not translate Unix/Linux specific terms

 www/manager6/ceph/StatusDetail.js   | 4 ++--
 www/manager6/form/HotplugFeatureSelector.js | 2 +-
 www/manager6/grid/Replication.js| 2 +-
 www/manager6/lxc/Network.js | 2 +-
 www/manager6/lxc/ResourceEdit.js| 2 +-
 www/manager6/qemu/HDEdit.js | 2 +-
 www/manager6/qemu/NetworkEdit.js| 2 +-
 www/manager6/qemu/Smbios1Edit.js| 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

-- 
2.11.0


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


[pve-devel] [PATCH manager 1/6] Do not translate Ceph specific terms

2017-11-08 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/ceph/StatusDetail.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/ceph/StatusDetail.js 
b/www/manager6/ceph/StatusDetail.js
index 5373e2d5..7625b366 100644
--- a/www/manager6/ceph/StatusDetail.js
+++ b/www/manager6/ceph/StatusDetail.js
@@ -37,7 +37,7 @@ Ext.define('PVE.ceph.StatusDetail', {
downout: 0
},
tpl: [
-   '' + gettext('OSDs') + '',
+   '' + 'OSDs' + '',
'',
'',
'',
@@ -76,7 +76,7 @@ Ext.define('PVE.ceph.StatusDetail', {
states: []
},
tpl: [
-   '' + gettext('PGs') + '',
+   '' + 'PGs' + '',
'',
'{state_name}:',
'{count}',
-- 
2.11.0


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


[pve-devel] [PATCH docs 1/2] Fix formatting failure

2017-11-08 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 pct.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pct.adoc b/pct.adoc
index 7a7bcc6..c509308 100644
--- a/pct.adoc
+++ b/pct.adoc
@@ -325,7 +325,7 @@ Backup of Containers mount points
 
 By default additional mount points besides the Root Disk mount point are not
 included in backups. You can reverse this default behavior by setting the
-* Backup* option on a mount point.
+*Backup* option on a mount point.
 // see PVE::VZDump::LXC::prepare()
 
 Replication of Containers mount points
-- 
2.11.0


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


[pve-devel] [PATCH docs 2/2] Create a 10 gibibytes diskimage instead of 10 gigabytes

2017-11-08 Thread Emmanuel Kasper
Otherwise the disk import may fail on block storages requiring
volumes size to be a multiple of the block size, like ZFS.

This fixes the error:
'volume size must be a multiple of volume block size'
when importing the generated disk image as a zvol.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 qm.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qm.adoc b/qm.adoc
index 3982549..e0d789c 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -804,7 +804,7 @@ foreign hypervisor, or one that you created yourself.
 Suppose you created a Debian/Ubuntu disk image with the 'vmdebootstrap' tool:
 
  vmdebootstrap --verbose \
-  --size 10G --serial-console \
+  --size 10GiB --serial-console \
   --grub --no-extlinux \
   --package openssh-server \
   --package avahi-daemon \
-- 
2.11.0


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


[pve-devel] [PATCH manager v2 3/3] Move Max Backups field below the Content Type Selector

2017-10-31 Thread Emmanuel Kasper
Since the Max Backups field is now depending of having the Content Type
set to 'backup', it makes sense to group these two fields.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/storage/DirEdit.js   | 22 +++---
 www/manager6/storage/GlusterFsEdit.js | 22 +++---
 www/manager6/storage/NFSEdit.js   | 22 +++---
 3 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/www/manager6/storage/DirEdit.js b/www/manager6/storage/DirEdit.js
index 4e196431..8a8d6d4c 100644
--- a/www/manager6/storage/DirEdit.js
+++ b/www/manager6/storage/DirEdit.js
@@ -44,6 +44,17 @@ Ext.define('PVE.storage.DirInputPanel', {
multiSelect: true,
fieldLabel: gettext('Content'),
allowBlank: false
+   },
+   {
+   xtype: 'pveIntegerField',
+   fieldLabel: gettext('Max Backups'),
+   disabled: true,
+   name: 'maxfiles',
+   reference: 'maxfiles',
+   minValue: 0,
+   maxValue: 365,
+   value: me.isCreate ? '1' : undefined,
+   allowBlank: false
}
];
 
@@ -60,17 +71,6 @@ Ext.define('PVE.storage.DirInputPanel', {
name: 'shared',
uncheckedValue: 0,
fieldLabel: gettext('Shared')
-   },
-   {
-   xtype: 'pveIntegerField',
-   fieldLabel: gettext('Max Backups'),
-   disabled: true,
-   name: 'maxfiles',
-   reference: 'maxfiles',
-   minValue: 0,
-   maxValue: 365,
-   value: me.isCreate ? '1' : undefined,
-   allowBlank: false
}
];
 
diff --git a/www/manager6/storage/GlusterFsEdit.js 
b/www/manager6/storage/GlusterFsEdit.js
index d861c0b8..9ab97761 100644
--- a/www/manager6/storage/GlusterFsEdit.js
+++ b/www/manager6/storage/GlusterFsEdit.js
@@ -127,6 +127,17 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
multiSelect: true,
fieldLabel: gettext('Content'),
allowBlank: false
+   },
+   {
+   xtype: 'pveIntegerField',
+   fieldLabel: gettext('Max Backups'),
+   disabled: true,
+   name: 'maxfiles',
+   reference: 'maxfiles',
+   minValue: 0,
+   maxValue: 365,
+   value: me.isCreate ? '1' : undefined,
+   allowBlank: false
}
];
 
@@ -146,17 +157,6 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
checked: true,
uncheckedValue: 0,
fieldLabel: gettext('Enable')
-   },
-   {
-   xtype: 'pveIntegerField',
-   fieldLabel: gettext('Max Backups'),
-   disabled: true,
-   name: 'maxfiles',
-   reference: 'maxfiles',
-   minValue: 0,
-   maxValue: 365,
-   value: me.isCreate ? '1' : undefined,
-   allowBlank: false
}
];
 
diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js
index 728a3ffd..526ce1db 100644
--- a/www/manager6/storage/NFSEdit.js
+++ b/www/manager6/storage/NFSEdit.js
@@ -122,6 +122,17 @@ Ext.define('PVE.storage.NFSInputPanel', {
multiSelect: true,
fieldLabel: gettext('Content'),
allowBlank: false
+   },
+   {
+   xtype: 'pveIntegerField',
+   fieldLabel: gettext('Max Backups'),
+   disabled: true,
+   name: 'maxfiles',
+   reference: 'maxfiles',
+   minValue: 0,
+   maxValue: 365,
+   value: me.isCreate ? '1' : undefined,
+   allowBlank: false
}
];
 
@@ -141,17 +152,6 @@ Ext.define('PVE.storage.NFSInputPanel', {
checked: true,
uncheckedValue: 0,
fieldLabel: gettext('Enable')
-   },
-   {
-   xtype: 'pveIntegerField',
-   fieldLabel: gettext('Max Backups'),
-   disabled: true,
-   name: 'maxfiles',
-   reference: 'maxfiles',
-   minValue: 0,
-   maxValue: 365,
-   value: me.isCreate ? '1' : undefined,
-   allowBlank: false
}
];
 
-- 
2.11.0


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


[pve-devel] [PATCH manager v2 1/3] Add Storage Controller class

2017-10-31 Thread Emmanuel Kasper
This controller will display the 'Max Backups' field only if the storage can
hold backups.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/Makefile  |  1 +
 www/manager6/controller/StorageEdit.js | 18 ++
 2 files changed, 19 insertions(+)
 create mode 100644 www/manager6/controller/StorageEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index d2089618..d39bb49c 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -10,6 +10,7 @@ JSSRC=
\
button/ConsoleButton.js \
button/Split.js \
button/HelpButton.js\
+   controller/StorageEdit.js   \
qemu/SendKeyMenu.js \
qemu/CmdMenu.js \
qemu/TemplateMenu.js\
diff --git a/www/manager6/controller/StorageEdit.js 
b/www/manager6/controller/StorageEdit.js
new file mode 100644
index ..fc090046
--- /dev/null
+++ b/www/manager6/controller/StorageEdit.js
@@ -0,0 +1,18 @@
+Ext.define('PVE.controller.StorageEdit', {
+extend: 'Ext.app.ViewController',
+alias: 'controller.storageEdit',
+control: {
+   'field[name=content]': {
+   change: function(field, value) {
+   var hasBackups = Ext.Array.contains(value, 'backup');
+   var maxfiles = this.lookupReference('maxfiles');
+
+   if (!hasBackups) {
+   // clear values which will never be submitted
+   maxfiles.reset();
+   }
+   maxfiles.setDisabled(!hasBackups);
+   }
+   }
+}
+});
-- 
2.11.0


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


[pve-devel] [PATCH manager v2 2/3] Fix #1523: Display the Max Backups field only if relevant

2017-10-31 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/storage/DirEdit.js   | 3 +++
 www/manager6/storage/GlusterFsEdit.js | 3 +++
 www/manager6/storage/NFSEdit.js   | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/www/manager6/storage/DirEdit.js b/www/manager6/storage/DirEdit.js
index cdfa6dda..4e196431 100644
--- a/www/manager6/storage/DirEdit.js
+++ b/www/manager6/storage/DirEdit.js
@@ -1,5 +1,6 @@
 Ext.define('PVE.storage.DirInputPanel', {
 extend: 'PVE.panel.InputPanel',
+controller: 'storageEdit',
 
 onGetValues: function(values) {
var me = this;
@@ -63,7 +64,9 @@ Ext.define('PVE.storage.DirInputPanel', {
{
xtype: 'pveIntegerField',
fieldLabel: gettext('Max Backups'),
+   disabled: true,
name: 'maxfiles',
+   reference: 'maxfiles',
minValue: 0,
maxValue: 365,
value: me.isCreate ? '1' : undefined,
diff --git a/www/manager6/storage/GlusterFsEdit.js 
b/www/manager6/storage/GlusterFsEdit.js
index 2cde74c3..d861c0b8 100644
--- a/www/manager6/storage/GlusterFsEdit.js
+++ b/www/manager6/storage/GlusterFsEdit.js
@@ -59,6 +59,7 @@ Ext.define('PVE.storage.GlusterFsScan', {
 
 Ext.define('PVE.storage.GlusterFsInputPanel', {
 extend: 'PVE.panel.InputPanel',
+controller: 'storageEdit',
 
 onGetValues: function(values) {
var me = this;
@@ -149,7 +150,9 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
{
xtype: 'pveIntegerField',
fieldLabel: gettext('Max Backups'),
+   disabled: true,
name: 'maxfiles',
+   reference: 'maxfiles',
minValue: 0,
maxValue: 365,
value: me.isCreate ? '1' : undefined,
diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js
index e1f48e78..728a3ffd 100644
--- a/www/manager6/storage/NFSEdit.js
+++ b/www/manager6/storage/NFSEdit.js
@@ -59,6 +59,7 @@ Ext.define('PVE.storage.NFSScan', {
 
 Ext.define('PVE.storage.NFSInputPanel', {
 extend: 'PVE.panel.InputPanel',
+controller: 'storageEdit',
 
 onGetValues: function(values) {
var me = this;
@@ -144,7 +145,9 @@ Ext.define('PVE.storage.NFSInputPanel', {
{
xtype: 'pveIntegerField',
fieldLabel: gettext('Max Backups'),
+   disabled: true,
name: 'maxfiles',
+   reference: 'maxfiles',
minValue: 0,
maxValue: 365,
value: me.isCreate ? '1' : undefined,
-- 
2.11.0


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


[pve-devel] [PATCH manager v2 0/3] Fix #1523: Disable 'Max Backup' entry when not applicable

2017-10-31 Thread Emmanuel Kasper
changes since V1:
 * remove wrong whitespace in DirEdit.js
 * reset Max Backups value before disabling it in StorageEdit.js

Emmanuel Kasper (3):
  Add Storage Controller class
  Fix #1523: Display the Max Backups field only if relevant
  Move Max Backups field below the Content Type Selector

 www/manager6/Makefile  |  1 +
 www/manager6/controller/StorageEdit.js | 18 ++
 www/manager6/storage/DirEdit.js| 21 -
 www/manager6/storage/GlusterFsEdit.js  | 21 -
 www/manager6/storage/NFSEdit.js| 21 -
 5 files changed, 55 insertions(+), 27 deletions(-)
 create mode 100644 www/manager6/controller/StorageEdit.js

-- 
2.11.0


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


[pve-devel] [PATCH manager 1/3] Add Storage Controller class

2017-10-31 Thread Emmanuel Kasper
This controller will display the 'Max Backups' field only if the storage can
hold backups.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/Makefile  |  1 +
 www/manager6/controller/StorageEdit.js | 18 ++
 2 files changed, 19 insertions(+)
 create mode 100644 www/manager6/controller/StorageEdit.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index d2089618..d39bb49c 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -10,6 +10,7 @@ JSSRC=
\
button/ConsoleButton.js \
button/Split.js \
button/HelpButton.js\
+   controller/StorageEdit.js   \
qemu/SendKeyMenu.js \
qemu/CmdMenu.js \
qemu/TemplateMenu.js\
diff --git a/www/manager6/controller/StorageEdit.js 
b/www/manager6/controller/StorageEdit.js
new file mode 100644
index ..798d439f
--- /dev/null
+++ b/www/manager6/controller/StorageEdit.js
@@ -0,0 +1,18 @@
+Ext.define('PVE.controller.StorageEdit', {
+extend: 'Ext.app.ViewController',
+alias: 'controller.storageEdit',
+control: {
+   'field[name=content]': {
+   change: function(field, value) {
+   var hasBackups = Ext.Array.contains(value, 'backup');
+   var maxfiles = this.lookupReference('maxfiles');
+
+   // do not disable invalid fields as it removes
+   // their dirty state
+   if (maxfiles.isValid()) {
+   maxfiles.setDisabled(!hasBackups);
+   }
+   }
+   }
+}
+});
-- 
2.11.0


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


[pve-devel] [PATCH manager 3/3] Move Max Backups field below the Content Type Selector

2017-10-31 Thread Emmanuel Kasper
Since the Max Backups field is now depending of having the Content Type
set to 'backup', it makes sense to group these two fields.

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/storage/DirEdit.js   | 22 +++---
 www/manager6/storage/GlusterFsEdit.js | 22 +++---
 www/manager6/storage/NFSEdit.js   | 22 +++---
 3 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/www/manager6/storage/DirEdit.js b/www/manager6/storage/DirEdit.js
index 17b402a6..f9f4c862 100644
--- a/www/manager6/storage/DirEdit.js
+++ b/www/manager6/storage/DirEdit.js
@@ -44,6 +44,17 @@ Ext.define('PVE.storage.DirInputPanel', {
multiSelect: true,
fieldLabel: gettext('Content'),
allowBlank: false
+   },
+   {
+   xtype: 'pveIntegerField',
+   fieldLabel: gettext('Max Backups'),
+   disabled: true,
+   name: 'maxfiles',
+   reference: 'maxfiles',
+   minValue: 0,
+   maxValue: 365,
+   value: me.isCreate ? '1' : undefined,
+   allowBlank: false
}
];
 
@@ -60,17 +71,6 @@ Ext.define('PVE.storage.DirInputPanel', {
name: 'shared',
uncheckedValue: 0,
fieldLabel: gettext('Shared')
-   },
-   {
-   xtype: 'pveIntegerField',
-   fieldLabel: gettext('Max Backups'),
-   disabled: true,
-   name: 'maxfiles',
-   reference: 'maxfiles',
-   minValue: 0,
-   maxValue: 365,
-   value: me.isCreate ? '1' : undefined,
-   allowBlank: false
}
];
 
diff --git a/www/manager6/storage/GlusterFsEdit.js 
b/www/manager6/storage/GlusterFsEdit.js
index d861c0b8..9ab97761 100644
--- a/www/manager6/storage/GlusterFsEdit.js
+++ b/www/manager6/storage/GlusterFsEdit.js
@@ -127,6 +127,17 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
multiSelect: true,
fieldLabel: gettext('Content'),
allowBlank: false
+   },
+   {
+   xtype: 'pveIntegerField',
+   fieldLabel: gettext('Max Backups'),
+   disabled: true,
+   name: 'maxfiles',
+   reference: 'maxfiles',
+   minValue: 0,
+   maxValue: 365,
+   value: me.isCreate ? '1' : undefined,
+   allowBlank: false
}
];
 
@@ -146,17 +157,6 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
checked: true,
uncheckedValue: 0,
fieldLabel: gettext('Enable')
-   },
-   {
-   xtype: 'pveIntegerField',
-   fieldLabel: gettext('Max Backups'),
-   disabled: true,
-   name: 'maxfiles',
-   reference: 'maxfiles',
-   minValue: 0,
-   maxValue: 365,
-   value: me.isCreate ? '1' : undefined,
-   allowBlank: false
}
];
 
diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js
index 728a3ffd..526ce1db 100644
--- a/www/manager6/storage/NFSEdit.js
+++ b/www/manager6/storage/NFSEdit.js
@@ -122,6 +122,17 @@ Ext.define('PVE.storage.NFSInputPanel', {
multiSelect: true,
fieldLabel: gettext('Content'),
allowBlank: false
+   },
+   {
+   xtype: 'pveIntegerField',
+   fieldLabel: gettext('Max Backups'),
+   disabled: true,
+   name: 'maxfiles',
+   reference: 'maxfiles',
+   minValue: 0,
+   maxValue: 365,
+   value: me.isCreate ? '1' : undefined,
+   allowBlank: false
}
];
 
@@ -141,17 +152,6 @@ Ext.define('PVE.storage.NFSInputPanel', {
checked: true,
uncheckedValue: 0,
fieldLabel: gettext('Enable')
-   },
-   {
-   xtype: 'pveIntegerField',
-   fieldLabel: gettext('Max Backups'),
-   disabled: true,
-   name: 'maxfiles',
-   reference: 'maxfiles',
-   minValue: 0,
-   maxValue: 365,
-   value: me.isCreate ? '1' : undefined,
-   allowBlank: false
}
];
 
-- 
2.11.0


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


[pve-devel] [PATCH manager 0/3] Fix #1523: Disable 'Max Backup' entry when not applicable

2017-10-31 Thread Emmanuel Kasper
This patch serie fixes #1523.
Instead of writing for each Storage a new ViewController,
I created new ViewController class to be reused.


Emmanuel Kasper (3):
  Add Storage Controller class
  Fix #1523: Display the Max Backups field only if relevant
  Move Max Backups field below the Content Type Selector

 www/manager6/Makefile  |  1 +
 www/manager6/controller/StorageEdit.js | 18 ++
 www/manager6/storage/DirEdit.js| 21 -
 www/manager6/storage/GlusterFsEdit.js  | 21 -
 www/manager6/storage/NFSEdit.js| 21 -
 5 files changed, 55 insertions(+), 27 deletions(-)
 create mode 100644 www/manager6/controller/StorageEdit.js

-- 
2.11.0


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


[pve-devel] [PATCH manager 2/3] Fix #1523: Display the Max Backups field only if relevant

2017-10-31 Thread Emmanuel Kasper
Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 www/manager6/storage/DirEdit.js   | 3 +++
 www/manager6/storage/GlusterFsEdit.js | 3 +++
 www/manager6/storage/NFSEdit.js   | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/www/manager6/storage/DirEdit.js b/www/manager6/storage/DirEdit.js
index cdfa6dda..17b402a6 100644
--- a/www/manager6/storage/DirEdit.js
+++ b/www/manager6/storage/DirEdit.js
@@ -1,5 +1,6 @@
 Ext.define('PVE.storage.DirInputPanel', {
 extend: 'PVE.panel.InputPanel',
+controller:' storageEdit',
 
 onGetValues: function(values) {
var me = this;
@@ -63,7 +64,9 @@ Ext.define('PVE.storage.DirInputPanel', {
{
xtype: 'pveIntegerField',
fieldLabel: gettext('Max Backups'),
+   disabled: true,
name: 'maxfiles',
+   reference: 'maxfiles',
minValue: 0,
maxValue: 365,
value: me.isCreate ? '1' : undefined,
diff --git a/www/manager6/storage/GlusterFsEdit.js 
b/www/manager6/storage/GlusterFsEdit.js
index 2cde74c3..d861c0b8 100644
--- a/www/manager6/storage/GlusterFsEdit.js
+++ b/www/manager6/storage/GlusterFsEdit.js
@@ -59,6 +59,7 @@ Ext.define('PVE.storage.GlusterFsScan', {
 
 Ext.define('PVE.storage.GlusterFsInputPanel', {
 extend: 'PVE.panel.InputPanel',
+controller: 'storageEdit',
 
 onGetValues: function(values) {
var me = this;
@@ -149,7 +150,9 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
{
xtype: 'pveIntegerField',
fieldLabel: gettext('Max Backups'),
+   disabled: true,
name: 'maxfiles',
+   reference: 'maxfiles',
minValue: 0,
maxValue: 365,
value: me.isCreate ? '1' : undefined,
diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js
index e1f48e78..728a3ffd 100644
--- a/www/manager6/storage/NFSEdit.js
+++ b/www/manager6/storage/NFSEdit.js
@@ -59,6 +59,7 @@ Ext.define('PVE.storage.NFSScan', {
 
 Ext.define('PVE.storage.NFSInputPanel', {
 extend: 'PVE.panel.InputPanel',
+controller: 'storageEdit',
 
 onGetValues: function(values) {
var me = this;
@@ -144,7 +145,9 @@ Ext.define('PVE.storage.NFSInputPanel', {
{
xtype: 'pveIntegerField',
fieldLabel: gettext('Max Backups'),
+   disabled: true,
name: 'maxfiles',
+   reference: 'maxfiles',
minValue: 0,
maxValue: 365,
value: me.isCreate ? '1' : undefined,
-- 
2.11.0


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


Re: [pve-devel] [PATCH manager] prevent visual flashing of button when changing element in the tree

2017-10-31 Thread Emmanuel Kasper
Acked-by: Emmanuel Kasper <e.kas...@proxmox.com>


On 10/30/2017 03:03 PM, Dominik Csapak wrote:
> when changing between elements in the tree, either the
> start or shutdown buttons were visually flashing (meaning they are
> enabled/disabled for a short time and change state shortly after)
> 
> this patch fixes that
> 
> Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
> ---
>  www/manager6/lxc/Config.js  | 6 --
>  www/manager6/qemu/Config.js | 6 --
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
> index 7a735cd6..0ffc4841 100644
> --- a/www/manager6/lxc/Config.js
> +++ b/www/manager6/lxc/Config.js
> @@ -19,6 +19,8 @@ Ext.define('PVE.lxc.Config', {
>  
>   var template = me.pveSelNode.data.template;
>  
> + var running = !!me.pveSelNode.data.uptime;
> +
>   var caps = Ext.state.Manager.get('GuiCap');
>  
>   var base_url = '/nodes/' + nodename + '/lxc/' + vmid;
> @@ -42,7 +44,7 @@ Ext.define('PVE.lxc.Config', {
>  
>   var startBtn = Ext.create('Ext.Button', {
>   text: gettext('Start'),
> - disabled: !caps.vms['VM.PowerMgmt'],
> + disabled: !caps.vms['VM.PowerMgmt'] || running,
>   handler: function() {
>   vm_command('start');
>   },
> @@ -62,7 +64,7 @@ Ext.define('PVE.lxc.Config', {
>  
>   var shutdownBtn = Ext.create('PVE.button.Split', {
>   text: gettext('Shutdown'),
> - disabled: !caps.vms['VM.PowerMgmt'],
> + disabled: !caps.vms['VM.PowerMgmt'] || !running,
>   confirmMsg: PVE.Utils.format_task_description('vzshutdown', vmid),
>   handler: function() {
>   vm_command('shutdown');
> diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
> index f36ba690..db0f3152 100644
> --- a/www/manager6/qemu/Config.js
> +++ b/www/manager6/qemu/Config.js
> @@ -19,6 +19,8 @@ Ext.define('PVE.qemu.Config', {
>  
>   var template = !!me.pveSelNode.data.template;
>  
> + var running = !!me.pveSelNode.data.uptime;
> +
>   var caps = Ext.state.Manager.get('GuiCap');
>  
>   var base_url = '/nodes/' + nodename + "/qemu/" + vmid;
> @@ -52,7 +54,7 @@ Ext.define('PVE.qemu.Config', {
>  
>   var startBtn = Ext.create('Ext.Button', {
>   text: gettext('Start'),
> - disabled: !caps.vms['VM.PowerMgmt'],
> + disabled: !caps.vms['VM.PowerMgmt'] || running,
>   hidden: template,
>   handler: function() {
>   vm_command('start');
> @@ -133,7 +135,7 @@ Ext.define('PVE.qemu.Config', {
>  
>   var shutdownBtn = Ext.create('PVE.button.Split', {
>   text: gettext('Shutdown'),
> - disabled: !caps.vms['VM.PowerMgmt'],
> + disabled: !caps.vms['VM.PowerMgmt'] || !running,
>   hidden: template,
>   confirmMsg: PVE.Utils.format_task_description('qmshutdown', vmid),
>   handler: function() {
> 

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


[pve-devel] [PATCH qemu-server] Use schema default values as default values

2017-10-23 Thread Emmanuel Kasper
This fix a bug where VMs where the memory parameter was not
set where reported as having 0MB instead of 512 via `qm list`

Signed-off-by: Emmanuel Kasper <e.kas...@proxmox.com>
---
 PVE/QemuServer.pm | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 2b6fda9..6706e75 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2576,6 +2576,11 @@ sub vmstatus {
 
 my $cpucount = $cpuinfo->{cpus} || 1;
 
+my $def_sockets = $confdesc->{sockets}->{default};
+my $def_cores = $confdesc->{cores}->{default};
+my $def_memory = $confdesc->{memory}->{default};
+my $def_shares = $confdesc->{shares}->{default};
+
 foreach my $vmid (keys %$list) {
next if $opt_vmid && ($vmid ne $opt_vmid);
 
@@ -2597,16 +2602,19 @@ sub vmstatus {
$d->{maxdisk} = 0;
}
 
-   $d->{cpus} = ($conf->{sockets} || 1) * ($conf->{cores} || 1);
+   $d->{cpus} = ($conf->{sockets} || $def_sockets)
+   * ($conf->{cores} || $def_cores);
$d->{cpus} = $cpucount if $d->{cpus} > $cpucount;
$d->{cpus} = $conf->{vcpus} if $conf->{vcpus};
 
$d->{name} = $conf->{name} || "VM $vmid";
-   $d->{maxmem} = $conf->{memory} ? $conf->{memory}*(1024*1024) : 0;
+   $d->{maxmem} = ($conf->{memory} ? $conf->{memory} : $def_memory)
+   * (1024*1024);
 
if ($conf->{balloon}) {
$d->{balloon_min} = $conf->{balloon}*(1024*1024);
-   $d->{shares} = defined($conf->{shares}) ? $conf->{shares} : 1000;
+   $d->{shares} = defined($conf->{shares}) ? $conf->{shares}
+   : $def_shares;
}
 
$d->{uptime} = 0;
-- 
2.11.0


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


Re: [pve-devel] [PATCH manager 1/2] ui: pveWindowEdit: allow sane onlineHelp specification for edit windows

2017-10-17 Thread Emmanuel Kasper
On 10/17/2017 02:29 PM, Thomas Lamprecht wrote:
> instead of heuristically choosing the onlineHelp entry from our first
> item prefer the one we have in our config, if noone the fallback to
> the old heuristic.
> 
> Signed-off-by: Thomas Lamprecht 
> ---
>  www/manager6/window/Edit.js | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/window/Edit.js b/www/manager6/window/Edit.js
> index 9a026683..356946ed 100644
> --- a/www/manager6/window/Edit.js
> +++ b/www/manager6/window/Edit.js
> @@ -272,10 +272,11 @@ Ext.define('PVE.window.Edit', {
>   me.buttons = [ submitBtn, resetBtn ];
>   }
>  
> - if (items[0].onlineHelp) {
> + var onlineHelp = me.onlineHelp || items[0].onlineHelp;

if you had  'onlineHelp' as a new PVE.window.Edit property, then we
should document it in the Window Edit body with a default value,
similar to other PVE enhancements we have there

// set to true if you want an Remove button (instead of Create)
isRemove: false

otherwise users of the Class can only see which it's possible to set an
onlineHelpe by looking at initComponent, which is long here



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


Re: [pve-devel] [PATCH manager 7/7] ui: lxc: add 'more' button with HA manage menu item to panel

2017-10-16 Thread Emmanuel Kasper
On 10/11/2017 12:09 PM, Thomas Lamprecht wrote:
> Move the remove button into the more button and add a 'Manage HA'
> button there, mirroring the changes from the qemu panel.
> 
> Allows to add an unmanaged CT to HA or to edit the HA settings of a
> managed one.
> 
> Fixes: #1518
> Signed-off-by: Thomas Lamprecht 
> ---
>  www/manager6/lxc/Config.js | 42 ++
>  1 file changed, 30 insertions(+), 12 deletions(-)
> 
> diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
> index d5a6ff7c..4dde5805 100644
> --- a/www/manager6/lxc/Config.js
> +++ b/www/manager6/lxc/Config.js
> @@ -98,16 +98,34 @@ Ext.define('PVE.lxc.Config', {
>   iconCls: 'fa fa-send-o'
>   });
>  
> - var removeBtn = Ext.create('PVE.button.Button', {
> - text: gettext('Remove'),
> - disabled: !caps.vms['VM.Allocate'],
> - handler: function() {
> - Ext.create('PVE.window.SafeDestroy', {
> - url: base_url,
> - item: { type: 'CT', id: vmid }
> - }).show();
> - },
> - iconCls: 'fa fa-trash-o'
> + var moreBtn = Ext.create('PVE.button.Button', {
> + text: gettext('More'),
> + menu: { items: [
> + {
> + iconCls: 'fa fa-heartbeat ',
> + hidden: !caps.nodes['Sys.Console'],
> + text: gettext('Manage HA'),
> + handler: function() {
> + var ha = me.pveSelNode.data.hastate;
> + Ext.create('PVE.ha.VMResourceEdit', {
> + vmid: vmid,
> + isCreate: (!ha || ha === 'unmanaged')
> + }).show();
> + }
> + },

I think that in 6/7 and 7/7 we're missing a guestType parameter to pass.

This has the effect that all new created HA resources have the label
'VM' next to their pveGuestIDSelector, including containers.


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


Re: [pve-devel] [PATCH manager 0/7] WebUI: make HA management easier

2017-10-16 Thread Emmanuel Kasper


On 10/16/2017 01:48 PM, Thomas Lamprecht wrote:
> On 10/16/2017 01:39 PM, Wolfgang Bumiller wrote:
>> On Wed, Oct 11, 2017 at 12:09:40PM +0200, Thomas Lamprecht wrote:
>>> First two patches make adding a new services over DC->HA->Add more
>>> confortable by switching out the simple VMID integer spinner with a
>>> combobox grid showing more details for each VM/CT, addressing #1517
>>> Third one is a small cleanup patch.
>>>
>>> And the rest addresses #1518.
>>> We add a 'More' Button to the VM and CT Config Panel (its base panel)
>>> and move all buttons which may result in config changes there.
>>> After that we have separated power/migrate actions from system
>>> affecting actions (clone, remove, convert to template, HA).
>>>
>>> Thomas Lamprecht (7):
>>>   ui: add VM ComboSelector
>>>   ui: ha: use vmComboSelector when adding new resource
>>>   ui: ha: make vote warning shorter
>>>   ui: add PVE.menu.Item
>>>   ui: qemu: combine system changing buttons
>>>   ui: qemu: add HA manage menu item to panel
>>>   ui: lxc: add 'more' button with HA manage menu item to panel
>>
>> Now we have:
>> LXC:  [Start] [Shutdown] [More] [Migrate] [Console] [Help]
>> VM:   [Start] [Shutdown] [Migrate] [More] [Console] [Help]
>>
> 
> The different ordering is clearly an error of mine, sorry, LXC
> was intended to have the same ordering:
> 
>> LXC:  [Start] [Shutdown|Reset] [Migrate] [More] [Console] [Help]
>> VM:   [Start] [Shutdown|Reset] [Migrate] [More] [Console] [Help]
> 
>> I'd rather have:
>> Both: [Start] [Shutdown] [Migrate] [Console] [More] [Help]
>> Because a button named 'more' should be at the end rather than somewhere
>> in the middle.
>>
> 
> I initially did not want to change the position of the Console and
> Help button as they are there for a long time (at least Console).
> 
> But your proposal is OK for me too, Dominik/Emanuel any opinion
> on this?

it makes more sense to have the 'More' button at the end of list for
consistency of the ui with what most other ui do
(the number one rule in web design if I remember is that people are
spending most of their time on other websites than yours :)

your concern about not changing the position of the Console is
legitimate, and my own muscle memory makes me bring the mouse on the
right end of the button list when I want to get a console button..

However if is the button is a bit more on the left, or a bit more on the
right does not matter as the button is very close to its former position.


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


[pve-devel] [PATCH qemu v3 4/5] Provides a qemu-system-x86 virtual package

2017-10-16 Thread Emmanuel Kasper
This allows adding additional debian packages on pve hosts
which depends on a qemu binary being installed.

The following install paths were tested:

 * install of proxmox-ve on debian systems with standard package
 set:  works as expected

 * install of proxmox-ve on debian having the debian qemu package
 installed: refused by the package manager as expected, until
 qemu, qemu-system-x86, libspice-server1 are deinstalled

 * manual install of qemu-system-x86 after proxmox-ve
 is installed: refused by the package manager as expected, until
 libspice-server1 is installed. If libspice-server1 is installed
 then proxmox-ve is deinstalled.

 * install of packages depending on qemu-system-x86
 having proxmox-ve installed: thoses packages are installed as
 expected, no conflict
---
 debian/control|  5 -
 debian/pve-qemu-kvm.links | 11 +++
 debian/rules  |  3 ---
 3 files changed, 15 insertions(+), 4 deletions(-)
 create mode 100644 debian/pve-qemu-kvm.links

diff --git a/debian/control b/debian/control
index 4a55323..f7b3aee 100644
--- a/debian/control
+++ b/debian/control
@@ -51,10 +51,13 @@ Conflicts: kvm,
pve-qemu-kvm-2.6.18,
qemu,
qemu-kvm,
+   qemu-system-x86,
qemu-utils,
-Provides: qemu-utils,
+Provides: qemu-system-x86,
+  qemu-utils,
 Replaces: pve-kvm,
   pve-qemu-kvm-2.6.18,
+  qemu-system-x86,
   qemu-utils,
 Description: Full virtualization on x86 hardware
  Using KVM, one can run multiple virtual PCs, each running unmodified Linux or
diff --git a/debian/pve-qemu-kvm.links b/debian/pve-qemu-kvm.links
new file mode 100644
index 000..8749a89
--- /dev/null
+++ b/debian/pve-qemu-kvm.links
@@ -0,0 +1,11 @@
+usr/bin/qemu-system-x86_64 usr/bin/kvm
+
+# qemu-system-i386 and qemu-system-x86_64 provides the same hardware emulation
+usr/bin/qemu-system-x86_64 usr/bin/qemu-system-i386
+
+# upstream provides a qemu man page,
+# we symlink to kvm for backward compatibility
+# and to qemu-system-{i386,x86_64} to fullfill our 'Provides: qemu-system-x86'
+usr/share/man/man1/qemu.1  usr/share/man/man1/kvm.1
+usr/share/man/man1/qemu.1  usr/share/man/man1/qemu-system-i386.1
+usr/share/man/man1/qemu.1  usr/share/man/man1/qemu-system-x86_64.1
diff --git a/debian/rules b/debian/rules
index 1114f99..9396228 100755
--- a/debian/rules
+++ b/debian/rules
@@ -86,9 +86,6 @@ install: build
# Add here commands to install the package into debian/pve-kvm.
$(MAKE) DESTDIR=$(destdir) install
 
-   mv $(destdir)/usr/bin/qemu-system-$(ARCH) $(destdir)/usr/bin/kvm
-   mv $(destdir)/usr/share/man/man1/qemu.1 
$(destdir)/usr/share/man/man1/kvm.1
-
# we do not need openbios files (sparc/ppc)
rm -rf $(destdir)/usr/share/kvm/openbios-*
# remove ppc files
-- 
2.11.0


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


Re: [pve-devel] [PATCH qemu v2 0/5] Provides a qemu-system-x86 virtual package

2017-10-16 Thread Emmanuel Kasper
> In general, looks good to me.
> 
> Upstream package provides also the following man pages[1]:
> /usr/share/man/man1/qemu-system-i386.1.gz
> /usr/share/man/man1/qemu-system-x86_64.1.gz

> Which we do not (we have only qemu), would it make sense
> to make a link to these?

yes makes sense, we should install symlinks for this, and not a qemu man
pages since neither we nor debian provides a qemu man page

I will send a new version of 4/5 covering this


> Additionally to this, would it be possible to remove the postinst?
> AFAIS, the single use for it was to allow the transition from
> keeping the ifup/down scripts in /etc/kvm and not /etc/qemu and
> that happened in PVE 2.2 (2012), so it should be safe to remove it
> for 5.1 as no direct upgrade from 2.2 to 5.1 is possible/
> recommended/...
> But that isn't really urgent and can be done later.
> 
> [1] https://packages.debian.org/de/stretch/amd64/qemu-system-x86/filelist

this should be addresses in another patch serie IMHO


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


Re: [pve-devel] Include dpkg-reconfigure in Makefile

2017-10-16 Thread Emmanuel Kasper
On 10/13/2017 08:13 AM, Thomas wrote:
> Hello!
> 
> How can I include /dpkg-reconfigure tzdata/ (Europe/Berlin) and
> /dpkg-reconfigure/ locales (de_DE.UTF-8) in the Makefile?
Hi Thomas

Not sure I understand your question because server specific setup is
usually not done with Make.

You should either set this it manually over ssh or with a configuration
management system like ansible / puppet.





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


Re: [pve-devel] [PATCH manager] fix updateStore destroy

2017-10-11 Thread Emmanuel Kasper
look goods to me

maybe we should have mentioned that this is needed for having the
'autoDestroy' store property working properly. Otherwise it is not clear
why we needed this in the pve context, as all updates store are unqueued
manually with

component.on('destroy', componentstore.stopUpdate);

and the like

On 10/11/2017 11:49 AM, Dominik Csapak wrote:
> the store never fires/gets a destroy event, thus it
> never stops the load_task and never unqueues itself in case
> the store gets destroyed but not explicitely stopped
> 
> with overriding the destroy method, this works now as intended
> 
> Signed-off-by: Dominik Csapak 
> ---
>  www/manager6/data/UpdateStore.js | 12 
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/www/manager6/data/UpdateStore.js 
> b/www/manager6/data/UpdateStore.js
> index 6be36303..a8bc9efe 100644
> --- a/www/manager6/data/UpdateStore.js
> +++ b/www/manager6/data/UpdateStore.js
> @@ -12,6 +12,13 @@ Ext.define('PVE.data.UpdateStore', {
>  
>  isStopped: true,
>  
> +destroy: function() {
> + var me = this;
> + me.load_task.cancel();
> + PVE.data.UpdateQueue.unqueue(me);
> + me.callParent();
> +},
> +
>  constructor: function(config) {
>   var me = this;
>  
> @@ -56,9 +63,6 @@ Ext.define('PVE.data.UpdateStore', {
>  
>   me.callParent([config]);
>  
> - me.on('destroy', function() {
> - load_task.cancel();
> - PVE.data.UpdateQueue.unqueue(me);
> - });
> + me.load_task = load_task;
>  }
>  });
> 

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


[pve-devel] [PATCH qemu v2 2/5] Install userspace utilities and UEFI roms via dh_install

2017-10-11 Thread Emmanuel Kasper
---
 debian/pve-qemu-kvm.install |  9 +
 debian/rules| 12 +---
 2 files changed, 10 insertions(+), 11 deletions(-)
 create mode 100644 debian/pve-qemu-kvm.install

diff --git a/debian/pve-qemu-kvm.install b/debian/pve-qemu-kvm.install
new file mode 100644
index 000..0d9a3cb
--- /dev/null
+++ b/debian/pve-qemu-kvm.install
@@ -0,0 +1,9 @@
+# install the userspace utilities
+vma usr/bin/
+debian/kvm-ifup etc/kvm/
+debian/kvm-ifdown etc/kvm/
+
+#install ovmf uefi rom
+debian/OVMF_CODE-pure-efi.fd usr/share/kvm/
+debian/OVMF_VARS-pure-efi.fd usr/share/kvm/
+
diff --git a/debian/rules b/debian/rules
index 28723df..a6deceb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -89,16 +89,6 @@ install: build
mv $(destdir)/usr/bin/qemu-system-$(ARCH) $(destdir)/usr/bin/kvm
mv $(destdir)/usr/share/man/man1/qemu.1 
$(destdir)/usr/share/man/man1/kvm.1
 
-   # Install the userspace utilities
-   install -s -m 0755 vma $(destdir)/usr/bin/
-
-   install -D -m 0755 $(CURDIR)/debian/kvm-ifup $(destdir)/etc/kvm/kvm-ifup
-   install -D -m 0755 $(CURDIR)/debian/kvm-ifdown 
$(destdir)/etc/kvm/kvm-ifdown
-
-   #install ovmf uefi rom
-   install -D -m 0644 $(CURDIR)/debian/OVMF_CODE-pure-efi.fd 
$(destdir)/usr/share/kvm/OVMF_CODE-pure-efi.fd
-   install -D -m 0644 $(CURDIR)/debian/OVMF_VARS-pure-efi.fd 
$(destdir)/usr/share/kvm/OVMF_VARS-pure-efi.fd
-
# we do not need openbios files (sparc/ppc)
rm -rf $(destdir)/usr/share/kvm/openbios-*
# remove ppc files
@@ -127,7 +117,7 @@ binary-arch: build install
dh_installchangelogs
dh_installdocs
dh_installexamples
-#  dh_install
+   dh_install
 #  dh_installmenu
 #  dh_installdebconf
 #  dh_installlogrotate
-- 
2.11.0


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


[pve-devel] [PATCH qemu v2 3/5] Bump dephelper compatibility level to 10

2017-10-11 Thread Emmanuel Kasper
The debian package content was found to be the same
with diffoscope. No functional change.
---
 debian/compat  | 2 +-
 debian/control | 2 +-
 debian/rules   | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/debian/compat b/debian/compat
index 7ed6ff8..f599e28 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-5
+10
diff --git a/debian/control b/debian/control
index 68ba534..4a55323 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: extra
 Maintainer: Proxmox Support Team 
 Build-Depends: autotools-dev,
check,
-   debhelper (>= 5),
+   debhelper (>= 10),
glusterfs-common (>= 3.5.2-1),
libacl1-dev,
libaio-dev,
diff --git a/debian/rules b/debian/rules
index a6deceb..1114f99 100755
--- a/debian/rules
+++ b/debian/rules
@@ -114,7 +114,8 @@ binary-indep: build install
 binary-arch: build install
dh_testdir
dh_testroot
-   dh_installchangelogs
+   # exclude historic Changelog file, which stops at release 0.14
+   dh_installchangelogs --exclude=Changelog
dh_installdocs
dh_installexamples
dh_install
-- 
2.11.0


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


[pve-devel] [PATCH qemu v2 4/5] Provides a qemu-system-x86 virtual package

2017-10-11 Thread Emmanuel Kasper
This allows adding additional debian packages on pve hosts
which depends on a qemu binary being installed.

The following install paths were tested:

 * install of proxmox-ve on debian systems with standard package
 set:  works as expected

 * install of proxmox-ve on debian having the debian qemu package
 installed: refused by the package manager as expected, until
 qemu, qemu-system-x86, libspice-server1 are deinstalled

 * manual install of qemu-system-x86 after proxmox-ve
 is installed: refused by the package manager as expected, until
 libspice-server1 is installed. If libspice-server1 is installed
 then proxmox-ve is deinstalled.

 * install of packages depending on qemu-system-x86
 having proxmox-ve installed: thoses packages are installed as
 expected, no conflict
---
 debian/control| 5 -
 debian/pve-qemu-kvm.links | 4 
 debian/rules  | 3 ---
 3 files changed, 8 insertions(+), 4 deletions(-)
 create mode 100644 debian/pve-qemu-kvm.links

diff --git a/debian/control b/debian/control
index 4a55323..f7b3aee 100644
--- a/debian/control
+++ b/debian/control
@@ -51,10 +51,13 @@ Conflicts: kvm,
pve-qemu-kvm-2.6.18,
qemu,
qemu-kvm,
+   qemu-system-x86,
qemu-utils,
-Provides: qemu-utils,
+Provides: qemu-system-x86,
+  qemu-utils,
 Replaces: pve-kvm,
   pve-qemu-kvm-2.6.18,
+  qemu-system-x86,
   qemu-utils,
 Description: Full virtualization on x86 hardware
  Using KVM, one can run multiple virtual PCs, each running unmodified Linux or
diff --git a/debian/pve-qemu-kvm.links b/debian/pve-qemu-kvm.links
new file mode 100644
index 000..7088a58
--- /dev/null
+++ b/debian/pve-qemu-kvm.links
@@ -0,0 +1,4 @@
+usr/bin/qemu-system-x86_64 usr/bin/kvm
+# qemu-system-i386 and qemu-system-x86_64 provides the same hardware emulation
+usr/bin/qemu-system-x86_64 usr/bin/qemu-system-i386
+usr/share/man/man1/qemu.1  usr/share/man/man1/kvm.1
diff --git a/debian/rules b/debian/rules
index 1114f99..9396228 100755
--- a/debian/rules
+++ b/debian/rules
@@ -86,9 +86,6 @@ install: build
# Add here commands to install the package into debian/pve-kvm.
$(MAKE) DESTDIR=$(destdir) install
 
-   mv $(destdir)/usr/bin/qemu-system-$(ARCH) $(destdir)/usr/bin/kvm
-   mv $(destdir)/usr/share/man/man1/qemu.1 
$(destdir)/usr/share/man/man1/kvm.1
-
# we do not need openbios files (sparc/ppc)
rm -rf $(destdir)/usr/share/kvm/openbios-*
# remove ppc files
-- 
2.11.0


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


[pve-devel] [PATCH qemu v2 5/5] Add a 'Conflicts' with qemu-system-common from Debian

2017-10-11 Thread Emmanuel Kasper
Both qemu-system-common and our pve-qemu-kvm package install the
file /usr/bin/virtfs-proxy-helper.

Since qemu-system-common does not have reverse dependencies in Debian for
packages besides  qemu-system-, and ovmf, which we don't want to
install anyway, we do not need a 'Provides' for it.
---
 debian/control | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/control b/debian/control
index f7b3aee..22cdd47 100644
--- a/debian/control
+++ b/debian/control
@@ -51,6 +51,7 @@ Conflicts: kvm,
pve-qemu-kvm-2.6.18,
qemu,
qemu-kvm,
+   qemu-system-common,
qemu-system-x86,
qemu-utils,
 Provides: qemu-system-x86,
-- 
2.11.0


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


[pve-devel] [PATCH qemu v2 0/5] Provides a qemu-system-x86 virtual package

2017-10-11 Thread Emmanuel Kasper
This will allow the installation of extra packages requiring a qemu binary
Bigger use case is libguestfs0 and libguestfs-tools , this has been asked
in a few different forum threads
libguestfs-tools allow to inspect and edit disk images of offline guests
and do not require libvirt domains to be used.

Patches 1-3 is just for refactoring / modernizing the qemu packaging
Patch 4 has the real change
Patch 5 is an optional bug fix

We do not take special care for aarch64, as Thomas said this would
probably happen in a package with a different name, which could then
have its own  .links file

Changes since V1:
 * move symlinks to new file pve-qemu-kvm.links

Changes since RFC:
 * do not rename the qemu binary, but add a kvm symlink to it
  * do not rename the qemu man page, but add kvm symlint to it
  * add a symlink from qemu-system-i386 to qemu-system-x86_64 to better
  match the Debian package we 'Provides'.

Emmanuel Kasper (5):
  Remove deprecated dh_clean -k
  Install userspace utilities and UEFI roms via dh_install
  Bump dephelper compatibility level to 10
  Provides a qemu-system-x86 virtual package
  Add a 'Conflicts' with qemu-system-common from Debian

 debian/compat   |  2 +-
 debian/control  |  8 ++--
 debian/pve-qemu-kvm.install |  9 +
 debian/pve-qemu-kvm.links   |  4 
 debian/rules| 20 
 5 files changed, 24 insertions(+), 19 deletions(-)
 create mode 100644 debian/pve-qemu-kvm.install
 create mode 100644 debian/pve-qemu-kvm.links

-- 
2.11.0


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


[pve-devel] [PATCH qemu v2 1/5] Remove deprecated dh_clean -k

2017-10-11 Thread Emmanuel Kasper
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 98637c7..28723df 100755
--- a/debian/rules
+++ b/debian/rules
@@ -80,7 +80,7 @@ endif
 install: build
dh_testdir
dh_testroot
-   dh_clean -k
+   dh_prep
dh_installdirs
 
# Add here commands to install the package into debian/pve-kvm.
-- 
2.11.0


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


[pve-devel] [PATCH storage] ISCSIPlugin: Use long options for readability

2017-10-09 Thread Emmanuel Kasper
We otherwise use the long options everywhere in the plugin.
This will build the following command:

iscsiadm  --mode session --sid 1 --rescan
Rescanning session [sid: 1, target: xxx, portal: yyy]
---
 PVE/Storage/ISCSIPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Storage/ISCSIPlugin.pm b/PVE/Storage/ISCSIPlugin.pm
index 326de9d..aef8675 100644
--- a/PVE/Storage/ISCSIPlugin.pm
+++ b/PVE/Storage/ISCSIPlugin.pm
@@ -136,7 +136,7 @@ sub iscsi_session_rescan {
 }
 
 foreach my $session (@$session_list) {
-   my $cmd = [$ISCSIADM, '--mode', 'session', '-r', $session, '-R'];
+   my $cmd = [$ISCSIADM, '--mode', 'session', '--sid', $session, 
'--rescan'];
eval { run_command($cmd, outfunc => sub {}); };
warn $@ if $@;
 }
-- 
2.11.0


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


Re: [pve-devel] [PATCH manager] fix #1516: fix mouse-scrolling of overflowhandlers in firefox

2017-10-05 Thread Emmanuel Kasper
On 10/04/2017 10:04 AM, Dominik Csapak wrote:
> this is a workaround for scrolling in toolbars, etc. in firefox with the
> mouse
> 
> while the result is not very "pretty", it maintains the old behaviour
> for all other browsers and makes it work in firefox
> 
> we can drop this when we update to a new extjs release

looks good to me and works as expected

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


[pve-devel] [PATCH manager v5 7/8] Update VM SCSI controller type after OS selection in Wizard

2017-10-05 Thread Emmanuel Kasper
This was done previously without any kind of user visible feedback, so users
would not know that they had a Virtio SCSI controller as default controller
for Linux VMs.
---
rebase after changes in 5/8
 www/manager6/qemu/CreateWizard.js |  5 -
 www/manager6/qemu/OSDefaults.js   |  2 +-
 www/manager6/qemu/OSTypeEdit.js   | 10 +-
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/www/manager6/qemu/CreateWizard.js 
b/www/manager6/qemu/CreateWizard.js
index 954b8ef0..c508bb7f 100644
--- a/www/manager6/qemu/CreateWizard.js
+++ b/www/manager6/qemu/CreateWizard.js
@@ -1,7 +1,6 @@
 Ext.define('PVE.qemu.CreateWizard', {
 extend: 'PVE.window.Wizard',
 alias: 'widget.pveQemuCreateWizard',
-qemuScsiController: undefined,
 
 controller: {
 
@@ -167,10 +166,6 @@ Ext.define('PVE.qemu.CreateWizard', {
var nodename = kv.nodename;
delete kv.nodename;
 
-   if (me.qemuScsiController && !kv.scsihw) {
-   kv.scsihw = me.qemuScsiController;
-   }
-
PVE.Utils.API2Request({
url: '/nodes/' + nodename + '/qemu',
waitMsgTarget: me,
diff --git a/www/manager6/qemu/OSDefaults.js b/www/manager6/qemu/OSDefaults.js
index d47b9d01..d6f733a8 100644
--- a/www/manager6/qemu/OSDefaults.js
+++ b/www/manager6/qemu/OSDefaults.js
@@ -66,7 +66,7 @@ Ext.define('PVE.qemu.OSDefaults', {
pveOS: 'w2k',
parent : 'generic',
networkCard: 'rtl8139',
-   scsihw: 'lsi'
+   scsihw: ''
});
// https://pve.proxmox.com/wiki/Windows_XP_Guest_Notes
addOS({
diff --git a/www/manager6/qemu/OSTypeEdit.js b/www/manager6/qemu/OSTypeEdit.js
index 1235ddfd..27b0c40c 100644
--- a/www/manager6/qemu/OSTypeEdit.js
+++ b/www/manager6/qemu/OSTypeEdit.js
@@ -27,7 +27,7 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
 
me.setWidget('pveBusSelector', targetValues.busType);
me.setWidget('pveNetworkCardSelector', targetValues.networkCard);
-   me.setWizardHiddenValue('qemuScsiController', targetValues.scsihw);
+   me.setWidget('field[name=scsihw]', targetValues.scsihw);
},
setWidget: function(widget, newValue) {
// changing a widget is safe only if ComponentQuery.query returns us
@@ -38,14 +38,6 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
} else {
throw 'non unique widget :' + widget + ' in Wizard';
}
-   },
-   setWizardHiddenValue: function(property, newValue) {
-   var wizards = Ext.ComponentQuery.query('pveQemuCreateWizard ');
-   if (wizards.length === 1) {
-   wizards[0][property] = newValue;
-   } else {
-   throw 'non unique wizard, unable to set ' + property;
-   }
}
 },
 
-- 
2.11.0


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


[pve-devel] [PATCH manager v5 6/8] Update VM SCSI type based on iothread value when inside the wizard

2017-10-05 Thread Emmanuel Kasper
We keep the same logic as before: once the iothread option is selected,
the SCSI controller is switched to virtio-scsi-single, until iothread
is unselected again.
---
rebase after 5/8 changed

 www/manager6/qemu/HDEdit.js | 21 +
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index b6f08080..2b860d8f 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -74,6 +74,15 @@ Ext.define('PVE.qemu.HDInputPanel', {
me.hdsizesel.setVisible(true);
}
}
+   },
+   'field[name=iothread]' : {
+   change: function(f, value) {
+   if (!this.getView().insideWizard) {
+   return;
+   }
+   var vmScsiType = value ? 'virtio-scsi-single': 
'virtio-scsi-pci';
+   this.lookupReference('scsiController').setValue(vmScsiType);
+   }
}
}
 },
@@ -116,10 +125,6 @@ Ext.define('PVE.qemu.HDInputPanel', {
 
if (values.iothread) {
me.drive.iothread = 'on';
-   // do not silently change a VM-wide option after creating it
-   if (me.insideWizard) {
-   params.scsihw = 'virtio-scsi-single';
-   }
} else {
delete me.drive.iothread;
}
@@ -130,6 +135,10 @@ Ext.define('PVE.qemu.HDInputPanel', {
delete me.drive.cache;
}
 
+   if (values.scsihw) {
+   params.scsihw = values.scsihw;
+   }
+
params[confid] = PVE.Parser.printQemuDrive(me.drive);
 
return params;
@@ -197,10 +206,14 @@ Ext.define('PVE.qemu.HDInputPanel', {
vmconfig: me.insideWizard ? {ide2: 'cdrom'} : {}
});
me.column1.push(me.bussel);
+
me.scsiController = Ext.create('Ext.form.field.Display', {
+   name: 'scsihw',
fieldLabel: gettext('SCSI Controller'),
reference: 'scsiController',
renderer: PVE.Utils.render_scsihw,
+   // do not change a VM wide option after creation
+   submitValue: me.insideWizard,
hidden: true
});
me.column1.push(me.scsiController);
-- 
2.11.0


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


[pve-devel] [PATCH manager v5 5/8] Add a field to show which SCSI controller type we are currently using

2017-10-05 Thread Emmanuel Kasper
We use the field label 'SCSI Controller'. 'Type' is redundant, otherwise
we would have Network Card Type, Display Type, Network Card type, etc ...
---
changes since v4:
 * rename the field label to SCSI Controller, and the associated
  component reference to scsiController.

 www/manager6/qemu/HDEdit.js  | 15 ---
 www/manager6/qemu/Options.js |  2 +-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 8a415d8b..b6f08080 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -24,11 +24,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
this.lookup('iothread').setValue(false);
}
 
-   var allowDiscard = value.match(/^scsi/);
-   this.lookup('discard').setDisabled(!allowDiscard);
-   if (!allowDiscard) {
+   var scsi = value.match(/^scsi/);
+   this.lookup('discard').setDisabled(!scsi);
+   if (!scsi) {
this.lookup('discard').setValue(false);
}
+   this.lookup('scsiController').setVisible(scsi);
},
 
control: {
@@ -141,6 +142,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
 
if (me.bussel) {
me.bussel.setVMConfig(vmconfig);
+   me.scsiController.setValue(vmconfig.scsihw);
}
if (me.unusedDisks) {
var disklist = [];
@@ -195,6 +197,13 @@ Ext.define('PVE.qemu.HDInputPanel', {
vmconfig: me.insideWizard ? {ide2: 'cdrom'} : {}
});
me.column1.push(me.bussel);
+   me.scsiController = Ext.create('Ext.form.field.Display', {
+   fieldLabel: gettext('SCSI Controller'),
+   reference: 'scsiController',
+   renderer: PVE.Utils.render_scsihw,
+   hidden: true
+   });
+   me.column1.push(me.scsiController);
}
 
if (me.unused) {
diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js
index 9dc36d70..b5d32537 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -175,7 +175,7 @@ Ext.define('PVE.qemu.Options', {
} : undefined
},
scsihw: {
-   header: gettext('SCSI Controller Type'),
+   header: gettext('SCSI Controller'),
editor: caps.vms['VM.Config.Options'] ? 'PVE.qemu.ScsiHwEdit' : 
undefined,
renderer: PVE.Utils.render_scsihw,
defaultValue: ''
-- 
2.11.0


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


Re: [pve-devel] [PATCH manager v3 5/8] Add a field to show which SCSI controller type we are currently using

2017-10-05 Thread Emmanuel Kasper
On 10/05/2017 11:25 AM, Thomas Lamprecht wrote:
> On 09/28/2017 03:10 PM, Emmanuel Kasper wrote:
>> On 09/27/2017 11:27 AM, Thomas Lamprecht wrote:
>>> On 09/26/2017 02:17 PM, Emmanuel Kasper wrote:
>>>> ---
>>>>   www/manager6/qemu/HDEdit.js | 15 ---
>>>>   1 file changed, 12 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
>>>> index 8a415d8b..075ad667 100644
>>>> --- a/www/manager6/qemu/HDEdit.js
>>>> +++ b/www/manager6/qemu/HDEdit.js
>>>> @@ -24,11 +24,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
>>>>   this.lookup('iothread').setValue(false);
>>>>   }
>>>>   -    var allowDiscard = value.match(/^scsi/);
>>>> -    this.lookup('discard').setDisabled(!allowDiscard);
>>>> -    if (!allowDiscard) {
>>>> +    var scsi = value.match(/^scsi/);
>>>> +    this.lookup('discard').setDisabled(!scsi);
>>>> +    if (!scsi) {
>>>>   this.lookup('discard').setValue(false);
>>>>   }
>>>> +    this.lookup('scsiType').setVisible(scsi);
>>>>   },
>>>>     control: {
>>>> @@ -141,6 +142,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
>>>>     if (me.bussel) {
>>>>   me.bussel.setVMConfig(vmconfig);
>>>> +    me.scsiType.setValue(vmconfig.scsihw);
>>>>   }
>>>>   if (me.unusedDisks) {
>>>>   var disklist = [];I have renamed and the Display component to 
>>>> SCSI 
>>>> @@ -195,6 +197,13 @@ Ext.define('PVE.qemu.HDInputPanel', {
>>>>   vmconfig: me.insideWizard ? {ide2: 'cdrom'} : {}
>>>>   });
>>>>   me.column1.push(me.bussel);
>>>> +    me.scsiType = Ext.create('Ext.form.field.Display', {>
>>>> +    fieldLabel: gettext('Type'),
>>>
>>> Type is to general and not really true here (Type of what?).
>>> 'SCSI Controller' would match the scsihw edit window better
>>> and make it clearer why it disappears when something other
>>> than SCSI is selected, what do you think?
>>
>> The current gettext strings we have here are either 'SCSI Controller
>> Type' need to be wrapped on two lines in the Edit Window, or 'Type'
>>
> 
> So my proposal would then be to change 'SCSI Controller Type'
> to 'SCSI Controller'. 'Type' does not gives additional information for
> this we select a SCSI controller here and we do not have type appended
> to other fields, e.g., BIOS, Display.
> 
>> Since this 'Type' field is underneath the Bus Selector, appears only
>> when the SCSI controller is selected in the Bus Selector, and include
>> the string SCSI in all the cases that interess us (VirtIO SCSI), I think
>> 'Type' is enough.
>>
> 
> The user does not knows the set of possible values though, so he sees
> that SCSI appears with but there could be other options appearing to
> as he does not sees a list of all possible options. IMHO, this is not
> really user friendly. Also we would diverge from our strategy to avoid
> calling the same thing two different names in the UI, with your version.
> 

agreed, we should not use different names when refering the same
ressource (Dominik favours your proposition as well)

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


Re: [pve-devel] [PATCH qemu 1/2] Provides a qemu-system-x86 virtual package

2017-10-04 Thread Emmanuel Kasper
n 10/04/2017 04:10 PM, Thomas Lamprecht wrote:
> On 10/04/2017 03:53 PM, Emmanuel Kasper wrote:
>> This allows adding additional debian packages on pve hosts
>> which depends on those.
>>
>> The following install paths were tested:
>>
>>  * install of proxmox-ve on debian systems with standard package
>>  set:  works as expected
>>
>>  * install of proxmox-ve on debian having the debian qemu package
>>  installed: refused by the package manager as expected, until
>>  qemu, qemu-system-x86, libspice-server1 are deinstalled
>>
>>  * manual install of qemu-system-x86 after proxmox-ve
>>  is installed: refused by the package manager as expected, until
>>  proxmox-ve and dependencies are removed
>>
>>  * install of packages depending on qemu-system-x86
>>  having proxmox-ve installed: thoses packages are installed as
>>  expected, no conflict
>> ---
>>  debian/control | 5 -
>>  debian/rules   | 8 ++--
>>  2 files changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/debian/control b/debian/control
>> index 68ba534..c0ade16 100644
>> --- a/debian/control
>> +++ b/debian/control
>> @@ -51,10 +51,13 @@ Conflicts: kvm,
>> pve-qemu-kvm-2.6.18,
>> qemu,
>> qemu-kvm,
>> +   qemu-system-x86,
>> qemu-utils,
>> -Provides: qemu-utils,
>> +Provides: qemu-system-x86,
>> +  qemu-utils,
>>  Replaces: pve-kvm,
>>pve-qemu-kvm-2.6.18,
>> +  qemu-system-x86,
>>qemu-utils,
>>  Description: Full virtualization on x86 hardware
>>   Using KVM, one can run multiple virtual PCs, each running unmodified Linux 
>> or
>> diff --git a/debian/rules b/debian/rules
>> index 98637c7..5664fee 100755
>> --- a/debian/rules
>> +++ b/debian/rules
>> @@ -86,8 +86,12 @@ install: build
>>  # Add here commands to install the package into debian/pve-kvm.
>>  $(MAKE) DESTDIR=$(destdir) install
>>  
>> -mv $(destdir)/usr/bin/qemu-system-$(ARCH) $(destdir)/usr/bin/kvm
>> -mv $(destdir)/usr/share/man/man1/qemu.1 
>> $(destdir)/usr/share/man/man1/kvm.1
>> +dh_link usr/bin/qemu-system-$(ARCH) usr/bin/kvm
>> +# qemu-system-i386 and qemu-system-x86_64 provides the same hardware 
>> emulation
>> +ifeq ($(ARCH),x86_64)
>> +dh_link usr/bin/qemu-system-$(ARCH) usr/bin/qemu-system-i386
>> +endif
>> +dh_link usr/share/man/man1/qemu.1  usr/share/man/man1/kvm.1
> 
> What about adding a 'debian/pve-qemu-kvm.links' file with the following
> content:
> usr/bin/qemu-system-x86_64 usr/bin/kvm
> usr/bin/qemu-system-x86_64 usr/bin/qemu-system-i386
> usr/share/man/man1/qemu.1  usr/share/man/man1/kvm.1
> 
> We currently support only x86_64 so this should be OK, if we add another
> architecture we either just add the other links too or (preferred) add a
> new package with the same package source - e.g., pve-qemu-aarch64.

Well if there is a consensus that we should use
debian/pve-qemu-kvm.{links,install} files,  I am not opposed to it :)
I just created the symlinks in the debian/rule, so we could build a
package for aarch64  with this rule file.
If you plan to create a separate binary for aarch64, we can use indeed
the declarative dh synthax.

@Wolgang B: you seemed to prefer in your review of the RFC version of
this patch to have the symlinks created based on the value of $(ARCH) in
the rules file. Any opinion on the matter ?


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


[pve-devel] [PATCH qemu 0/2] Provides a qemu-system-x86 virtual package

2017-10-04 Thread Emmanuel Kasper
This will allow the installation of extra packages requiring a qemu binary
Bigger use case is libguestfs0 and libguestfs-tools , this has been asked
in a few different forum threads
libguestfs-tools allow to inspect and edit disk images of offline guests
and do not require libvirt domains to be used.

Changes since V1:
 * do not rename the qemu binary, but add a kvm symlink to it
 * do not rename the qemu man page, but add kvm symlint to it
 * add a symlink from qemu-system-i386 to qemu-system-x86_64 to better
 match the Debian package we 'Provides'.

While working on the dependencies I noticed, we had a file conflict with 
qemu-system-common which is addressed by the second patch

Example use cases:

virt-edit --add /path/to/disk_image /boot/grub/grub.cfg
virt-win-reg /path/to/disk/image "HKLM\SOFTWARE\Microsoft\Windows 
NT\CurrentVersion" ProductName
Windows 10 Enterprise Evaluation

See http://libguestfs.org/guestfs-faq.1.html for the relation between libguestfs
and libvirt.
Emmanuel Kasper (2):
  Provides a qemu-system-x86 virtual package
  Add a 'Conflicts' with qemu-system-common from Debian

 debian/control | 6 +-
 debian/rules   | 8 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

-- 
2.11.0


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


[pve-devel] [PATCH qemu 1/2] Provides a qemu-system-x86 virtual package

2017-10-04 Thread Emmanuel Kasper
This allows adding additional debian packages on pve hosts
which depends on those.

The following install paths were tested:

 * install of proxmox-ve on debian systems with standard package
 set:  works as expected

 * install of proxmox-ve on debian having the debian qemu package
 installed: refused by the package manager as expected, until
 qemu, qemu-system-x86, libspice-server1 are deinstalled

 * manual install of qemu-system-x86 after proxmox-ve
 is installed: refused by the package manager as expected, until
 proxmox-ve and dependencies are removed

 * install of packages depending on qemu-system-x86
 having proxmox-ve installed: thoses packages are installed as
 expected, no conflict
---
 debian/control | 5 -
 debian/rules   | 8 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 68ba534..c0ade16 100644
--- a/debian/control
+++ b/debian/control
@@ -51,10 +51,13 @@ Conflicts: kvm,
pve-qemu-kvm-2.6.18,
qemu,
qemu-kvm,
+   qemu-system-x86,
qemu-utils,
-Provides: qemu-utils,
+Provides: qemu-system-x86,
+  qemu-utils,
 Replaces: pve-kvm,
   pve-qemu-kvm-2.6.18,
+  qemu-system-x86,
   qemu-utils,
 Description: Full virtualization on x86 hardware
  Using KVM, one can run multiple virtual PCs, each running unmodified Linux or
diff --git a/debian/rules b/debian/rules
index 98637c7..5664fee 100755
--- a/debian/rules
+++ b/debian/rules
@@ -86,8 +86,12 @@ install: build
# Add here commands to install the package into debian/pve-kvm.
$(MAKE) DESTDIR=$(destdir) install
 
-   mv $(destdir)/usr/bin/qemu-system-$(ARCH) $(destdir)/usr/bin/kvm
-   mv $(destdir)/usr/share/man/man1/qemu.1 
$(destdir)/usr/share/man/man1/kvm.1
+   dh_link usr/bin/qemu-system-$(ARCH) usr/bin/kvm
+   # qemu-system-i386 and qemu-system-x86_64 provides the same hardware 
emulation
+ifeq ($(ARCH),x86_64)
+   dh_link usr/bin/qemu-system-$(ARCH) usr/bin/qemu-system-i386
+endif
+   dh_link usr/share/man/man1/qemu.1  usr/share/man/man1/kvm.1
 
# Install the userspace utilities
install -s -m 0755 vma $(destdir)/usr/bin/
-- 
2.11.0


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


[pve-devel] [PATCH qemu 2/2] Add a 'Conflicts' with qemu-system-common from Debian

2017-10-04 Thread Emmanuel Kasper
Both qemu-system-common and our pve-qemu-kvm package install the
file /usr/bin/virtfs-proxy-helper.

Since qemu-system-common does not have reverse dependencies in Debian for
packages besides  qemu-system-, and ovmf, which we don't want to
install anyway, we do not need a 'Provides' for it.
---
 debian/control | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/control b/debian/control
index c0ade16..8205ed7 100644
--- a/debian/control
+++ b/debian/control
@@ -51,6 +51,7 @@ Conflicts: kvm,
pve-qemu-kvm-2.6.18,
qemu,
qemu-kvm,
+   qemu-system-common,
qemu-system-x86,
qemu-utils,
 Provides: qemu-system-x86,
-- 
2.11.0


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


[pve-devel] [PATCH docs] Add a paragraph to explain how network models match use cases

2017-10-02 Thread Emmanuel Kasper
Also :
 * explain more clearly when PVE switched to persistent device naming. (5.0)
 * use eno1 instead of eno0 everywhere when refering to the first onboard device
 * use IP addresses from the range IPv4 Address Blocks for Documentation
 (rfc5737) instead of private IPv4 addresses when giving examples of public IPs
---
 pve-network.adoc | 101 ++-
 1 file changed, 62 insertions(+), 39 deletions(-)

diff --git a/pve-network.adoc b/pve-network.adoc
index beb69ae..5d53924 100644
--- a/pve-network.adoc
+++ b/pve-network.adoc
@@ -5,44 +5,32 @@ ifdef::wiki[]
 :pve-toplevel:
 endif::wiki[]
 
-{pve} uses a bridged networking model. Each host can have up to 4094
-bridges. Bridges are like physical network switches implemented in
-software. All VMs can share a single bridge, as if
-virtual network cables from each guest were all plugged into the same
-switch. But you can also create multiple bridges to separate network
-domains.
-
-For connecting VMs to the outside world, bridges are attached to
-physical network cards. For further flexibility, you can configure
-VLANs (IEEE 802.1q) and network bonding, also known as "link
-aggregation". That way it is possible to build complex and flexible
-virtual networks.
+Network configuration can be done either via the GUI, or by manually 
+editing the file `/etc/network/interfaces`, which contains the
+whole network configuration. The  `interfaces(5)` manual page contains the
+complete format description. All {pve} tools try hard to keep direct
+ user modifications, but using the GUI is still preferable, because it
+protects you from errors.
 
-Debian traditionally uses the `ifup` and `ifdown` commands to
-configure the network. The file `/etc/network/interfaces` contains the
-whole network setup. Please refer to to manual page (`man interfaces`)
-for a complete format description.
+Once the network is configured, you can use the Debian traditional tools 
`ifup` 
+and `ifdown` commands to bring interfaces up and down.
 
 NOTE: {pve} does not write changes directly to
 `/etc/network/interfaces`. Instead, we write into a temporary file
 called `/etc/network/interfaces.new`, and commit those changes when
 you reboot the node.
 
-It is worth mentioning that you can directly edit the configuration
-file. All {pve} tools tries hard to keep such direct user
-modifications. Using the GUI is still preferable, because it
-protect you from errors.
-
-
 Naming Conventions
 ~~
 
 We currently use the following naming conventions for device names:
 
-* New Ethernet devices: en*, systemd network interface names.
+* Ethernet devices: en*, systemd network interface names. This naming scheme is
+ used for new {pve} installations since version 5.0.
 
-* Legacy Ethernet devices: eth[N], where 0 ≤ N (`eth0`, `eth1`, ...)
-They are available when Proxmox VE has been updated by an earlier version.
+* Ethernet devices: eth[N], where 0 ≤ N (`eth0`, `eth1`, ...) This naming
+scheme is used for {pve} hosts which were installed before the 5.0
+release. When upgrading to 5.0, the names are kept as-is.
 
 * Bridge names: vmbr[N], where 0 ≤ N ≤ 4094 (`vmbr0` - `vmbr4094`)
 
@@ -52,8 +40,7 @@ They are available when Proxmox VE has been updated by an 
earlier version.
   separated by a period (`eno1.50`, `bond1.30`)
 
 This makes it easier to debug networks problems, because the device
-names implies the device type.
-
+name implies the device type.
 
 Systemd Network Interface Names
 ^^^
@@ -78,12 +65,46 @@ The most common patterns are:
 
 For more information see 
https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/[Predictable
 Network Interface Names].
 
+Choosing a network configuration
+
+
+Depending on your current network organization and your resources you can 
+choose either a bridged, routed, or masquerading networking setup.
+
+{pve} server in a private LAN, using an external gateway to reach the internet
+^^
+
+The *Bridged* model makes the most sense in this case, and this is also 
+the default mode on new {pve} installations.
+Each of your Guest system will have a virtual interface attached to the 
+{pve} bridge. This is similar in effect to having the Guest network card 
+directly connected to your LAN.
+
+{pve} server at hosting provider, with public IP ranges for Guests
+^^
+
+For this setup, you can use either a *Bridged* or *Routed* model, depending on
+what your provider allows.
+
+{pve} server at hosting provider, with a single public IP address
+^
+
+In that case the only way to get outgoing network accesses for your guest
+systems is to use *Masquerading*. For incoming network access to your guests, 
+you will need to configure 

Re: [pve-devel] [PATCH manager] fix #1510: do not scroll back to focus when view gets refreshed

2017-10-02 Thread Emmanuel Kasper
On 10/02/2017 02:53 PM, Thomas Lamprecht wrote:
> Seems to works good, the small code change you made to the
> original function looks also good to me:

> Reviewed-by: Thomas Lamprecht 

Fine for me too,  I tested this with IE11 and this works as expected.






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


[pve-devel] [PATCH manager v4 7/8] Update VM SCSI controller type after OS selection in Wizard

2017-10-02 Thread Emmanuel Kasper
This was done previously without any kind of user visible feedback, so users
would not know that they had a Virtio SCSI controller as default controller
for Linux VMs.
---
 www/manager6/qemu/CreateWizard.js |  5 -
 www/manager6/qemu/OSDefaults.js   |  2 +-
 www/manager6/qemu/OSTypeEdit.js   | 10 +-
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/www/manager6/qemu/CreateWizard.js 
b/www/manager6/qemu/CreateWizard.js
index 954b8ef0..c508bb7f 100644
--- a/www/manager6/qemu/CreateWizard.js
+++ b/www/manager6/qemu/CreateWizard.js
@@ -1,7 +1,6 @@
 Ext.define('PVE.qemu.CreateWizard', {
 extend: 'PVE.window.Wizard',
 alias: 'widget.pveQemuCreateWizard',
-qemuScsiController: undefined,
 
 controller: {
 
@@ -167,10 +166,6 @@ Ext.define('PVE.qemu.CreateWizard', {
var nodename = kv.nodename;
delete kv.nodename;
 
-   if (me.qemuScsiController && !kv.scsihw) {
-   kv.scsihw = me.qemuScsiController;
-   }
-
PVE.Utils.API2Request({
url: '/nodes/' + nodename + '/qemu',
waitMsgTarget: me,
diff --git a/www/manager6/qemu/OSDefaults.js b/www/manager6/qemu/OSDefaults.js
index d47b9d01..d6f733a8 100644
--- a/www/manager6/qemu/OSDefaults.js
+++ b/www/manager6/qemu/OSDefaults.js
@@ -66,7 +66,7 @@ Ext.define('PVE.qemu.OSDefaults', {
pveOS: 'w2k',
parent : 'generic',
networkCard: 'rtl8139',
-   scsihw: 'lsi'
+   scsihw: ''
});
// https://pve.proxmox.com/wiki/Windows_XP_Guest_Notes
addOS({
diff --git a/www/manager6/qemu/OSTypeEdit.js b/www/manager6/qemu/OSTypeEdit.js
index 1235ddfd..27b0c40c 100644
--- a/www/manager6/qemu/OSTypeEdit.js
+++ b/www/manager6/qemu/OSTypeEdit.js
@@ -27,7 +27,7 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
 
me.setWidget('pveBusSelector', targetValues.busType);
me.setWidget('pveNetworkCardSelector', targetValues.networkCard);
-   me.setWizardHiddenValue('qemuScsiController', targetValues.scsihw);
+   me.setWidget('field[name=scsihw]', targetValues.scsihw);
},
setWidget: function(widget, newValue) {
// changing a widget is safe only if ComponentQuery.query returns us
@@ -38,14 +38,6 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
} else {
throw 'non unique widget :' + widget + ' in Wizard';
}
-   },
-   setWizardHiddenValue: function(property, newValue) {
-   var wizards = Ext.ComponentQuery.query('pveQemuCreateWizard ');
-   if (wizards.length === 1) {
-   wizards[0][property] = newValue;
-   } else {
-   throw 'non unique wizard, unable to set ' + property;
-   }
}
 },
 
-- 
2.11.0


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


[pve-devel] [PATCH manager v4 8/8] Render full name of VirtIO Block controller

2017-10-02 Thread Emmanuel Kasper
This will hopefully reduce confusion with SCSI VirtIO controller
---
 www/manager6/form/BusTypeSelector.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/form/BusTypeSelector.js 
b/www/manager6/form/BusTypeSelector.js
index ae7c327e..8abdcf4b 100644
--- a/www/manager6/form/BusTypeSelector.js
+++ b/www/manager6/form/BusTypeSelector.js
@@ -10,7 +10,7 @@ Ext.define('PVE.form.BusTypeSelector', {
me.comboItems = [['ide', 'IDE'], ['sata', 'SATA']];
 
if (!me.noVirtIO) {
-   me.comboItems.push(['virtio', 'VirtIO']);
+   me.comboItems.push(['virtio', 'VirtIO Block']);
}
 
me.comboItems.push(['scsi', 'SCSI']);
-- 
2.11.0


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


[pve-devel] [PATCH manager v4 2/8] Remove unused noScsi parameter

2017-10-02 Thread Emmanuel Kasper
SCSI is a valid bus for Disks and CD drives, so it should always
be appear in the bus list.
---
 www/manager6/form/BusTypeSelector.js| 6 +-
 www/manager6/form/ControllerSelector.js | 6 +-
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/www/manager6/form/BusTypeSelector.js 
b/www/manager6/form/BusTypeSelector.js
index 9b9492fc..ae7c327e 100644
--- a/www/manager6/form/BusTypeSelector.js
+++ b/www/manager6/form/BusTypeSelector.js
@@ -4,8 +4,6 @@ Ext.define('PVE.form.BusTypeSelector', {
   
 noVirtIO: false,
 
-noScsi: false,
-
 initComponent: function() {
var me = this;
 
@@ -15,9 +13,7 @@ Ext.define('PVE.form.BusTypeSelector', {
me.comboItems.push(['virtio', 'VirtIO']);
}
 
-   if (!me.noScsi) {
-   me.comboItems.push(['scsi', 'SCSI']);
-   }
+   me.comboItems.push(['scsi', 'SCSI']);
 
me.callParent();
 }
diff --git a/www/manager6/form/ControllerSelector.js 
b/www/manager6/form/ControllerSelector.js
index 045e7d0d..14ad574e 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -13,8 +13,6 @@ Ext.define('PVE.form.ControllerSelector', {
 
 noVirtIO: false,
 
-noScsi: false,
-
 vmconfig: {}, // used to check for existing devices
 
 sortByPreviousUsage: function(vmconfig, controllerList) {
@@ -75,8 +73,7 @@ Ext.define('PVE.form.ControllerSelector', {
 
Ext.Array.each(clist, function(controller) {
var confid, i;
-   if ((controller === 'virtio' && me.noVirtIO) ||
-   (controller === 'scsi' && me.noScsi)) {
+   if (controller === 'virtio' && me.noVirtIO) {
return; //continue
}
me.down('field[name=controller]').setValue(controller);
@@ -106,7 +103,6 @@ Ext.define('PVE.form.ControllerSelector', {
name: 'controller',
value: PVE.qemu.OSDefaults.generic.busType,
noVirtIO: me.noVirtIO,
-   noScsi: me.noScsi,
allowBlank: false,
flex: 2,
listeners: {
-- 
2.11.0


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


[pve-devel] [PATCH manager v4 6/8] Update VM SCSI type based on iothread value when inside the wizard

2017-10-02 Thread Emmanuel Kasper
We keep the same logic as before: once the iothread option is selected,
the SCSI controller is switched to virtio-scsi-single, until iothread
is unselected again.
---
 www/manager6/qemu/HDEdit.js | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 075ad667..814097b1 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -74,6 +74,15 @@ Ext.define('PVE.qemu.HDInputPanel', {
me.hdsizesel.setVisible(true);
}
}
+   },
+   'field[name=iothread]' : {
+   change: function(f, value) {
+   if (!this.getView().insideWizard) {
+   return;
+   }
+   var vmScsiType = value ? 'virtio-scsi-single': 
'virtio-scsi-pci';
+   this.lookupReference('scsiType').setValue(vmScsiType);
+   }
}
}
 },
@@ -116,10 +125,6 @@ Ext.define('PVE.qemu.HDInputPanel', {
 
if (values.iothread) {
me.drive.iothread = 'on';
-   // do not silently change a VM-wide option after creating it
-   if (me.insideWizard) {
-   params.scsihw = 'virtio-scsi-single';
-   }
} else {
delete me.drive.iothread;
}
@@ -130,6 +135,10 @@ Ext.define('PVE.qemu.HDInputPanel', {
delete me.drive.cache;
}
 
+   if (values.scsihw) {
+   params.scsihw = values.scsihw;
+   }
+
params[confid] = PVE.Parser.printQemuDrive(me.drive);
 
return params;
@@ -198,9 +207,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
});
me.column1.push(me.bussel);
me.scsiType = Ext.create('Ext.form.field.Display', {
+   name: 'scsihw',
fieldLabel: gettext('Type'),
reference: 'scsiType',
renderer: PVE.Utils.render_scsihw,
+   // do not change a VM wide option after creation
+   submitValue: me.insideWizard,
hidden: true
});
me.column1.push(me.scsiType);
-- 
2.11.0


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


[pve-devel] [PATCH manager v4 1/8] Do not use 'autoselect' as a boolean when preselecting a bus

2017-10-02 Thread Emmanuel Kasper
The bus selector is displayed when we add a Hard Disk or CD Drive.
When it is displayed, we *always* preselect the next available
slot on the controller of our choice.
So this test is not needed.

We keep the test on the string value of 'autoselect' to select
a bus position when adding a CD Drive.
---
 www/manager6/form/ControllerSelector.js | 53 -
 www/manager6/qemu/HDEdit.js |  2 +-
 2 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/www/manager6/form/ControllerSelector.js 
b/www/manager6/form/ControllerSelector.js
index 002134ef..045e7d0d 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -58,37 +58,36 @@ Ext.define('PVE.form.ControllerSelector', {
var me = this;
 
me.vmconfig = Ext.apply({}, vmconfig);
-   if (autoSelect) {
-   var clist = ['ide', 'virtio', 'scsi', 'sata'];
-   if (autoSelect === 'cdrom') {
-   clist = ['ide', 'scsi', 'sata'];
-   if (!Ext.isDefined(me.vmconfig.ide2)) {
-   me.down('field[name=controller]').setValue('ide');
-   me.down('field[name=deviceid]').setValue(2);
-   return;
-   }
-   } else  {
-   // in most cases we want to add a disk to the same controller
-   // we previously used
-   clist = me.sortByPreviousUsage(me.vmconfig, clist);
+
+   var clist = ['ide', 'virtio', 'scsi', 'sata'];
+   if (autoSelect === 'cdrom') {
+   clist = ['ide', 'scsi', 'sata'];
+   if (!Ext.isDefined(me.vmconfig.ide2)) {
+   me.down('field[name=controller]').setValue('ide');
+   me.down('field[name=deviceid]').setValue(2);
+   return;
}
+   } else  {
+   // in most cases we want to add a disk to the same controller
+   // we previously used
+   clist = me.sortByPreviousUsage(me.vmconfig, clist);
+   }
 
-   Ext.Array.each(clist, function(controller) {
-   var confid, i;
-   if ((controller === 'virtio' && me.noVirtIO) ||
+   Ext.Array.each(clist, function(controller) {
+   var confid, i;
+   if ((controller === 'virtio' && me.noVirtIO) ||
(controller === 'scsi' && me.noScsi)) {
-   return; //continue
-   }
-   me.down('field[name=controller]').setValue(controller);
-   for (i = 0; i <= 
PVE.form.ControllerSelector.maxIds[controller]; i++) {
-   confid = controller + i.toString();
-   if (!Ext.isDefined(me.vmconfig[confid])) {
-   me.down('field[name=deviceid]').setValue(i);
-   return false; // break
-   }
+   return; //continue
+   }
+   me.down('field[name=controller]').setValue(controller);
+   for (i = 0; i <= PVE.form.ControllerSelector.maxIds[controller]; 
i++) {
+   confid = controller + i.toString();
+   if (!Ext.isDefined(me.vmconfig[confid])) {
+   me.down('field[name=deviceid]').setValue(i);
+   return false; // break
}
-   });
-   }
+   }
+   });
me.down('field[name=deviceid]').validate();
 },
 
diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index e7535f50..8a415d8b 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -140,7 +140,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
me.vmconfig = vmconfig;
 
if (me.bussel) {
-   me.bussel.setVMConfig(vmconfig, true);
+   me.bussel.setVMConfig(vmconfig);
}
if (me.unusedDisks) {
var disklist = [];
-- 
2.11.0


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


[pve-devel] [PATCH manager v4 4/8] Do not use the noVirtIO property to build the controller list

2017-10-02 Thread Emmanuel Kasper
This property is only used for CDEdit, so we can deduce this from
the fact that autoselect is set to 'cdrom'
---
 www/manager6/form/ControllerSelector.js | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/www/manager6/form/ControllerSelector.js 
b/www/manager6/form/ControllerSelector.js
index 15023a7a..1d1ca556 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -76,9 +76,6 @@ Ext.define('PVE.form.ControllerSelector', {
 
Ext.Array.each(clist, function(controller) {
var confid, i;
-   if (controller === 'virtio' && me.noVirtIO) {
-   return; //continue
-   }
bussel.setValue(controller);
for (i = 0; i <= PVE.form.ControllerSelector.maxIds[controller]; 
i++) {
confid = controller + i.toString();
-- 
2.11.0


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


[pve-devel] [PATCH manager v4 3/8] Save the components we found via down() in a variable for later reuse.

2017-10-02 Thread Emmanuel Kasper
---
 www/manager6/form/ControllerSelector.js | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/www/manager6/form/ControllerSelector.js 
b/www/manager6/form/ControllerSelector.js
index 14ad574e..15023a7a 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -58,11 +58,14 @@ Ext.define('PVE.form.ControllerSelector', {
me.vmconfig = Ext.apply({}, vmconfig);
 
var clist = ['ide', 'virtio', 'scsi', 'sata'];
+   var bussel = me.down('field[name=controller]');
+   var deviceid = me.down('field[name=deviceid]');
+
if (autoSelect === 'cdrom') {
clist = ['ide', 'scsi', 'sata'];
if (!Ext.isDefined(me.vmconfig.ide2)) {
-   me.down('field[name=controller]').setValue('ide');
-   me.down('field[name=deviceid]').setValue(2);
+   bussel.setValue('ide');
+   deviceid.setValue(2);
return;
}
} else  {
@@ -76,16 +79,16 @@ Ext.define('PVE.form.ControllerSelector', {
if (controller === 'virtio' && me.noVirtIO) {
return; //continue
}
-   me.down('field[name=controller]').setValue(controller);
+   bussel.setValue(controller);
for (i = 0; i <= PVE.form.ControllerSelector.maxIds[controller]; 
i++) {
confid = controller + i.toString();
if (!Ext.isDefined(me.vmconfig[confid])) {
-   me.down('field[name=deviceid]').setValue(i);
+   deviceid.setValue(i);
return false; // break
}
}
});
-   me.down('field[name=deviceid]').validate();
+   deviceid.validate();
 },
 
 initComponent: function() {
-- 
2.11.0


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


[pve-devel] [PATCH manager v4 0/8] Display the SCSI controller type when adding a new disk

2017-10-02 Thread Emmanuel Kasper
Since we switched to the SCSI controller in the Wizard as the recommended 
controller
for hard disks (using VirtIO scsi in the backend) it was not clear for users
that they were actually using a paravirtualized driver.

An example of user confusion:
https://forum.proxmox.com/threads/proxmox-hypervisor-scsi-or-virtio.36506/#post-179056
The problem was also seen in trainings.

changes since V3:

 * Patch 4: infer that we don't need VirtIO in the controller list, as 
 autoSelect is set to 'cdrom'.  I kept the 'autoSelect' function parameter, as
 I am not sure of the safety of changing the IDE bus position for CD ROM drives.
 * Patch 6: do not suspend change events, use temp variable to store SCSI type
 * Patch 7-8: fix long lines in commit log


Emmanuel Kasper (8):
  Do not use 'autoselect' as a boolean when preselecting a bus
  Remove unused noScsi parameter
  Save the components we found via down() in a variable for later reuse.
  Do not use the noVirtIO property to build the controller list
  Add a field to show which SCSI controller type we are currently using
  Update VM SCSI type based on iothread value when inside the wizard
  Update VM SCSI controller type after OS selection in Wizard
  Render full name of VirtIO Block controller

 www/manager6/form/BusTypeSelector.js|  8 ++---
 www/manager6/form/ControllerSelector.js | 59 +++--
 www/manager6/qemu/CreateWizard.js   |  5 ---
 www/manager6/qemu/HDEdit.js | 37 -
 www/manager6/qemu/OSDefaults.js |  2 +-
 www/manager6/qemu/OSTypeEdit.js | 10 +-
 6 files changed, 60 insertions(+), 61 deletions(-)

-- 
2.11.0


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


Re: [pve-devel] [PATCH manager v3 1/8] Do not use 'autoselect' as a boolean when preselecting a bus

2017-09-28 Thread Emmanuel Kasper
On 09/27/2017 10:47 AM, Thomas Lamprecht wrote:
> On 09/26/2017 02:17 PM, Emmanuel Kasper wrote:
>> The bus selector is displayed when we add a Hard Disk or CD Drive.
>> When it is displayed, we *always* preselect the next available
>> slot on the controller of our choice.
>> So this test is not needed.
>>
>> We keep the test on the string value of 'autoselect' to select
>> a bus position when adding a CD Drive.
> 
> Looks good, at least with git show -w :)
> Reviewed-by: Thomas Lamprecht <t.lampre...@proxmox.com>
> 
> A side comment still inline below.
> 
>> ---
>>   www/manager6/form/ControllerSelector.js | 53
>> -
>>   www/manager6/qemu/HDEdit.js |  2 +-
>>   2 files changed, 27 insertions(+), 28 deletions(-)
>>
>> diff --git a/www/manager6/form/ControllerSelector.js
>> b/www/manager6/form/ControllerSelector.js
>> index 002134ef..045e7d0d 100644
>> --- a/www/manager6/form/ControllerSelector.js
>> +++ b/www/manager6/form/ControllerSelector.js
>> @@ -58,37 +58,36 @@ Ext.define('PVE.form.ControllerSelector', {
>>   var me = this;
>>     me.vmconfig = Ext.apply({}, vmconfig);
>> -    if (autoSelect) {
>> -    var clist = ['ide', 'virtio', 'scsi', 'sata'];
>> -    if (autoSelect === 'cdrom') {
>> -    clist = ['ide', 'scsi', 'sata'];
>> -    if (!Ext.isDefined(me.vmconfig.ide2)) {
>> -    me.down('field[name=controller]').setValue('ide');
>> -    me.down('field[name=deviceid]').setValue(2);
>> -    return;
>> -    }
>> -    } else  {
>> -    // in most cases we want to add a disk to the same controller
>> -    // we previously used
>> -    clist = me.sortByPreviousUsage(me.vmconfig, clist);
>> +
>> +    var clist = ['ide', 'virtio', 'scsi', 'sata'];
>> +    if (autoSelect === 'cdrom') {
>> +    clist = ['ide', 'scsi', 'sata'];
>> +    if (!Ext.isDefined(me.vmconfig.ide2)) {
> 
> AFAIS, this is just the fastpath?
> As performance is rarely a problem when iterating a very small array,
> maybe just remove this all but the line where clist gets re-set
> and let the general-purpose code below handle this case too?

but this would mean that a newly added CD ROM drive is not anymore added
to the index 2 on the IDE bus by default ?

I am not sure of the implications of these for the machines type we
emulate, so I would prefer not to change this in this patch serie



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


Re: [pve-devel] [PATCH manager v3 5/8] Add a field to show which SCSI controller type we are currently using

2017-09-28 Thread Emmanuel Kasper
On 09/27/2017 11:27 AM, Thomas Lamprecht wrote:
> On 09/26/2017 02:17 PM, Emmanuel Kasper wrote:
>> ---
>>   www/manager6/qemu/HDEdit.js | 15 ---
>>   1 file changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
>> index 8a415d8b..075ad667 100644
>> --- a/www/manager6/qemu/HDEdit.js
>> +++ b/www/manager6/qemu/HDEdit.js
>> @@ -24,11 +24,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
>>   this.lookup('iothread').setValue(false);
>>   }
>>   -    var allowDiscard = value.match(/^scsi/);
>> -    this.lookup('discard').setDisabled(!allowDiscard);
>> -    if (!allowDiscard) {
>> +    var scsi = value.match(/^scsi/);
>> +    this.lookup('discard').setDisabled(!scsi);
>> +    if (!scsi) {
>>   this.lookup('discard').setValue(false);
>>   }
>> +    this.lookup('scsiType').setVisible(scsi);
>>   },
>>     control: {
>> @@ -141,6 +142,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
>>     if (me.bussel) {
>>   me.bussel.setVMConfig(vmconfig);
>> +    me.scsiType.setValue(vmconfig.scsihw);
>>   }
>>   if (me.unusedDisks) {
>>   var disklist = [];
>> @@ -195,6 +197,13 @@ Ext.define('PVE.qemu.HDInputPanel', {
>>   vmconfig: me.insideWizard ? {ide2: 'cdrom'} : {}
>>   });
>>   me.column1.push(me.bussel);
>> +    me.scsiType = Ext.create('Ext.form.field.Display', {>
>> +    fieldLabel: gettext('Type'),
> 
> Type is to general and not really true here (Type of what?).
> 'SCSI Controller' would match the scsihw edit window better
> and make it clearer why it disappears when something other
> than SCSI is selected, what do you think?

The current gettext strings we have here are either 'SCSI Controller
Type' need to be wrapped on two lines in the Edit Window, or 'Type'

Since this 'Type' field is underneath the Bus Selector, appears only
when the SCSI controller is selected in the Bus Selector, and include
the string SCSI in all the cases that interess us (VirtIO SCSI), I think
'Type' is enough.

For the rest, agree with your suggestions, I will integrate them in a V4.

Emmanuel









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


[pve-devel] [PATCH docs 1/2] Typo correction

2017-09-27 Thread Emmanuel Kasper
---
 qm.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qm.adoc b/qm.adoc
index 6cc8855..44d45f6 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -679,7 +679,7 @@ the VM. For Windows VMs, you need to install the Windows 
paravirtualized
 drivers by yourself.
 
 GNU/Linux and other free Unix can usually be imported without hassle. Note
-that we cannot guarantee a successful import/export of Windows WM in all
+that we cannot guarantee a successful import/export of Windows VMs in all
 cases due to the problems above.
 
 Step-by-step example of a Windows disk image import
-- 
2.11.0


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


[pve-devel] [PATCH docs 2/2] Update the Windows import example to use the qm importovf command

2017-09-27 Thread Emmanuel Kasper
Also create a new section, "Add an external disk image to a Virtual Machine"
using the qm importdisk command.
---
NB: qm.1-synopsis.adoc should be rebuilt, so the 'importovf' command is there 
too.
 qm.adoc | 74 -
 1 file changed, 50 insertions(+), 24 deletions(-)

diff --git a/qm.adoc b/qm.adoc
index 44d45f6..f72502c 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -651,8 +651,8 @@ NOTE: It is not possible to start templates, because this 
would modify
 the disk images. If you want to change the template, create a linked
 clone and modify that.
 
-Importing Virtual Machines from foreign hypervisors

+Importing Virtual Machines and disk images
+--
 
 A VM export from a foreign hypervisor takes usually the form of one or more 
disk
  images, with a configuration file describing the settings of the VM (RAM,
@@ -682,43 +682,69 @@ GNU/Linux and other free Unix can usually be imported 
without hassle. Note
 that we cannot guarantee a successful import/export of Windows VMs in all
 cases due to the problems above.
 
-Step-by-step example of a Windows disk image import
-~~~
+Step-by-step example of a Windows OVF import
+
 
 Microsoft provides
-https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/[Virtual 
Machines exports]
- in different formats for browser testing. We are going to use one of these to
- demonstrate a VMDK import.
+https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/[Virtual
 Machines downloads]
+ to get started with Windows development.We are going to use one of these 
+to demonstrate the OVF import feature.
 
-Download the export zip
-^^^
+Download the Virtual Machine zip
+
 
-After getting informed about the user agreement, choose the _Microsoft Edge on
-Windows 10 Virtual Machine_ for the VMware platform, and download the zip.
+After getting informed about the user agreement, choose the _Windows 10 
+Enterprise (Evaluation - Build)_ for the VMware platform, and download the zip.
 
 Extract the disk image from the zip
 ^^^
 
-Using the unzip utility or any archiver of your choice, unpack the zip,
-and copy via ssh/scp the vmdk file to your {pve} host.
+Using the `unzip` utility or any archiver of your choice, unpack the zip,
+and copy via ssh/scp the ovf and vmdk files to your {pve} host.
 
-Create a new virtual machine and import the disk
-
+Import the Virtual Machine
+^^
 
-Create a virtual machine with 2 cores, 2GB RAM, and one NIC on the default
-+vmbr0+ bridge:
+This will create a new virtual machine, using cores, memory and
+VM name as read from the OVF manifest, and import the disks to the +local-lvm+
+ storage. You have to configure the network manually.
 
- qm create 999 -net0 e1000,bridge=vmbr0 -name Win10 -memory 2048 -bootdisk 
sata0
+ qm importovf 999 WinDev1709Eval.ovf local-lvm
 
-Import the disk image to the +local-lvm+ storage:
+The VM is ready to be started.
 
- qm importdisk 999 "MSEdge - Win10_preview.vmdk" local-lvm
+Add an external disk image to a Virtual Machine
+~~~
 
-The disk will be marked as *Unused* in the VM 999 configuration.
-After that you can go in the GUI, in the VM *Hardware*, *Edit* the unused disk
-and set the *Bus/Device* to *SATA/0*.
-The VM is ready to be started.
+You can also add an existing disk image to a VM, either coming from a 
+foreign hypervisor, or one that you created yourself.
+
+Suppose you created a Debian/Ubuntu disk image with the 'vmdebootstrap' tool:
+
+ vmdebootstrap --verbose \
+  --size 10G --serial-console \
+  --grub --no-extlinux \
+  --package openssh-server \
+  --package avahi-daemon \
+  --package qemu-guest-agent \
+  --hostname vm600 --enable-dhcp \
+  --customize=./copy_pub_ssh.sh \
+  --sparse --image vm600.raw
+
+You can now create a new target VM for this image.
+
+ qm create 600 --net0 virtio,bridge=vmbr0 --name vm600 --serial0 socket \
+   --bootdisk scsi0 --scsihw virtio-scsi-pci --ostype l26
 
+Add the disk image as +unused0+ to the VM, using the storage +pvedir+:
+
+ qm importdisk 600 vm600.raw pvedir
+
+Finally attach the unused disk to the SCSI controller of the VM:
+
+ qm set 600 --scsi0 pvedir:600/vm-600-disk-1.raw
+
+The VM is ready to be started.
 
 Managing Virtual Machines with `qm`
 
-- 
2.11.0


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


[pve-devel] [PATCH qemu-server] importovf: explicitly returns undef

2017-09-27 Thread Emmanuel Kasper
We set the returns value to  { type => 'null' } but we returned an empty
string, which was confusing the cli handler.
---
 PVE/CLI/qm.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index 0e17cc9..90a44ef 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -599,7 +599,9 @@ __PACKAGE__->register_method ({
};
 
my $wait_for_lock = 1;
-   return PVE::QemuConfig->lock_config_full($vmid, $wait_for_lock, 
$importfn);
+   PVE::QemuConfig->lock_config_full($vmid, $wait_for_lock, $importfn);
+
+   return undef;
 
 }
 });
-- 
2.11.0


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


[pve-devel] [PATCH manager v3 6/8] When inside the wizard, actualize the scsiType display field based on iothread selection

2017-09-26 Thread Emmanuel Kasper
We keep the same logic as before: once the iothread option is selected, the 
default SCSI
controller is switched to virtio-scsi-single until iothread is unselected again.
---
 www/manager6/qemu/HDEdit.js | 28 ++--
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 075ad667..14ee0b50 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -19,9 +19,13 @@ Ext.define('PVE.qemu.HDInputPanel', {
var value = field.getValue();
 
var allowIOthread = value.match(/^(virtio|scsi)/);
-   this.lookup('iothread').setDisabled(!allowIOthread);
+   var iothread = this.lookup('iothread');
+   iothread.setDisabled(!allowIOthread);
if (!allowIOthread) {
-   this.lookup('iothread').setValue(false);
+   // prevent event loop
+   iothread.suspendEvent('change');
+   iothread.setValue(false);
+   iothread.resumeEvent('change');
}
 
var scsi = value.match(/^scsi/);
@@ -74,6 +78,15 @@ Ext.define('PVE.qemu.HDInputPanel', {
me.hdsizesel.setVisible(true);
}
}
+   },
+   'field[name=iothread]' : {
+   change: function(f, value) {
+   if (!this.getView().insideWizard) {
+   return;
+   }
+   this.lookupReference('scsiType')
+   .setValue(value ? 'virtio-scsi-single'  : 
'virtio-scsi-pci');
+   }
}
}
 },
@@ -116,10 +129,6 @@ Ext.define('PVE.qemu.HDInputPanel', {
 
if (values.iothread) {
me.drive.iothread = 'on';
-   // do not silently change a VM-wide option after creating it
-   if (me.insideWizard) {
-   params.scsihw = 'virtio-scsi-single';
-   }
} else {
delete me.drive.iothread;
}
@@ -130,6 +139,10 @@ Ext.define('PVE.qemu.HDInputPanel', {
delete me.drive.cache;
}
 
+   if (values.scsihw) {
+   params.scsihw = values.scsihw;
+   }
+
params[confid] = PVE.Parser.printQemuDrive(me.drive);
 
return params;
@@ -198,9 +211,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
});
me.column1.push(me.bussel);
me.scsiType = Ext.create('Ext.form.field.Display', {
+   name: 'scsihw',
fieldLabel: gettext('Type'),
reference: 'scsiType',
renderer: PVE.Utils.render_scsihw,
+   // do not change a VM wide option after creation
+   submitValue: me.insideWizard,
hidden: true
});
me.column1.push(me.scsiType);
-- 
2.11.0


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


[pve-devel] [PATCH manager v3 5/8] Add a field to show which SCSI controller type we are currently using

2017-09-26 Thread Emmanuel Kasper
---
 www/manager6/qemu/HDEdit.js | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 8a415d8b..075ad667 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -24,11 +24,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
this.lookup('iothread').setValue(false);
}
 
-   var allowDiscard = value.match(/^scsi/);
-   this.lookup('discard').setDisabled(!allowDiscard);
-   if (!allowDiscard) {
+   var scsi = value.match(/^scsi/);
+   this.lookup('discard').setDisabled(!scsi);
+   if (!scsi) {
this.lookup('discard').setValue(false);
}
+   this.lookup('scsiType').setVisible(scsi);
},
 
control: {
@@ -141,6 +142,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
 
if (me.bussel) {
me.bussel.setVMConfig(vmconfig);
+   me.scsiType.setValue(vmconfig.scsihw);
}
if (me.unusedDisks) {
var disklist = [];
@@ -195,6 +197,13 @@ Ext.define('PVE.qemu.HDInputPanel', {
vmconfig: me.insideWizard ? {ide2: 'cdrom'} : {}
});
me.column1.push(me.bussel);
+   me.scsiType = Ext.create('Ext.form.field.Display', {
+   fieldLabel: gettext('Type'),
+   reference: 'scsiType',
+   renderer: PVE.Utils.render_scsihw,
+   hidden: true
+   });
+   me.column1.push(me.scsiType);
}
 
if (me.unused) {
-- 
2.11.0


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


  1   2   3   4   5   6   7   8   9   >