mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Do not set API object properties that have a default value of "OpaqueRef:NULL" to null.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
parent
915059d099
commit
673846924b
@ -152,12 +152,15 @@ namespace XenAdmin.Dialogs
|
||||
{
|
||||
var pvsCacheStorage = new PVS_cache_storage
|
||||
{
|
||||
site = PvsSite != null ? new XenRef<PVS_site>(PvsSite) : null,
|
||||
host = new XenRef<Host>(row.Host),
|
||||
SR = row.CacheSr != null ? new XenRef<SR>(row.CacheSr) : null,
|
||||
size = row.CacheSize
|
||||
};
|
||||
|
||||
if (PvsSite != null)
|
||||
pvsCacheStorage.site = new XenRef<PVS_site>(PvsSite);
|
||||
if (row.CacheSr != null)
|
||||
pvsCacheStorage.SR = new XenRef<SR>(row.CacheSr);
|
||||
|
||||
newPvsCacheStorages.Add(pvsCacheStorage);
|
||||
}
|
||||
|
||||
|
@ -76,15 +76,16 @@ namespace XenAdmin.Actions
|
||||
throw new Exception(Messages.CDDRIVE_MAX_ALLOWED_VBDS);
|
||||
}
|
||||
|
||||
XenAPI.VBD cdDrive = new XenAPI.VBD();
|
||||
cdDrive.VM = new XenAPI.XenRef<XenAPI.VM>(VM.opaque_ref);
|
||||
cdDrive.VDI = null;
|
||||
cdDrive.bootable = false;
|
||||
cdDrive.device = "";
|
||||
cdDrive.userdevice = allowedDevices.Contains("3") ? "3" : allowedDevices[0];
|
||||
cdDrive.empty = true;
|
||||
cdDrive.type = XenAPI.vbd_type.CD;
|
||||
cdDrive.mode = XenAPI.vbd_mode.RO;
|
||||
XenAPI.VBD cdDrive = new XenAPI.VBD
|
||||
{
|
||||
VM = new XenAPI.XenRef<XenAPI.VM>(VM.opaque_ref),
|
||||
bootable = false,
|
||||
device = "",
|
||||
userdevice = allowedDevices.Contains("3") ? "3" : allowedDevices[0],
|
||||
empty = true,
|
||||
type = XenAPI.vbd_type.CD,
|
||||
mode = XenAPI.vbd_mode.RO
|
||||
};
|
||||
|
||||
VbdSaveAndPlugAction cdCreate = new VbdSaveAndPlugAction(VM, cdDrive, Messages.DVD_DRIVE, Session, InstallingTools, true,_showMustRebootBoxCD,_showVBDWarningBox);
|
||||
cdCreate.RunExternal(Session);
|
||||
|
@ -441,16 +441,16 @@ namespace XenAdmin.Actions.VMActions
|
||||
List<string> devices = AllowedVBDs;
|
||||
if (devices.Count == 0)
|
||||
throw new Exception(Messages.NO_MORE_USERDEVICES);
|
||||
VBD vbd = new VBD();
|
||||
vbd.bootable = InsMethod == InstallMethod.CD;
|
||||
vbd.empty = true;
|
||||
vbd.unpluggable = true;
|
||||
vbd.mode = vbd_mode.RO;
|
||||
vbd.type = vbd_type.CD;
|
||||
vbd.userdevice = devices.Contains("3") ? "3" : devices[0];
|
||||
vbd.device = "";
|
||||
vbd.VM = new XenRef<VM>(VM.opaque_ref);
|
||||
vbd.VDI = null;
|
||||
VBD vbd = new VBD
|
||||
{
|
||||
bootable = InsMethod == InstallMethod.CD,
|
||||
empty = true,
|
||||
unpluggable = true,
|
||||
mode = vbd_mode.RO,
|
||||
type = vbd_type.CD,
|
||||
userdevice = devices.Contains("3") ? "3" : devices[0],
|
||||
VM = new XenRef<VM>(VM.opaque_ref)
|
||||
};
|
||||
RelatedTask = VBD.async_create(Session, vbd);
|
||||
PollToCompletion(60, 65);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user