def __init__(self, conn=None, parsexml=None, parsexmlnode=None, caps=None):
        """
        Initialize device state

        @param conn: libvirt connection to validate device against
        @type conn: virConnect
        """
        XMLBuilderDomain.__init__(self, conn, parsexml, parsexmlnode,
                                  caps=caps)

        self.alias = VirtualDeviceAlias(conn,
                                        parsexml=parsexml,
                                        parsexmlnode=parsexmlnode,
                                        caps=caps)
        self.address = VirtualDeviceAddress(conn,
                                            parsexml=parsexml,
                                            parsexmlnode=parsexmlnode,
                                            caps=caps)

        if not self._virtual_device_type:
            raise ValueError(_("Virtual device type must be set in subclass."))

        if self._virtual_device_type not in self.virtual_device_types:
            raise ValueError(_("Unknown virtual device type '%s'.") %
                             self._virtual_device_type)
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None,
                 addrstr=None):
        XMLBuilderDomain.__init__(self, conn, parsexml, parsexmlnode,
                                  caps=caps)

        self._type = None

        # PCI address:
        # <address type='pci' domain='0x0000' bus='0x00' slot='0x04' \
        #                     function='0x0'/>
        self._bus = None
        self._domain = None
        self._slot = None
        self._function = None

        self._multifunction = None

        # Drive address:
        # <address type='drive' controller='0' bus='0' target='0' unit='0'/>
        self._controller = None
        self._target = None
        self._unit = None

        # VirtioSerial address:
        # <address type='virtio-serial' controller='1' bus='0' port='4'/>
        self._port = None

        # CCID address:
        # <address type='ccid' controller='0' slot='0'/>

        if addrstr:
            self.parse_friendly_address(addrstr)
    def __init__(self, conn=None, parsexml=None, parsexmlnode=None, caps=None):
        """
        Initialize device state

        @param conn: libvirt connection to validate device against
        @type conn: virConnect
        """
        XMLBuilderDomain.__init__(self,
                                  conn,
                                  parsexml,
                                  parsexmlnode,
                                  caps=caps)

        self.alias = VirtualDeviceAlias(conn,
                                        parsexml=parsexml,
                                        parsexmlnode=parsexmlnode,
                                        caps=caps)
        self.address = VirtualDeviceAddress(conn,
                                            parsexml=parsexml,
                                            parsexmlnode=parsexmlnode,
                                            caps=caps)

        if not self._virtual_device_type:
            raise ValueError(_("Virtual device type must be set in subclass."))

        if self._virtual_device_type not in self.virtual_device_types:
            raise ValueError(
                _("Unknown virtual device type '%s'.") %
                self._virtual_device_type)
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        XMLBuilderDomain.__init__(self,
                                  conn,
                                  parsexml,
                                  parsexmlnode,
                                  caps=caps)

        self._name = None
    def __init__(self,
                 conn,
                 parsexml=None,
                 parsexmlnode=None,
                 caps=None,
                 addrstr=None):
        XMLBuilderDomain.__init__(self,
                                  conn,
                                  parsexml,
                                  parsexmlnode,
                                  caps=caps)

        self._type = None

        # PCI address:
        # <address type='pci' domain='0x0000' bus='0x00' slot='0x04' \
        #                     function='0x0'/>
        self._bus = None
        self._domain = None
        self._slot = None
        self._function = None

        self._multifunction = None

        # Drive address:
        # <address type='drive' controller='0' bus='0' target='0' unit='0'/>
        self._controller = None
        self._target = None
        self._unit = None

        # VirtioSerial address:
        # <address type='virtio-serial' controller='1' bus='0' port='4'/>
        self._port = None

        # CCID address:
        # <address type='ccid' controller='0' slot='0'/>

        if addrstr:
            self.parse_friendly_address(addrstr)
    def __init__(self, conn, parsexml=None, parsexmlnode=None, caps=None):
        XMLBuilderDomain.__init__(self, conn, parsexml, parsexmlnode,
                                  caps=caps)

        self._name = None