示例#1
0
        public void From_XML(System.Xml.Linq.XElement xml)
        {
            Reset();
            var element = xml.Element("vcpu");

            if (element == null)
            {
                if (xml.Name == "vcpu")
                {
                    element = xml;
                }
                else
                {
                    element = null;
                }
            }
            if (element != null)
            {
                var i = 0;
                Int32.TryParse(element.Value, out i);
                if (i == 0)
                {
                    i = 1;
                }
                vCpu_Count = i;
            }
            element = xml.Element("cpu");
            if (element != null)
            {
                element = element.Element("model");
                if (element != null)
                {
                    var b = CPU_Models.qemu64;
                    Enum.TryParse(element.Value, true, out b);
                    Cpu_Model = b;
                }
                else
                {
                    Cpu_Model = CPU_Models.Hypervisor_Default;
                }
            }
        }
示例#2
0
 private void Reset()
 {
     vCpu_Count = 1;
     Cpu_Model  = CPU_Models.qemu64;// AGAIN, I am using a vm within a vm to test, so this must be selected as the default..
     // Socket_Count = Core_Count = Thread_Count = -1;
 }