private void ProcessRecordMode(string vbd) { RunApiCall(() => { vbd_mode obj = XenAPI.VBD.get_mode(session, vbd); WriteObject(obj, true); }); }
public VbdEditAction(VBD vbd, vbd_mode vbdMode, int priority, bool changeDevicePosition, VBD other, string devicePosition, bool suppressHistory) : base(vbd.Connection, string.Format(Messages.ACTION_SAVE_SETTINGS, vbd.Connection.Resolve(vbd.VDI)), string.Format(Messages.ACTION_SAVE_SETTINGS, vbd.Connection.Resolve(vbd.VDI)), suppressHistory) { this._vbd = vbd; _priority = priority; VM = vbd.Connection.Resolve(vbd.VM); this._vbdMode = vbdMode; this._changeDevicePosition = changeDevicePosition; this._other = other; this._devicePosition = devicePosition; }
public static string ToString(vbd_mode x) { switch (x) { case vbd_mode.RO: return "RO"; case vbd_mode.RW: return "RW"; default: return "unknown"; } }
public static string ToString(vbd_mode x) { switch (x) { case vbd_mode.RO: return("RO"); case vbd_mode.RW: return("RW"); } return("unknown"); }
public static string StringOf(this vbd_mode x) { switch (x) { case vbd_mode.RO: return("RO"); case vbd_mode.RW: return("RW"); default: return("unknown"); } }
public VBD(string uuid, List <vbd_operations> allowed_operations, Dictionary <string, vbd_operations> current_operations, XenRef <VM> VM, XenRef <VDI> VDI, string device, string userdevice, bool bootable, vbd_mode mode, vbd_type type, bool unpluggable, bool storage_lock, bool empty, Dictionary <string, string> other_config, bool currently_attached, long status_code, string status_detail, Dictionary <string, string> runtime_properties, string qos_algorithm_type, Dictionary <string, string> qos_algorithm_params, string[] qos_supported_algorithms, XenRef <VBD_metrics> metrics) { this.uuid = uuid; this.allowed_operations = allowed_operations; this.current_operations = current_operations; this.VM = VM; this.VDI = VDI; this.device = device; this.userdevice = userdevice; this.bootable = bootable; this.mode = mode; this.type = type; this.unpluggable = unpluggable; this.storage_lock = storage_lock; this.empty = empty; this.other_config = other_config; this.currently_attached = currently_attached; this.status_code = status_code; this.status_detail = status_detail; this.runtime_properties = runtime_properties; this.qos_algorithm_type = qos_algorithm_type; this.qos_algorithm_params = qos_algorithm_params; this.qos_supported_algorithms = qos_supported_algorithms; this.metrics = metrics; }
public AsyncAction SaveSettings() { // Check user has entered valid params if (DevicePositionChanged && vdi.type == vdi_type.system) { DialogResult dialogResult; using (var dlg = new ThreeButtonDialog( new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.EDIT_SYS_DISK_WARNING, Messages.EDIT_SYS_DISK_WARNING_TITLE), ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo)) { dialogResult = dlg.ShowDialog(this); } if (DialogResult.Yes != dialogResult) { return(null); } } bool diskAccessPriorityEnabled = diskAccessPriorityTrackBar.Enabled; int diskAccessPriority = diskAccessPriorityTrackBar.Value; vbd_mode vbdMode = modeComboBox.SelectedIndex == 0 ? vbd_mode.RW : vbd_mode.RO; string devicePosition = DevicePosition; int priorityToSet = vbd.IONice; if (diskAccessPriorityEnabled) { priorityToSet = diskAccessPriority; } bool changeDevicePosition = false; VBD other = null; if (devicePosition != vbd.userdevice) { foreach (VBD otherVBD in vm.Connection.ResolveAll(vm.VBDs)) { if (otherVBD.userdevice != devicePosition || vbd.opaque_ref == otherVBD.opaque_ref) { continue; } other = otherVBD; break; } if (other == null) { changeDevicePosition = true; } else { // The selected userdevice is already in use. Ask the user what to do about this. DialogResult result = new UserDeviceDialog(devicePosition).ShowDialog(this); changeDevicePosition = result != DialogResult.Cancel; if (result == DialogResult.No || !changeDevicePosition) { other = null; } } } WarnUserSwap(vbd, other); return(new VbdEditAction(vbd, vbdMode, priorityToSet, changeDevicePosition, other, devicePosition, true)); }
public AsyncAction SaveSettings() { // Check user has entered valid params if (DevicePositionChanged && vdi.type == vdi_type.system) { DialogResult dialogResult; using (var dlg = new WarningDialog(Messages.EDIT_SYS_DISK_WARNING, ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo) { WindowTitle = Messages.EDIT_SYS_DISK_WARNING_TITLE }) { dialogResult = dlg.ShowDialog(this); } if (DialogResult.Yes != dialogResult) { return(null); } } bool diskAccessPriorityEnabled = diskAccessPriorityTrackBar.Enabled; int diskAccessPriority = diskAccessPriorityTrackBar.Value; vbd_mode vbdMode = modeComboBox.SelectedIndex == 0 ? vbd_mode.RW : vbd_mode.RO; string devicePosition = DevicePosition; int priorityToSet = vbd.GetIoNice(); if (diskAccessPriorityEnabled) { priorityToSet = diskAccessPriority; } bool changeDevicePosition = false; VBD other = null; if (devicePosition != vbd.userdevice) { foreach (VBD otherVBD in vm.Connection.ResolveAll(vm.VBDs)) { if (otherVBD.userdevice != devicePosition || vbd.opaque_ref == otherVBD.opaque_ref) { continue; } other = otherVBD; break; } if (other == null) { changeDevicePosition = true; } else { using (var dialog = new WarningDialog(string.Format(Messages.DEVICE_POSITION_CONFLICT, devicePosition), new ThreeButtonDialog.TBDButton(Messages.DEVICE_POSITION_CONFLICT_SWAP, DialogResult.Yes), new ThreeButtonDialog.TBDButton(Messages.DEVICE_POSITION_CONFLICT_CONFIGURE, DialogResult.No), ThreeButtonDialog.ButtonCancel)) { var result = dialog.ShowDialog(this); changeDevicePosition = result != DialogResult.Cancel; if (result == DialogResult.No || !changeDevicePosition) { other = null; } } } } WarnUserSwap(vbd, other); return(new VbdEditAction(vbd, vbdMode, priorityToSet, changeDevicePosition, other, devicePosition, true)); }
public static string ToString(vbd_mode x) { return(x.StringOf()); }
public static void set_mode(Session session, string _vbd, vbd_mode _mode) { session.proxy.vbd_set_mode(session.uuid, (_vbd != null) ? _vbd : "", vbd_mode_helper.ToString(_mode)).parse(); }