/// <summary> /// Write Device into xenstore, only update for the first time /// </summary> /// <param name="device">device key representing a device</param> /// <param name="nic">nic object inside VM</param> override protected void writeDevice(string device, NetworkInterface nic) { string namePath = string.Format("{0}/{1}/name", attrPath, getDeviceIndexFromIndexedDevicePath(device)); AXenStoreItem name = wmisession.GetXenStoreItem(namePath); name.value = nic.Name; if (name.GetStatus() != ManagementStatus.NoError) { Debug.Print(string.Format("write to {0} error", namePath)); } }
void addHotFixInfoToStore() { uint index = 0; if (enablehotfixinfo) { foreach (ManagementObject mo in WmiBase.Singleton.Win32_QuickFixEngineering) { // Ignore Hotfixes where the id has been replaced by "File 1" // Because these hotfixes have been replaced string id = (string)mo["HotFixID"]; if (!id.Equals("File 1")) { AXenStoreItem hotfix = wmisession.GetXenStoreItem("attr/os/hotfixes/" + index.ToString()); hotfix.value = id; if (hotfix.GetStatus() == ManagementStatus.AccessDenied) { enablehotfixinfo = false; } index++; } } } }