[pve-devel] applied: [PATCH v2 container] fix issue where ttys aren't correctly set after restore
applied On Fri, Sep 13, 2019 at 12:35:57PM +0200, Oguz Bektas wrote: > restore from unpriv to priv causes a problem with the log-in from web > console, since the /etc/securetty file isn't modified after a restore to > reflect that change (/dev/lxc/tty1 and so on). > > template_fixup is normally called in post_create_hook, but we have no > $password or $ssh_keys to call the hook with during the restore. instead > we call template_fixup by itself to fix the ttys on some distributions. > > Signed-off-by: Oguz Bektas > --- > src/PVE/API2/LXC.pm | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm > index 6ddff9c..dab959f 100644 > --- a/src/PVE/API2/LXC.pm > +++ b/src/PVE/API2/LXC.pm > @@ -415,6 +415,8 @@ __PACKAGE__->register_method({ > > if ($restore) { > PVE::LXC::Create::restore_configuration($vmid, > $rootdir, $conf, !$is_root, $unique, $skip_fw_config_restore); > + my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir); > + $lxc_setup->template_fixup($conf); > } else { > my $lxc_setup = PVE::LXC::Setup->new($conf, $rootdir); > # detect OS > PVE::LXC::Config->write_config($vmid, $conf); # safe > config (after OS detection) > -- > 2.20.1 ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] applied: [PATCH storage] Actually use target_volid
applied On Wed, Sep 11, 2019 at 11:46:19AM +0200, Fabian Ebner wrote: > Migration with --targetstorage was broken because of this. > > Signed-off-by: Fabian Ebner > --- > PVE/Storage.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/PVE/Storage.pm b/PVE/Storage.pm > index 755eca8..31eeb21 100755 > --- a/PVE/Storage.pm > +++ b/PVE/Storage.pm > @@ -586,7 +586,7 @@ sub storage_migrate { > } > } > > -my @formats = volume_transfer_formats($cfg, $volid, $volid, $snapshot, > $base_snapshot, $with_snapshots); > +my @formats = volume_transfer_formats($cfg, $volid, $target_volid, > $snapshot, $base_snapshot, $with_snapshots); > die "cannot migrate from storage type '$scfg->{type}' to > '$tcfg->{type}'\n" if !@formats; > my $format = $formats[0]; > > @@ -598,7 +598,7 @@ sub storage_migrate { > > $with_snapshots = $with_snapshots ? 1 : 0; # sanitize for passing as cli > parameter > my $send = ['pvesm', 'export', $volid, $format, '-', '-with-snapshots', > $with_snapshots]; > -my $recv = [@$ssh, '--', 'pvesm', 'import', $volid, $format, $import_fn, > '-with-snapshots', $with_snapshots]; > +my $recv = [@$ssh, '--', 'pvesm', 'import', $target_volid, $format, > $import_fn, '-with-snapshots', $with_snapshots]; > if (defined($snapshot)) { > push @$send, '-snapshot', $snapshot > } > -- > 2.20.1 ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH manager 2/4] spice: Add enhancements form component
On 9/16/19 2:44 PM, Stefan Reiter wrote: Tried my hand at a proper code review, I like the patches in general. On 9/13/19 3:16 PM, Aaron Lauterer wrote: Signed-off-by: Aaron Lauterer --- www/manager6/Makefile | 1 + www/manager6/form/SpiceEnhancementSelector.js | 66 +++ 2 files changed, 67 insertions(+) create mode 100644 www/manager6/form/SpiceEnhancementSelector.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 82e25c79..aa460c3b 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -66,6 +66,7 @@ JSSRC= \ form/CalendarEvent.js \ form/CephPoolSelector.js \ form/PermPathSelector.js \ + form/SpiceEnhancementSelector.js \ dc/Tasks.js \ dc/Log.js \ panel/StatusPanel.js \ diff --git a/www/manager6/form/SpiceEnhancementSelector.js b/www/manager6/form/SpiceEnhancementSelector.js new file mode 100644 index ..5457c8d5 --- /dev/null +++ b/www/manager6/form/SpiceEnhancementSelector.js @@ -0,0 +1,66 @@ +Ext.define('PVE.form.SpiceEnhancementSelector', { + extend: 'Proxmox.panel.InputPanel', + alias: 'widget.pveSpiceEnhancementSelector', + + initComponent: function() { + var me = this; + me.items= [ + { + xtype: 'proxmoxcheckbox', + itemId: 'foldersharing', + name: 'foldersharing', + submitValue: false, + fieldLabel: gettext('Folder sharing'), + uncheckedValue: 0, + }, + { + xtype: 'proxmoxKVComboBox', + itemId: 'videostreaming', + name: 'videostreaming', + submitValue: false, + value: 'off', + fieldLabel: gettext('Video streaming'), + comboItems: [ + ['off', 'off'], + ['all', 'all'], + ['filter', 'filter'], + ], + }, + ]; Why not just set the items array on the object directly? Then you wouldn't have to override initComponent. + me.callParent(); + }, + + // handle submitted values manually to work in the VM create wizard as well. + // without submitValue = false the fields would be added to the config + onGetValues: function() { + var me = this; + + if (me.disabled) { + return Missing ; Thx for seeing this + } + + var values = {}; + var foldersharing = me.down('field[name=foldersharing]').getValue(); + var videostreaming= me.down('field[name=videostreaming]').getValue(); Missing space before = Thx + + if (videostreaming !== "off") { + values.videostreaming = videostreaming; + } + if (foldersharing) { + values.foldersharing = 1; + } + if (Ext.Object.isEmpty(values)) { + return { 'delete': 'spice_enhancements' }; + } + var enhancements = PVE.Parser.printPropertyString(values); + return { spice_enhancements: enhancements }; + }, + + setValues: function(values) { + var enhancements = values.spice_enhancements || ''; + if (enhancements) { + var res = PVE.Parser.parsePropertyString(enhancements); Same as in 3/4, foldersharing would need to be converted to a true boolean here (from potentially "on", "yes", ...). Good point. + this.callParent([res]); + } + }, +}); ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH manager 3/4] spice: Add enhancements to VM Options panel
On 9/16/19 2:44 PM, Stefan Reiter wrote: On 9/13/19 3:16 PM, Aaron Lauterer wrote: Signed-off-by: Aaron Lauterer --- www/manager6/Utils.js | 18 ++ www/manager6/qemu/Options.js | 13 + 2 files changed, 31 insertions(+) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 6a489e7e..139200c3 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -334,6 +334,24 @@ Ext.define('PVE.Utils', { utilities: { } }, + render_spice_enhancements: function(value) { + if (!value) { + return Proxmox.Utils.disabledText; + } + var props = PVE.Parser.parsePropertyString(value); + if (Ext.Object.isEmpty(props)) { + return Proxmox.Utils.disabledText; + } + var ret = []; + if (props.foldersharing === "1") { I don't think '=== "1"' catches all cases here, USBEdit.js for example contains a check like this: if (/^usb3=(1|on|true)$/.test(data[i])) { ... } while our JSONSchema parser even accepts "yes" in addition to the ones above. Maybe a common Regex/helper like "parse_boolean" in JSONSchema.pm would be useful in JS too? + ret.push("Folder sharing enabled"); These... Yes you are right + } + if (props.videostreaming === "all" || props.videostreaming === "filter") { + ret.push("Video Streaming: " + props.videostreaming); ...need localization (gettext), since not language independent. Here I am not sure but it does not cost much to do it. + } > + return ret.join(", "); + }, + // fixme: auto-generate this // for now, please keep in sync with PVE::Tools::kvmkeymaps kvm_keymaps: { diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js index e1580060..96eb0499 100644 --- a/www/manager6/qemu/Options.js +++ b/www/manager6/qemu/Options.js @@ -281,6 +281,19 @@ Ext.define('PVE.qemu.Options', { } } : undefined }, + spice_enhancements: { + header: gettext('Spice Enhancements'), + defaultValue: false, + renderer: PVE.Utils.render_spice_enhancements, + editor: caps.vms['VM.Config.Options'] ? { + xtype: 'proxmoxWindowEdit', + subject: gettext('Spice Enhancements'), Just as a note, SPICE enhancements currently don't have a documentation available, but once they do, an "onlineHelp" would be useful here. Once the docs are written this will be added. + items: { + xtype: 'pveSpiceEnhancementSelector', + name: 'spice_enhancements', + } + } : undefined + }, Maybe disable this if VGA is not QXL (see also my note in 4/4). I don't think this is a good idea. It is clearly named and I don't want to have to set the VGA to Spice first in order to change any of the enhancements in the options. If I want to enable Spice with all this and I am in the options panel I would need to change to the hardware panel first and then come back to the options. If I am disabling Spice and forgot to disable the enhancements before setting VGA to something else I need to go back and temporarily enable it again. Either way is too much of a hassle. hookscript: { header: gettext('Hookscript') } ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH manager 3/4] spice: Add enhancements to VM Options panel
On 9/16/19 2:56 PM, Christian Ebner wrote: On September 16, 2019 2:44 PM Stefan Reiter wrote: +render_spice_enhancements: function(value) { + if (!value) { + return Proxmox.Utils.disabledText; + } + var props = PVE.Parser.parsePropertyString(value); + if (Ext.Object.isEmpty(props)) { + return Proxmox.Utils.disabledText; + } + var ret = []; + if (props.foldersharing === "1") { I don't think '=== "1"' catches all cases here, USBEdit.js for example contains a check like this: if (/^usb3=(1|on|true)$/.test(data[i])) { ... } while our JSONSchema parser even accepts "yes" in addition to the ones above. Maybe a common Regex/helper like "parse_boolean" in JSONSchema.pm would be useful in JS too? we have parseBoolean in Parser.js for that which checks for 1|yes|on|true and makes sure upper/lower case is taken into account too. Thanks for the hint :) ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH manager 4/4] spice: Add enhancements to VM Creation wizard
On 9/16/19 2:44 PM, Stefan Reiter wrote: Akin to what you mentioned on the cover, there's a connection missing between the "Graphic card" field and the SPICE ones - there is no clear indication of *why* they are disabled by default in a new VM. Maybe make it a section of some sort titled "SPICE"? Yeah, the next version of this series will contain a different layout of that panel that should make it clearer. On 9/13/19 3:16 PM, Aaron Lauterer wrote: enabled if qxl/spice display selected Signed-off-by: Aaron Lauterer --- www/manager6/qemu/SystemEdit.js | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js index 846baa73..15ae9a73 100644 --- a/www/manager6/qemu/SystemEdit.js +++ b/www/manager6/qemu/SystemEdit.js @@ -79,7 +79,18 @@ Ext.define('PVE.qemu.SystemInputPanel', { deleteEmpty: false, fieldLabel: gettext('Graphic card'), name: 'vga', - comboItems: PVE.Utils.kvm_vga_driver_array() + comboItems: PVE.Utils.kvm_vga_driver_array(), + listeners: { + change: function(f, value, old) { + var sef = this.up().down('pveSpiceEnhancementSelector'); + if (/^(qxl)(\d?)$/.test(value)) { + console.log("matched ", value); Leftover debug print? Also, while this disables the enhancements in the VM creation wizard, there's nothing stopping a user to just enable them afterwards in the Options dialog - with no effect of course. There should be check there too, I think. See the discussion in 3/4 + sef.setDisabled(false); + } else { + sef.setDisabled(true); + } + } + } }, { xtype: 'proxmoxcheckbox', @@ -88,6 +99,11 @@ Ext.define('PVE.qemu.SystemInputPanel', { defaultValue: 0, deleteDefaultValue: true, fieldLabel: gettext('Qemu Agent') + }, + { + xtype: 'pveSpiceEnhancementSelector', + name: 'spice_enhancements', + disabled: true, } ], ___ 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/4] spice: Add enhanecements to VM Options panel
Signed-off-by: Aaron Lauterer --- www/manager6/Utils.js| 18 ++ www/manager6/qemu/Options.js | 13 + 2 files changed, 31 insertions(+) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 6a489e7e..a9adb382 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -334,6 +334,24 @@ Ext.define('PVE.Utils', { utilities: { } }, +render_spice_enhancements: function(values) { + if (!values) { + return Proxmox.Utils.disabledText; + } + var props = PVE.Parser.parsePropertyString(values); + if (Ext.Object.isEmpty(props)) { + return Proxmox.Utils.disabledText; + } + var output = []; + if (PVE.Parser.parseBoolean(props.foldersharing)) { + output.push(gettext("Folder sharing enabled")); + } + if (props.videostreaming === "all" || props.videostreaming === "filter") { + output.push(gettext("Video Streaming") + ": " + props.videostreaming); + } + return output.join(", "); +}, + // fixme: auto-generate this // for now, please keep in sync with PVE::Tools::kvmkeymaps kvm_keymaps: { diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js index e1580060..96eb0499 100644 --- a/www/manager6/qemu/Options.js +++ b/www/manager6/qemu/Options.js @@ -281,6 +281,19 @@ Ext.define('PVE.qemu.Options', { } } : undefined }, + spice_enhancements: { + header: gettext('Spice Enhancements'), + defaultValue: false, + renderer: PVE.Utils.render_spice_enhancements, + editor: caps.vms['VM.Config.Options'] ? { + xtype: 'proxmoxWindowEdit', + subject: gettext('Spice Enhancements'), + items: { + xtype: 'pveSpiceEnhancementSelector', + name: 'spice_enhancements', + } + } : undefined + }, hookscript: { header: gettext('Hookscript') } -- 2.20.1 ___ 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/4] Cleanup: align backslashes in manager6 Makefile
Signed-off-by: Aaron Lauterer --- www/manager6/Makefile | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 7ee7cd40..82e25c79 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -14,7 +14,7 @@ JSSRC= \ lxc/CmdMenu.js \ node/CmdMenu.js \ VNCConsole.js \ - data/PermPathStore.js \ + data/PermPathStore.js \ data/ResourceStore.js \ data/model/Realm.js \ data/model/RRDModels.js \ @@ -60,12 +60,12 @@ JSSRC= \ form/FirewallPolicySelector.js \ form/GlobalSearchField.js \ form/QemuBiosSelector.js\ - form/VMSelector.js \ + form/VMSelector.js \ form/VMCPUFlagSelector.js \ form/USBSelector.js \ form/CalendarEvent.js \ - form/CephPoolSelector.js\ - form/PermPathSelector.js\ + form/CephPoolSelector.js\ + form/PermPathSelector.js\ dc/Tasks.js \ dc/Log.js \ panel/StatusPanel.js\ @@ -108,7 +108,7 @@ JSSRC= \ ceph/Services.js\ ceph/Config.js \ ceph/Log.js \ - ceph/CephInstallWizard.js \ + ceph/CephInstallWizard.js \ node/Disks.js \ node/LVM.js \ node/LVMThin.js \ @@ -149,7 +149,7 @@ JSSRC= \ qemu/CreateWizard.js\ qemu/USBEdit.js \ qemu/PCIEdit.js \ - qemu/SerialEdit.js \ + qemu/SerialEdit.js \ qemu/AgentIPView.js \ qemu/CloudInit.js \ qemu/CIDriveEdit.js \ -- 2.20.1 ___ 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/4] spice: Add enhancements form component
Signed-off-by: Aaron Lauterer --- www/manager6/Makefile | 1 + www/manager6/form/SpiceEnhancementSelector.js | 72 +++ 2 files changed, 73 insertions(+) create mode 100644 www/manager6/form/SpiceEnhancementSelector.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 82e25c79..aa460c3b 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -66,6 +66,7 @@ JSSRC= \ form/CalendarEvent.js \ form/CephPoolSelector.js\ form/PermPathSelector.js\ + form/SpiceEnhancementSelector.js\ dc/Tasks.js \ dc/Log.js \ panel/StatusPanel.js\ diff --git a/www/manager6/form/SpiceEnhancementSelector.js b/www/manager6/form/SpiceEnhancementSelector.js new file mode 100644 index ..cbafd502 --- /dev/null +++ b/www/manager6/form/SpiceEnhancementSelector.js @@ -0,0 +1,72 @@ +Ext.define('PVE.form.SpiceEnhancementSelector', { +extend: 'Proxmox.panel.InputPanel', +alias: 'widget.pveSpiceEnhancementSelector', +insideWizard: false, + +initComponent: function() { + var me = this; +me.items = [ + { + xtype: 'displayfield', + value: gettext('Spice enhancements') + ':', + hidden: !me.insideWizard + }, + { + xtype: 'proxmoxcheckbox', + itemId: 'foldersharing', + name: 'foldersharing', + submitValue: false, + fieldLabel: gettext('Folder sharing'), + uncheckedValue: 0, + }, + { + xtype: 'proxmoxKVComboBox', + itemId: 'videostreaming', + name: 'videostreaming', + submitValue: false, + value: 'off', + fieldLabel: gettext('Video streaming'), + comboItems: [ + ['off', 'off'], + ['all', 'all'], + ['filter', 'filter'], + ], + }, + ]; + + me.callParent(); +}, + +// handle submitted values manually to work in the VM create wizard as well. +// without submitValue = false the fields would be added to the config +onGetValues: function() { + var me = this; + if (me.disabled) { + return; + } + + var values = {}; + var foldersharing = me.down('field[name=foldersharing]').getValue(); + var videostreaming = me.down('field[name=videostreaming]').getValue(); + + if (videostreaming !== "off") { + values.videostreaming = videostreaming; + } + if (foldersharing) { + values.foldersharing = 1; + } + if (Ext.Object.isEmpty(values)) { + return { 'delete': 'spice_enhancements' }; + } + var enhancements = PVE.Parser.printPropertyString(values); + return { spice_enhancements: enhancements }; +}, + +setValues: function(values) { + if (values.spice_enhancements) { + var enhancements = PVE.Parser.parsePropertyString(values.spice_enhancements); + enhancements['foldersharing'] = PVE.Parser.parseBoolean(enhancements['foldersharing'], 0); + this.callParent([enhancements]); + } +}, +}); -- 2.20.1 ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH manager v2 4/4] spice: Add enhancements to VM Creation wizard
For a cleaner UI the SCSI Controller (pveScsiHwSelector) is moved to the left column below the VGA selector. The new Spice enhancements components is placed in the right column and enabled if qxl/spice is selected in the VGA selector. Signed-off-by: Aaron Lauterer --- www/manager6/qemu/SystemEdit.js | 34 - 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js index 846baa73..dac0cc04 100644 --- a/www/manager6/qemu/SystemEdit.js +++ b/www/manager6/qemu/SystemEdit.js @@ -79,7 +79,26 @@ Ext.define('PVE.qemu.SystemInputPanel', { deleteEmpty: false, fieldLabel: gettext('Graphic card'), name: 'vga', - comboItems: PVE.Utils.kvm_vga_driver_array() + comboItems: PVE.Utils.kvm_vga_driver_array(), + listeners: { + change: function(f, value, old) { + var sef = this.up('pveQemuSystemPanel').down('pveSpiceEnhancementSelector'); + if (/^(qxl)(\d?)$/.test(value)) { + sef.setDisabled(false); + } else { + sef.setDisabled(true); + } + } + } + }, + { + xtype: 'pveScsiHwSelector', + name: 'scsihw', + value: '__default__', + bind: { + value: '{current.scsihw}' + }, + fieldLabel: gettext('SCSI Controller') }, { xtype: 'proxmoxcheckbox', @@ -88,18 +107,15 @@ Ext.define('PVE.qemu.SystemInputPanel', { defaultValue: 0, deleteDefaultValue: true, fieldLabel: gettext('Qemu Agent') - } + }, ], column2: [ { - xtype: 'pveScsiHwSelector', - name: 'scsihw', - value: '__default__', - bind: { - value: '{current.scsihw}' - }, - fieldLabel: gettext('SCSI Controller') + xtype: 'pveSpiceEnhancementSelector', + name: 'spice_enhancements', + insideWizard: true, + disabled: true, } ], -- 2.20.1 ___ 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/4] Fix #2041, #2272 GUI for Spice Enhancements
With the server side patches applied[0] the GUI part for this was missing. This patch series adds the two current SPICE enhancements (folder sharing, video streaming) to the Options panel of a VM and to the VM creation wizard. Updates to the documentation and links in the GUI will follow. v1 -> v2: * code cleanup / improvement * rearranged the System panel in the VM creation wizard for a cleaner and easier to understand UI [0]: https://pve.proxmox.com/pipermail/pve-devel/2019-September/038799.html Aaron Lauterer (4): Cleanup: align backslashes in manager6 Makefile spice: Add enhancements form component spice: Add enhanecements to VM Options panel spice: Add enhancements to VM Creation wizard www/manager6/Makefile | 13 ++-- www/manager6/Utils.js | 18 + www/manager6/form/SpiceEnhancementSelector.js | 72 +++ www/manager6/qemu/Options.js | 13 www/manager6/qemu/SystemEdit.js | 34 ++--- 5 files changed, 135 insertions(+), 15 deletions(-) create mode 100644 www/manager6/form/SpiceEnhancementSelector.js -- 2.20.1 ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH storage 3/3] Fix volume name identification with linked clones
Linked clones has an image like base-100-disk-0/vm-101-disk-0 The previous regex didn't catched it, and thus, resizing a linked clone failed --- PVE/Storage/LunCmd/LIO.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/Storage/LunCmd/LIO.pm b/PVE/Storage/LunCmd/LIO.pm index f246dbb..f2f8944 100644 --- a/PVE/Storage/LunCmd/LIO.pm +++ b/PVE/Storage/LunCmd/LIO.pm @@ -192,7 +192,7 @@ my $extract_volname = sub { my $volname = undef; my $base = get_base; -if ($lunpath =~ /^$base\/$scfg->{pool}\/([\w\-]+)$/) { +if ($lunpath =~ /((?:base|vm)\-\d+\-disk\-\d+)$/) { $volname = $1; } -- 2.21.0 ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH storage 0/3] Fixes for LIO backend
This patch serie fix a few minor problems with LIO backend for ZFS over iSCSI, especially with volume resizing. It also enable unmap support Daniel Berteaud (3): Don't remove and recreate lun when changing a volume Enable unmap support Fix volume name identification with linked clones PVE/Storage/LunCmd/LIO.pm | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) -- 2.21.0 ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH storage 1/3] Don't remove and recreate lun when changing a volume
It's not needed, LIO sees the new size automatically. And it was broken anyway. Partially fix #2335 --- PVE/Storage/LunCmd/LIO.pm | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/PVE/Storage/LunCmd/LIO.pm b/PVE/Storage/LunCmd/LIO.pm index e0fac82..1ddc02d 100644 --- a/PVE/Storage/LunCmd/LIO.pm +++ b/PVE/Storage/LunCmd/LIO.pm @@ -322,14 +322,8 @@ my $import_lun = sub { # needed for example when the underlying ZFS volume has been resized my $modify_lun = sub { my ($scfg, $timeout, $method, @params) = @_; -my $msg; - -$msg = $delete_lun->($scfg, $timeout, $method, @params); -if ($msg) { - $msg = $create_lun->($scfg, $timeout, $method, @params); -} - -return $msg; +# Nothing to do on volume modification for LIO +return undef; }; my $add_view = sub { -- 2.21.0 ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH storage 2/3] Enable unmap support
In the default config, emulate_tpu is set to 0, which disables unmap support. Once enabled, trim can run from guest to reclaim free space. --- PVE/Storage/LunCmd/LIO.pm | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PVE/Storage/LunCmd/LIO.pm b/PVE/Storage/LunCmd/LIO.pm index 1ddc02d..f246dbb 100644 --- a/PVE/Storage/LunCmd/LIO.pm +++ b/PVE/Storage/LunCmd/LIO.pm @@ -250,7 +250,12 @@ my $create_lun = sub { my $res = $execute_remote_command->($scfg, $timeout, $targetcli, @cliparams); die $res->{msg} if !$res->{result}; -# step 2: register lun with target +# step 2: enable unmap support on the backstore +@cliparams = ($BACKSTORE . '/' . $volname, 'set', 'attribute', 'emulate_tpu=1' ); +$res = $execute_remote_command->($scfg, $timeout, $targetcli, @cliparams); +die $res->{msg} if !$res->{result}; + +# step 3: register lun with target # targetcli /iscsi/iqn.2018-04.at.bestsolution.somehost:target/tpg1/luns/ create /backstores/block/foobar @cliparams = ("/iscsi/$scfg->{target}/$tpg/luns/", 'create', "$BACKSTORE/$volname" ); $res = $execute_remote_command->($scfg, $timeout, $targetcli, @cliparams); -- 2.21.0 ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH storage 0/3] Fixes for LIO backend
Hi, Thanks for the patches and the work you put into them. On a first quick glance the changes look reasonable. I'll try to take a more detailed look and do some testing in the coming 1-2 weeks and provide some feedback! Best Regards, stoiko On Tue, 17 Sep 2019 12:44:01 +0200 Daniel Berteaud wrote: > This patch serie fix a few minor problems with LIO backend for ZFS > over iSCSI, especially with volume resizing. > It also enable unmap support > > Daniel Berteaud (3): > Don't remove and recreate lun when changing a volume > Enable unmap support > Fix volume name identification with linked clones > > PVE/Storage/LunCmd/LIO.pm | 19 +-- > 1 file changed, 9 insertions(+), 10 deletions(-) > ___ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH qemu-server] Whitespace cleanup
Signed-off-by: Aaron Lauterer --- PVE/CLI/qmrestore.pm | 18 +- PVE/QMPClient.pm | 38 +++--- PVE/QemuConfig.pm| 2 +- PVE/QemuServer/Memory.pm | 2 +- PVE/VZDump/QemuServer.pm | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/PVE/CLI/qmrestore.pm b/PVE/CLI/qmrestore.pm index 9ec0051..cb5c122 100755 --- a/PVE/CLI/qmrestore.pm +++ b/PVE/CLI/qmrestore.pm @@ -19,8 +19,8 @@ sub setup_environment { } __PACKAGE__->register_method({ -name => 'qmrestore', -path => 'qmrestore', +name => 'qmrestore', +path => 'qmrestore', method => 'POST', description => "Restore QemuServer vzdump backups.", parameters => { @@ -29,7 +29,7 @@ __PACKAGE__->register_method({ vmid => get_standard_option('pve-vmid', { completion => \&PVE::Cluster::complete_next_vmid }), archive => { description => "The backup file. You can pass '-' to read from standard input.", - type => 'string', + type => 'string', maxLength => 255, completion => \&PVE::QemuServer::complete_backup_archives, }, @@ -39,16 +39,16 @@ __PACKAGE__->register_method({ completion => \&PVE::QemuServer::complete_storage, }), force => { - optional => 1, + optional => 1, type => 'boolean', description => "Allow to overwrite existing VM.", }, unique => { - optional => 1, + optional => 1, type => 'boolean', description => "Assign a unique random ethernet address.", }, - pool => { + pool => { optional => 1, type => 'string', format => 'pve-poolid', description => "Add the VM to the specified pool.", @@ -61,7 +61,7 @@ __PACKAGE__->register_method({ } }, }, -returns => { +returns => { type => 'string', }, code => sub { @@ -70,9 +70,9 @@ __PACKAGE__->register_method({ $param->{node} = PVE::INotify::nodename(); return PVE::API2::Qemu->create_vm($param); -}}); +}}); -our $cmddef = [ __PACKAGE__, 'qmrestore', ['archive', 'vmid'], undef, +our $cmddef = [ __PACKAGE__, 'qmrestore', ['archive', 'vmid'], undef, sub { my $upid = shift; my $status = PVE::Tools::upid_read_status($upid); diff --git a/PVE/QMPClient.pm b/PVE/QMPClient.pm index 6be4a41..570dba2 100755 --- a/PVE/QMPClient.pm +++ b/PVE/QMPClient.pm @@ -57,10 +57,10 @@ my $push_cmd_to_queue = sub { my $execute = $cmd->{execute} || die "no command name specified"; my $qga = ($execute =~ /^guest\-+/) ? 1 : 0; - + my $sname = PVE::QemuServer::qmp_socket($vmid, $qga); -$self->{queue_info}->{$sname} = { qga => $qga, vmid => $vmid, sname => $sname, cmds => [] } +$self->{queue_info}->{$sname} = { qga => $qga, vmid => $vmid, sname => $sname, cmds => [] } if !$self->{queue_info}->{$sname}; push @{$self->{queue_info}->{$sname}->{cmds}}, $cmd; @@ -124,7 +124,7 @@ sub cmd { $cmd->{execute} eq 'block-job-complete' || $cmd->{execute} eq 'backup-cancel' || $cmd->{execute} eq 'query-savevm' || -$cmd->{execute} eq 'delete-drive-snapshot' || +$cmd->{execute} eq 'delete-drive-snapshot' || $cmd->{execute} eq 'guest-shutdown' || $cmd->{execute} eq 'blockdev-snapshot-internal-sync' || $cmd->{execute} eq 'blockdev-snapshot-delete-internal-sync' || @@ -161,7 +161,7 @@ my $next_cmdid = sub { my $lookup_queue_info = sub { my ($self, $fh, $noerr) = @_; -my $queue_info = $self->{queue_lookup}->{$fh}; +my $queue_info = $self->{queue_lookup}->{$fh}; if (!$queue_info) { warn "internal error - unable to lookup queue info" if !$noerr; return undef; @@ -175,7 +175,7 @@ my $close_connection = sub { if (my $fh = delete $queue_info->{fh}) { delete $self->{queue_lookup}->{$fh}; $self->{mux}->close($fh); -} +} }; my $open_connection = sub { @@ -262,7 +262,7 @@ my $check_queue = sub { if ($qga) { - $qmpcmd = to_json({ execute => 'guest-sync-delimited', + $qmpcmd = to_json({ execute => 'guest-sync-delimited', arguments => { id => int($cmd->{id})}}) . to_json({ execute => $cmd->{execute}, arguments => $cmd->{arguments}}); @@ -304,11 +304,11 @@ sub queue_execute { foreach my $sname (keys %{$self->{queue_info}}) { my $queue_info = $self->{queue_info}->{$sname}; next if !scalar(@{$queue_info->{cmds}}); # no commands - + $queue_info->{error} = undef;