'Returns all devices for a guest
:param devtype: a LibvirtConfigGuestDevice subclass class
:returns: a list of LibvirtConfigGuestDevice instances'

def get_all_devices(self, devtype=None):

    try:
        config = vconfig.LibvirtConfigGuest()
        config.parse_str(self._domain.XMLDesc(0))
    except Exception:
        return []
    devs = []
    for dev in config.devices:
        if ((devtype is None) or isinstance(dev, devtype)):
            devs.append(dev)
    return devs
