]> git.proxmox.com Git - pve-manager.git/commitdiff
Update VM SCSI type based on iothread value when inside the wizard
authorEmmanuel Kasper <e.kasper@proxmox.com>
Thu, 5 Oct 2017 13:41:55 +0000 (15:41 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 19 Oct 2017 09:46:24 +0000 (11:46 +0200)
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.

Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/qemu/HDEdit.js

index b6f08080ffc7d9c0d8566f034e735284902be90a..2b860d8fe43cd88d26900810af13a41c0b9dcb27 100644 (file)
@@ -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);