Esempio n. 1
0
        internal void UpdateFromProxy(Proxy_VBD proxy)
        {
            this.uuid = (proxy.uuid == null) ? null : proxy.uuid;
            this.allowed_operations = (proxy.allowed_operations == null) ? null : Helper.StringArrayToEnumList <vbd_operations>(proxy.allowed_operations);
            this.current_operations = (proxy.current_operations == null) ? null : Maps.convert_from_proxy_string_vbd_operations(proxy.current_operations);
            this.VM = (proxy.VM == null) ? null : XenRef <WinAPI.VM> .Create(proxy.VM);

            this.VDI = (proxy.VDI == null) ? null : XenRef <WinAPI.VDI> .Create(proxy.VDI);

            this.device                   = (proxy.device == null) ? null : proxy.device;
            this.userdevice               = (proxy.userdevice == null) ? null : proxy.userdevice;
            this.bootable                 = proxy.bootable;
            this.mode                     = (proxy.mode == null) ? vbd_mode.RO : ((vbd_mode)Helper.EnumParseDefault(typeof(vbd_mode), proxy.mode));
            this.type                     = (proxy.type == null) ? vbd_type.CD : ((vbd_type)Helper.EnumParseDefault(typeof(vbd_type), proxy.type));
            this.unpluggable              = proxy.unpluggable;
            this.storage_lock             = proxy.storage_lock;
            this.empty                    = proxy.empty;
            this.other_config             = (proxy.other_config == null) ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
            this.currently_attached       = proxy.currently_attached;
            this.status_code              = (proxy.status_code == null) ? 0L : long.Parse(proxy.status_code);
            this.status_detail            = (proxy.status_detail == null) ? null : proxy.status_detail;
            this.runtime_properties       = (proxy.runtime_properties == null) ? null : Maps.convert_from_proxy_string_string(proxy.runtime_properties);
            this.qos_algorithm_type       = (proxy.qos_algorithm_type == null) ? null : proxy.qos_algorithm_type;
            this.qos_algorithm_params     = (proxy.qos_algorithm_params == null) ? null : Maps.convert_from_proxy_string_string(proxy.qos_algorithm_params);
            this.qos_supported_algorithms = (proxy.qos_supported_algorithms == null) ? new string[0] : proxy.qos_supported_algorithms;
            this.metrics                  = (proxy.metrics == null) ? null : XenRef <VBD_metrics> .Create(proxy.metrics);
        }
Esempio n. 2
0
 public override string SaveChanges(Session session, string opaqueRef, VBD server)
 {
     if (opaqueRef == null)
     {
         Proxy_VBD y_vbd = this.ToProxy();
         return(session.proxy.vbd_create(session.uuid, y_vbd).parse());
     }
     if (!Helper.AreEqual2 <string>(this._userdevice, server._userdevice))
     {
         set_userdevice(session, opaqueRef, this._userdevice);
     }
     if (!Helper.AreEqual2 <bool>(this._bootable, server._bootable))
     {
         set_bootable(session, opaqueRef, this._bootable);
     }
     if (!Helper.AreEqual2 <vbd_mode>(this._mode, server._mode))
     {
         set_mode(session, opaqueRef, this._mode);
     }
     if (!Helper.AreEqual2 <vbd_type>(this._type, server._type))
     {
         set_type(session, opaqueRef, this._type);
     }
     if (!Helper.AreEqual2 <bool>(this._unpluggable, server._unpluggable))
     {
         set_unpluggable(session, opaqueRef, this._unpluggable);
     }
     if (!Helper.AreEqual2 <Dictionary <string, string> >(this._other_config, server._other_config))
     {
         set_other_config(session, opaqueRef, this._other_config);
     }
     if (!Helper.AreEqual2 <string>(this._qos_algorithm_type, server._qos_algorithm_type))
     {
         set_qos_algorithm_type(session, opaqueRef, this._qos_algorithm_type);
     }
     if (!Helper.AreEqual2 <Dictionary <string, string> >(this._qos_algorithm_params, server._qos_algorithm_params))
     {
         set_qos_algorithm_params(session, opaqueRef, this._qos_algorithm_params);
     }
     return(null);
 }
Esempio n. 3
0
 public VBD(Proxy_VBD proxy)
 {
     this.UpdateFromProxy(proxy);
 }