Ejemplo n.º 1
0
    def __init__(self, name, mac, is_shared, bridge=None):
        vmmGObject.__init__(self)

        self.name = name
        self.mac = mac
        self.shared = is_shared
        self.bridge = bridge
Ejemplo n.º 2
0
    def __init__(self, engine):
        vmmGObject.__init__(self)

        self.topwin = None
        self.err = vmmErrorDialog()

        self.conn_menuitems = {}
        self.conn_vm_menuitems = {}
        self.vm_action_dict = {}
        self.systray_menu = None
        self.systray_icon = None
        self.systray_indicator = False

        engine.connect("conn-added", self.conn_added)
        engine.connect("conn-removed", self.conn_removed)

        # Are we using Application Indicators?
        if AppIndicator3 is not None:
            self.systray_indicator = True

        self.init_systray_menu()

        self.add_gconf_handle(
            self.config.on_view_system_tray_changed(self.show_systray))

        self.show_systray()
Ejemplo n.º 3
0
    def __init__(self, vm, target_port, name):
        vmmGObject.__init__(self)

        self.vm = vm
        self.target_port = target_port
        self.name = name
        self.lastpath = None

        # Always use libvirt console streaming if available, so
        # we exercise the same code path (it's what virsh console does)
        if vmmSerialConsole.support_remote_console(self.vm):
            self.console = LibvirtConsoleConnection(self.vm)
        else:
            self.console = LocalConsoleConnection(self.vm)

        self.serial_popup = None
        self.serial_copy = None
        self.serial_paste = None
        self.serial_close = None
        self.init_popup()

        self.terminal = None
        self.init_terminal()

        self.box = None
        self.error_label = None
        self.init_ui()

        self.vm.connect("status-changed", self.vm_status_changed)
Ejemplo n.º 4
0
    def __init__(self, engine):
        vmmGObject.__init__(self)

        self.topwin = None
        self.err = vmmErrorDialog()

        self.conn_menuitems = {}
        self.conn_vm_menuitems = {}
        self.vm_action_dict = {}
        self.systray_menu = None
        self.systray_icon = None
        self.systray_indicator = False

        engine.connect("conn-added", self.conn_added)
        engine.connect("conn-removed", self.conn_removed)

        # Are we using Application Indicators?
        if appindicator is not None:
            self.systray_indicator = True

        self.init_systray_menu()

        self.add_gconf_handle(
            self.config.on_view_system_tray_changed(self.show_systray))

        self.show_systray()
Ejemplo n.º 5
0
    def __init__(self):
        vmmGObject.__init__(self)

        self.windowConnect = None
        self.windowPreferences = None
        self.windowAbout = None
        self.windowCreate = None
        self.windowManager = None
        self.windowMigrate = None

        self.conns = {}
        self.err = vmmErrorDialog()

        self.timer = None
        self.last_timeout = 0

        self.systray = None
        self.delete_dialog = None
        self.application = Gtk.Application(
                                 application_id="com.redhat.virt-manager",
                                 flags=0)
        self.application.connect("activate", self._activate)
        self._appwindow = Gtk.Window()

        self._tick_counter = 0
        self._tick_thread_slow = False
        self._tick_thread = threading.Thread(name="Tick thread",
                                            target=self._handle_tick_queue,
                                            args=())
        self._tick_thread.daemon = True
        self._tick_queue = Queue.PriorityQueue(100)

        self.inspection = None
        self._create_inspection_thread()

        # Counter keeping track of how many manager and details windows
        # are open. When it is decremented to 0, close the app or
        # keep running in system tray if enabled
        self.windows = 0

        # Public bits set by virt-manager cli
        self.skip_autostart = False
        self.uri_at_startup = None
        self.uri_cb = None
        self.show_manager_window = True

        self.init_systray()

        self.add_gconf_handle(
            self.config.on_stats_update_interval_changed(self.reschedule_timer))
        self.add_gconf_handle(
            self.config.on_view_system_tray_changed(self.system_tray_changed))

        self.schedule_timer()
        self.load_stored_uris()

        self._tick_thread.start()
        self.tick()
Ejemplo n.º 6
0
    def __init__(self, conn):
        vmmGObject.__init__(self)
        self._conn = conn

        self._xml = None
        self._is_xml_valid = False

        # These should be set by the child classes if necessary
        self._inactive_xml_flags = 0
        self._active_xml_flags = 0
Ejemplo n.º 7
0
    def __init__(self, name, mac, is_shared, bridge=None, hal_path=None):
        vmmGObject.__init__(self)

        self.name = name
        self.mac = mac
        self.shared = is_shared
        self.bridge = bridge

        # Used for HAL backend population
        self.hal_path = hal_path
Ejemplo n.º 8
0
    def __init__(self, conn):
        vmmGObject.__init__(self)
        self._conn = conn

        self._xml = None
        self._is_xml_valid = False

        # These should be set by the child classes if necessary
        self._inactive_xml_flags = 0
        self._active_xml_flags = 0
    def __init__(self, name, mac, is_shared, bridge=None, hal_path=None):
        vmmGObject.__init__(self)

        self.name = name
        self.mac = mac
        self.shared = is_shared
        self.bridge = bridge

        # Used for HAL backend population
        self.hal_path = hal_path
    def __init__(self):
        vmmGObject.__init__(self)

        self._thread = Thread(name="inspection thread", target=self._run)
        self._thread.daemon = True
        self._wait = 15 * 1000 # 15 seconds

        self._q = Queue()
        self._conns = {}
        self._vmseen = {}
        self._cached_data = {}
    def __init__(self):
        vmmGObject.__init__(self)

        self.bus = None
        self.hal_iface = None
        self.sigs = []

        # Error message we encountered when initializing
        self.startup_error = None

        self._dbus_connect()
Ejemplo n.º 12
0
    def __init__(self):
        vmmGObject.__init__(self)

        self.bus = None
        self.hal_iface = None
        self.sigs = []

        # Error message we encountered when initializing
        self.startup_error = None

        self._dbus_connect()
Ejemplo n.º 13
0
    def __init__(self):
        vmmGObject.__init__(self)

        self._thread = Thread(name="inspection thread", target=self._run)
        self._thread.daemon = True
        self._wait = 5 * 1000  # 5 seconds

        self._q = Queue()
        self._conns = {}
        self._vmseen = {}
        self._cached_data = {}
Ejemplo n.º 14
0
    def __init__(self):
        vmmGObject.__init__(self)

        self.windowConnect = None
        self.windowPreferences = None
        self.windowAbout = None
        self.windowCreate = None
        self.windowManager = None
        self.windowMigrate = None

        self.conns = {}
        self.err = vmmErrorDialog()

        self.timer = None
        self.last_timeout = 0

        self.systray = None
        self.delete_dialog = None
        self.application = Gtk.Application(
                                 application_id="com.redhat.virt-manager",
                                 flags=0)
        self.application.connect("activate", self._activate)
        self._appwindow = Gtk.Window()

        self._tick_thread = None
        self._tick_thread_slow = False
        if not self.config.support_threading:
            logging.debug("Libvirt doesn't support threading, skipping.")

        self.inspection = None
        self._create_inspection_thread()

        # Counter keeping track of how many manager and details windows
        # are open. When it is decremented to 0, close the app or
        # keep running in system tray if enabled
        self.windows = 0

        # Public bits set by virt-manager cli
        self.skip_autostart = False
        self.uri_at_startup = None
        self.uri_cb = None
        self.show_manager_window = True

        self.init_systray()

        self.add_gconf_handle(
            self.config.on_stats_update_interval_changed(self.reschedule_timer))
        self.add_gconf_handle(
            self.config.on_view_system_tray_changed(self.system_tray_changed))

        self.schedule_timer()
        self.load_stored_uris()
        self.tick()
Ejemplo n.º 15
0
    def __init__(self, uri, readOnly=False):
        vmmGObject.__init__(self)

        self._uri = uri
        if self._uri is None or self._uri.lower() == "xen":
            self._uri = "xen:///"

        self.readOnly = readOnly
        self.state = self.STATE_DISCONNECTED
        self.connectThread = None
        self.connectError = None
        self._ticklock = threading.Lock()
        self.vmm = None

        self._caps = None
        self._caps_xml = None
        self._is_virtinst_test_uri = virtinst.cli.is_virtinst_test_uri(
                                        self._uri)

        self.network_capable = None
        self._storage_capable = None
        self.interface_capable = None
        self._nodedev_capable = None

        self._xml_flags = {}
        self._support_dict = {}

        # Physical network interfaces: name -> virtinst.NodeDevice
        self.nodedevs = {}
        # Physical network interfaces: name (eth0) -> vmmNetDevice
        self.netdevs = {}
        # Physical media devices: vmmMediaDevice.key -> vmmMediaDevice
        self.mediadevs = {}
        # Connection Storage pools: name -> vmmInterface
        self.interfaces = {}
        # Connection Storage pools: UUID -> vmmStoragePool
        self.pools = {}
        # Virtual networks UUUID -> vmmNetwork object
        self.nets = {}
        # Virtual machines. UUID -> vmmDomain object
        self.vms = {}
        # Resource utilization statistics
        self.record = []
        self.hostinfo = None

        self.netdev_initialized = False
        self.netdev_error = ""
        self.netdev_use_libvirt = False

        self.mediadev_initialized = False
        self.mediadev_error = ""
        self.mediadev_use_libvirt = False
Ejemplo n.º 16
0
    def __init__(self, uri, readOnly=False):
        vmmGObject.__init__(self)

        self._uri = uri
        if self._uri is None or self._uri.lower() == "xen":
            self._uri = "xen:///"

        self.readOnly = readOnly
        self.state = self.STATE_DISCONNECTED
        self.connectThread = None
        self.connectError = None
        self._ticklock = threading.Lock()
        self.vmm = None

        self._caps = None
        self._caps_xml = None
        self._is_virtinst_test_uri = virtinst.cli.is_virtinst_test_uri(
            self._uri)

        self.network_capable = None
        self._storage_capable = None
        self.interface_capable = None
        self._nodedev_capable = None

        self._xml_flags = {}
        self._support_dict = {}

        # Physical network interfaces: name -> virtinst.NodeDevice
        self.nodedevs = {}
        # Physical network interfaces: name (eth0) -> vmmNetDevice
        self.netdevs = {}
        # Physical media devices: vmmMediaDevice.key -> vmmMediaDevice
        self.mediadevs = {}
        # Connection Storage pools: name -> vmmInterface
        self.interfaces = {}
        # Connection Storage pools: UUID -> vmmStoragePool
        self.pools = {}
        # Virtual networks UUUID -> vmmNetwork object
        self.nets = {}
        # Virtual machines. UUID -> vmmDomain object
        self.vms = {}
        # Resource utilization statistics
        self.record = []
        self.hostinfo = None

        self.netdev_initialized = False
        self.netdev_error = ""
        self.netdev_use_libvirt = False

        self.mediadev_initialized = False
        self.mediadev_error = ""
        self.mediadev_use_libvirt = False
Ejemplo n.º 17
0
    def __init__(self):
        vmmGObject.__init__(self)

        self.windowConnect = None
        self.windowPreferences = None
        self.windowAbout = None
        self.windowCreate = None
        self.windowManager = None
        self.windowMigrate = None

        self.conns = {}
        self.err = vmmErrorDialog()

        self.timer = None
        self.last_timeout = 0

        self.systray = None
        self.application = Gtk.Application(
                                 application_id="com.redhat.virt-manager",
                                 flags=0)
        self.application.connect("activate", self._activate)
        self._appwindow = Gtk.Window()

        self._tick_thread = None
        self._tick_thread_slow = False
        if not self.config.support_threading:
            logging.debug("Libvirt doesn't support threading, skipping.")

        self.inspection = None
        self._create_inspection_thread()

        # Counter keeping track of how many manager and details windows
        # are open. When it is decremented to 0, close the app or
        # keep running in system tray if enabled
        self.windows = 0

        # Public bits set by virt-manager cli
        self.skip_autostart = False
        self.uri_at_startup = None
        self.uri_cb = None

        self.init_systray()

        self.add_gconf_handle(
            self.config.on_stats_update_interval_changed(self.reschedule_timer))
        self.add_gconf_handle(
            self.config.on_view_system_tray_changed(self.system_tray_changed))

        self.schedule_timer()
        self.load_stored_uris()
        self.tick()
Ejemplo n.º 18
0
    def __init__(self, path, key, has_media, media_label, media_key,
                 nodedev_obj=None, media_type=MEDIA_CDROM):
        vmmGObject.__init__(self)

        self.path = path
        self.key = key
        self._has_media = has_media
        self.media_label = media_label
        self.media_key = media_key
        self.media_type = media_type

        self.nodedev_obj = nodedev_obj
        self.do_poll = False
        self.last_tick = 0
    def __init__(self):
        vmmGObject.__init__(self)

        self.windowConnect = None
        self.windowPreferences = None
        self.windowAbout = None
        self.windowCreate = None
        self.windowManager = None
        self.windowMigrate = None

        # Start Sandeep
        self.windowVMAffinityAbout = None
        self.windowVMAffinityCreateNewAffinityRule = None
        self.windowVMAffinityDeleteAffinityRule = None
        self.windowVMAffinityViewRules = None
        self.windowVMAffinityManageRules = None
        self.windowVMAffinityCreateHostAffinityRule = None
        self.windowVMAffinityDeleteHostAffinityRule = None
        self.windowVMAffinityViewHostAffinityRules = None
        # Stop Sandeep

        self.conns = {}
        self.err = vmmErrorDialog()

        self.timer = None
        self.last_timeout = 0

        self.systray = None

        self._tick_thread = None
        self._tick_thread_slow = False
        if not self.config.support_threading:
            logging.debug("Libvirt doesn't support threading, skipping.")

        self.inspection = None
        self._create_inspection_thread()

        # Counter keeping track of how many manager and details windows
        # are open. When it is decremented to 0, close the app or
        # keep running in system tray if enabled
        self.windows = 0

        self.init_systray()

        self.add_gconf_handle(self.config.on_stats_update_interval_changed(self.reschedule_timer))
        self.add_gconf_handle(self.config.on_view_system_tray_changed(self.system_tray_changed))

        self.schedule_timer()
        self.load_stored_uris()
        self.tick()
Ejemplo n.º 20
0
    def __init__(self, conn, backend, key, parseclass):
        vmmGObject.__init__(self)
        self._conn = conn
        self._backend = backend
        self._key = key
        self._parseclass = parseclass

        self._xml = None
        self._is_xml_valid = False

        self._xmlobj = None
        self._xmlobj_to_define = None

        # These should be set by the child classes if necessary
        self._inactive_xml_flags = 0
        self._active_xml_flags = 0

        self.connect("config-changed", self._reparse_xml)
Ejemplo n.º 21
0
    def __init__(self):
        vmmGObject.__init__(self)

        self.windowConnect = None
        self.windowPreferences = None
        self.windowAbout = None
        self.windowCreate = None
        self.windowManager = None
        self.windowMigrate = None

        self.conns = {}
        self.err = vmmErrorDialog()

        self.timer = None
        self.last_timeout = 0

        self.systray = None

        self._tick_thread = None
        self._tick_thread_slow = False
        if not self.config.support_threading:
            logging.debug("Libvirt doesn't support threading, skipping.")

        self.inspection = None
        self._create_inspection_thread()

        # Counter keeping track of how many manager and details windows
        # are open. When it is decremented to 0, close the app or
        # keep running in system tray if enabled
        self.windows = 0

        #系统托盘
        self.init_systray()

        self.add_gconf_handle(
            self.config.on_stats_update_interval_changed(
                self.reschedule_timer))
        self.add_gconf_handle(
            self.config.on_view_system_tray_changed(self.system_tray_changed))

        self.schedule_timer()
        self.load_stored_uris()
        self.tick()
Ejemplo n.º 22
0
    def __init__(self,
                 path,
                 key,
                 has_media,
                 media_label,
                 media_key,
                 nodedev_obj=None,
                 media_type=MEDIA_CDROM):
        vmmGObject.__init__(self)

        self.path = path
        self.key = key
        self._has_media = has_media
        self.media_label = media_label
        self.media_key = media_key
        self.media_type = media_type

        self.nodedev_obj = nodedev_obj
        self.do_poll = False
        self.last_tick = 0
Ejemplo n.º 23
0
 def __init__(self, console):
     vmmGObject.__init__(self)
     self.console = console
     self.display = None
Ejemplo n.º 24
0
    def __init__(self, vm):
        vmmGObject.__init__(self)

        self.vm = vm
        self.conn = vm.conn
Ejemplo n.º 25
0
 def __init__(self, console):
     vmmGObject.__init__(self)
     self.console = console
     self.display = None
Ejemplo n.º 26
0
 def __init__(self, console):
     vmmGObject.__init__(self)
     self.console = console
     self.display = None
     self.need_keygrab = False
Ejemplo n.º 27
0
 def __init__(self, parent=None):
     vmmGObject.__init__(self)
     self._parent = parent
     self._simple = None
Ejemplo n.º 28
0
 def __init__(self, parent=None):
     vmmGObject.__init__(self)
     self._parent = parent
     self._simple = None