示例#1
0
        private void RunHostsThread()
        {
            log.Info("Setting up running hosts in another thread");
            Udbus.v4v.v4vConnection            connection = null;
            Udbus.Core.ServiceConnectionParams serviceConnectionParams = null;
            DbusHosts.GetV4vConnection(out connection, out serviceConnectionParams, Log_io_debug, this.eventStop, log);

            log.Info("Established service connection");
            FinishRunHosts(connection, serviceConnectionParams);
            log.Info("Finished setting up running hosts in another thread");
        }
        public XenClientGuestService()
        {
            // EventSource needs to be something for logging not to throw exception.
            bool bNoSource = string.IsNullOrEmpty(this.EventLog.Source);

            if (bNoSource) // If no source string setup
            {
                if (!string.IsNullOrEmpty(this.ServiceName))
                {
                    this.EventLog.Source = this.ServiceName;
                }
                else
                {
                    this.EventLog.Source = Logging.LogCreation.Service;
                }
            } // Ends if no source string setup

            log = Logging.LogCreation.CreateServiceLogger(this); // Log pre initialised service.
            Udbus.Core.Logging.ILog logRoot = Logging.LogCreation.CreateRootLogger(this); // Root logger pre initialised service.

            InitializeComponent();

            // Try to ammend event source name to something more meaningful.
            if (bNoSource && !string.IsNullOrEmpty(this.ServiceName)) // If no source string setup
            {
                this.EventLog.Source = this.ServiceName;
            } // Ends if no source string setup

            logRoot = Logging.LogCreation.ReplaceRootLogger(this, logRoot); // Root logger
            log     = Logging.LogCreation.ReplaceServiceLogger(this, log); // Log post initialised service.

            // Initialize fields.
            this.dbusHosts = new DbusHosts(this.EventLog);
            Udbus.Core.ServiceConnectionParams serviceConnectionParams;
            this.diagSignals = XcDiagRunner.CreateDbusDiag(out serviceConnectionParams, log, Log_Io_Debug);
            this.diagSignals.GatherRequest += this.OnGatherRequest;
            System.Threading.Thread xcdiagSignalsThread;
            this.diagsignalsThreadInfo = DbusHosts.RunSignalsAsync(out xcdiagSignalsThread, serviceConnectionParams);

            //We're gonna start doing our own thing logs wise...
            if (!EventLog.SourceExists("XenClientGuestService"))
            {
                EventLog.CreateEventSource("XenClientGuestService", "Application");
            }
            EventLog.WriteEntry("XenClientGuestService", "XenClientGuestService Logs Initialised");
        }
示例#3
0
        internal static com.citrix.xenclient.xenmgr.diag.diagService CreateDbusDiag(out Udbus.Core.ServiceConnectionParams serviceConnectionParams,
                                                                                    Udbus.Core.Logging.ILog log, Udbus.Serialization.UdbusDelegates.D_io_debug io_debug)
        {
            // Create a V4V connection.
            Udbus.v4v.v4vConnection           connection;
            System.Threading.ManualResetEvent stop = new System.Threading.ManualResetEvent(false);
            DbusHosts.GetV4vConnection(out connection, out serviceConnectionParams,
                                       io_debug, stop,
                                       log
                                       );

            // Use dbus interface to xenmgr.diag.
            Udbus.Serialization.DbusConnectionParameters dbusConnectionParameters = com.citrix.xenclient.xenmgr.diag.diagService.DefaultConnectionParameters;
            dbusConnectionParameters.Destination = "com.citrix.xenclient.xenmgr";
            com.citrix.xenclient.xenmgr.diag.diagService diag = com.citrix.xenclient.xenmgr.diag.diagService.Create(serviceConnectionParams, dbusConnectionParameters);

            return(diag);
        }
        public XenClientGuestService()
        {
            // EventSource needs to be something for logging not to throw exception.
            bool bNoSource = string.IsNullOrEmpty(this.EventLog.Source);
            if (bNoSource) // If no source string setup
            {
                if (!string.IsNullOrEmpty(this.ServiceName))
                {
                    this.EventLog.Source = this.ServiceName;
                }
                else
                {
                    this.EventLog.Source = Logging.LogCreation.Service;
                }

            } // Ends if no source string setup

            log = Logging.LogCreation.CreateServiceLogger(this); // Log pre initialised service.
            Udbus.Core.Logging.ILog logRoot = Logging.LogCreation.CreateRootLogger(this); // Root logger pre initialised service.

            InitializeComponent();

            // Try to ammend event source name to something more meaningful.
            if (bNoSource && !string.IsNullOrEmpty(this.ServiceName)) // If no source string setup
            {
                this.EventLog.Source = this.ServiceName;

            } // Ends if no source string setup

            logRoot = Logging.LogCreation.ReplaceRootLogger(this, logRoot); // Root logger
            log = Logging.LogCreation.ReplaceServiceLogger(this, log); // Log post initialised service.

            // Initialize fields.
            this.dbusHosts = new DbusHosts(this.EventLog);
            Udbus.Core.ServiceConnectionParams serviceConnectionParams;
            this.diagSignals = XcDiagRunner.CreateDbusDiag(out serviceConnectionParams, log, Log_Io_Debug);
            this.diagSignals.GatherRequest += this.OnGatherRequest;
            System.Threading.Thread xcdiagSignalsThread;
            this.diagsignalsThreadInfo = DbusHosts.RunSignalsAsync(out xcdiagSignalsThread, serviceConnectionParams);

            //We're gonna start doing our own thing logs wise...
            if (!EventLog.SourceExists("XenClientGuestService")) EventLog.CreateEventSource("XenClientGuestService", "Application");
            EventLog.WriteEntry("XenClientGuestService", "XenClientGuestService Logs Initialised");
        }