Пример #1
0
 public PGPU(string uuid,
             XenRef <PCI> PCI,
             XenRef <GPU_group> GPU_group,
             XenRef <Host> host,
             Dictionary <string, string> other_config,
             List <XenRef <VGPU_type> > supported_VGPU_types,
             List <XenRef <VGPU_type> > enabled_VGPU_types,
             List <XenRef <VGPU> > resident_VGPUs,
             Dictionary <XenRef <VGPU_type>, long> supported_VGPU_max_capacities,
             pgpu_dom0_access dom0_access,
             bool is_system_display_device,
             Dictionary <string, string> compatibility_metadata)
 {
     this.uuid                          = uuid;
     this.PCI                           = PCI;
     this.GPU_group                     = GPU_group;
     this.host                          = host;
     this.other_config                  = other_config;
     this.supported_VGPU_types          = supported_VGPU_types;
     this.enabled_VGPU_types            = enabled_VGPU_types;
     this.resident_VGPUs                = resident_VGPUs;
     this.supported_VGPU_max_capacities = supported_VGPU_max_capacities;
     this.dom0_access                   = dom0_access;
     this.is_system_display_device      = is_system_display_device;
     this.compatibility_metadata        = compatibility_metadata;
 }
Пример #2
0
        private void ProcessRecordDom0Access(string pgpu)
        {
            RunApiCall(() =>
            {
                pgpu_dom0_access obj = XenAPI.PGPU.get_dom0_access(session, pgpu);

                WriteObject(obj, true);
            });
        }
Пример #3
0
 public static string ToString(pgpu_dom0_access x)
 {
     switch (x)
     {
         case pgpu_dom0_access.enabled:
             return "enabled";
         case pgpu_dom0_access.disable_on_reboot:
             return "disable_on_reboot";
         case pgpu_dom0_access.disabled:
             return "disabled";
         case pgpu_dom0_access.enable_on_reboot:
             return "enable_on_reboot";
         default:
             return "unknown";
     }
 }
Пример #4
0
        public static string ToString(pgpu_dom0_access x)
        {
            switch (x)
            {
            case pgpu_dom0_access.enabled:
                return("enabled");

            case pgpu_dom0_access.disable_on_reboot:
                return("disable_on_reboot");

            case pgpu_dom0_access.disabled:
                return("disabled");

            case pgpu_dom0_access.enable_on_reboot:
                return("enable_on_reboot");
            }
            return("unknown");
        }
Пример #5
0
        public static string StringOf(this pgpu_dom0_access x)
        {
            switch (x)
            {
            case pgpu_dom0_access.enabled:
                return("enabled");

            case pgpu_dom0_access.disable_on_reboot:
                return("disable_on_reboot");

            case pgpu_dom0_access.disabled:
                return("disabled");

            case pgpu_dom0_access.enable_on_reboot:
                return("enable_on_reboot");

            default:
                return("unknown");
            }
        }
Пример #6
0
        private void ProcessRecordDisableDom0Access(string pgpu)
        {
            if (!ShouldProcess(pgpu, "PGPU.disable_dom0_access"))
            {
                return;
            }

            RunApiCall(() =>
            {
                var contxt = _context as XenPGPUActionDisableDom0AccessDynamicParameters;

                if (contxt != null && contxt.Async)
                {
                    taskRef = XenAPI.PGPU.async_disable_dom0_access(session, pgpu);

                    if (PassThru)
                    {
                        XenAPI.Task taskObj = null;
                        if (taskRef != "OpaqueRef:NULL")
                        {
                            taskObj            = XenAPI.Task.get_record(session, taskRef.opaque_ref);
                            taskObj.opaque_ref = taskRef.opaque_ref;
                        }

                        WriteObject(taskObj, true);
                    }
                }
                else
                {
                    pgpu_dom0_access obj = XenAPI.PGPU.disable_dom0_access(session, pgpu);

                    if (PassThru)
                    {
                        WriteObject(obj, true);
                    }
                }
            });
        }
Пример #7
0
 public static string ToString(pgpu_dom0_access x)
 {
     return(x.StringOf());
 }