コード例 #1
0
ファイル: XenBus.cs プロジェクト: kostaslamda/win-installer
        public static bool IsFunctioning()
        {
            if (!IsPresent(
                    Devs.DEV_0001 |
                    Devs.DEV_0002 |
                    Devs.DEV_C000,
                    false))
            {
                return(false);
            }

            if (!PVDevice.IsServiceRunning(("xenbus")))
            {
                return(false);
            }

            if (PVDevice.NeedsReboot("xenbus"))
            {
                Trace.WriteLine("BUS: needs reboot");
                return(false);
            }

            Trace.WriteLine("BUS: device installed");
            return(true);
        }
コード例 #2
0
ファイル: XenIface.cs プロジェクト: kostaslamda/win-installer
        public static bool IsFunctioning()
        {
            if (!PVDevice.IsServiceRunning("xeniface"))
            {
                return(false);
            }

            // This part is currently not needed. It will be kept
            // in place for a while, just in case..

            /*try
             * {
             *  XenIface.CreateSession();
             * }
             * catch
             * {
             *  Trace.WriteLine("IFACE: CreateSession() failed");
             *  return false;
             * }
             *
             * int noChildNodes = 0;
             *
             * try
             * {
             *  noChildNodes = XenIface.GetNoChildNodes();
             * }
             * catch { }
             * finally
             * {
             *  XenIface.DestroySession();
             * }
             *
             * if (noChildNodes == 0)
             * {
             *  int noNeedToReboot =
             *      (int)Application.CommonAppDataRegistry.GetValue(
             *          "DriverFinalReboot",
             *          0
             *      );
             *
             *  Trace.WriteLine("Have I rebooted? " + noNeedToReboot.ToString());
             *  if (noNeedToReboot == 0)
             *  {
             *      Application.CommonAppDataRegistry.SetValue(
             *          "DriverFinalReboot",
             *          1
             *      );
             *
             *      return false;
             *  }
             * }*/

            Trace.WriteLine("IFACE: device installed");
            return(true);
        }
コード例 #3
0
        public static bool IsFunctioning(out bool bNeedReinstall)
        {
            // If there are no vifs for the VM, xenbus
            // does not enumerate a device for xenvif
            bNeedReinstall = false;
            if (PVDevice.IsServiceNeeded("VIF"))
            {
                if (!Helpers.IsServiceRunning("xenvif"))
                {
                    bNeedReinstall = true;
                    return(false);
                }

                if (!Device.ChildrenInstalled("xenvif"))
                {
                    Trace.WriteLine("VIF: children not installed");
                    return(false);
                }

                if (PVDevice.NeedsReboot("xenvif"))
                {
                    Trace.WriteLine("VIF: needs reboot");
                    return(false);
                }

                if (!Installer.GetFlag(
                        Installer.States.NetworkSettingsRestored))
                {
                    try
                    {
                        FixupAliases();
                        NetworkSettingsSaveRestore(false); // Restore
                        Installer.SetFlag(
                            Installer.States.NetworkSettingsRestored
                            );
                    }
                    catch (Exception e)
                    {
                        Trace.WriteLine(
                            "VIF: Restoring network config triggered " +
                            "an exception: " + e.ToString()
                            );
                    }
                }

                Trace.WriteLine("VIF: device installed");
            }
            else
            {
                Trace.WriteLine("VIF: service not needed");
            }

            return(true);
        }
コード例 #4
0
ファイル: XenVbd.cs プロジェクト: kostaslamda/win-installer
        public static bool IsFunctioning()
        {
            if (!PVDevice.IsServiceRunning("xenvbd"))
            {
                return(false);
            }

            if (PVDevice.NeedsReboot("xenvbd"))
            {
                Trace.WriteLine("VBD: needs reboot");
                return(false);
            }

            Trace.WriteLine("VBD: device installed");
            return(true);
        }
コード例 #5
0
ファイル: XenVbd.cs プロジェクト: xcp-ng/win-installer
        public static bool IsFunctioning(out bool bNeedReinstall)
        {
            bNeedReinstall = false;
            if (!Helpers.IsServiceRunning("xenvbd"))
            {
                bNeedReinstall = true;
                return(false);
            }

            if (PVDevice.NeedsReboot("xenvbd"))
            {
                Trace.WriteLine("VBD: needs reboot");
                return(false);
            }

            Trace.WriteLine("VBD: device installed");
            return(true);
        }