public AsyncAction SaveSettings()
        {
            vm.BootOrder = GetOrder();

            if (!Helpers.BostonOrGreater(vm.Connection))
            {
                vm.AutoPowerOn = m_checkBoxAutoBoot.Checked;
            }

            vm.PV_args = m_textBoxOsParams.Text;

            return(new DelegatedAsyncAction(vm.Connection, "Change VBDs bootable", "Change VBDs bootable", null,
                                            delegate(Session session)
            {
                if (bootFromCD)
                {
                    foreach (var vbd in vm.Connection.ResolveAll(vm.VBDs))
                    {
                        VBD.set_bootable(session, vbd.opaque_ref, vbd.IsCDROM);
                    }
                }
                else
                {
                    // The lowest numbered disk is the system disk and we should set it to bootable: see CA-47457
                    List <VBD> vbds = vm.Connection.ResolveAll(vm.VBDs);
                    vbds.Sort((vbd1, vbd2) =>
                    {
                        if (vbd1.userdevice == "xvda")
                        {
                            return -1;
                        }
                        if (vbd2.userdevice == "xvda")
                        {
                            return 1;
                        }
                        return StringUtility.NaturalCompare(vbd1.userdevice,
                                                            vbd2.userdevice);
                    });
                    bool foundSystemDisk = false;
                    foreach (var vbd in vbds)
                    {
                        bool bootable = (!foundSystemDisk && vbd.type == vbd_type.Disk);
                        if (bootable)
                        {
                            foundSystemDisk = true;
                        }
                        VBD.set_bootable(session, vbd.opaque_ref, bootable);
                    }
                }
            },
                                            true, // supress history
                                            "VBD.set_bootable"
                                            ));
        }