LsvmBus - Command lsvmbus -vv

This module parses the output of the command lsvmbus -vv.

class insights.parsers.lsvmbus.LsvmBus(context, extra_bad_lines=None)[source]

Bases: insights.core.CommandParser

Parse the output of lsvmbus -vv as list.

Typical output:

VMBUS ID 18: Class_ID = {44c4f61d-4444-4400-9d52-802e27ede19f} - PCI Express pass-through
        Device_ID = {47505500-0001-0000-3130-444531303244}
        Sysfs path: /sys/bus/vmbus/devices/47505500-0001-0000-3130-444531303244
        Rel_ID=18, target_cpu=0
VMBUS ID 26: Class_ID = {44c4f61d-4444-4400-9d52-802e27ede19f} - PCI Express pass-through
        Device_ID = {47505500-0002-0000-3130-444531303244}
        Sysfs path: /sys/bus/vmbus/devices/47505500-0002-0000-3130-444531303244
        Rel_ID=26, target_cpu=0
VMBUS ID 73: Class_ID = {44c4f61d-4444-4400-9d52-802e27ede19f} - PCI Express pass-through
        Device_ID = {47505500-0003-0001-3130-444531303244}
        Sysfs path: /sys/bus/vmbus/devices/47505500-0003-0001-3130-444531303244
        Rel_ID=73, target_cpu=0
VMBUS ID 74: Class_ID = {44c4f61d-4444-4400-9d52-802e27ede19f} - PCI Express pass-through
        Device_ID = {47505500-0004-0001-3130-444531303244}
        Sysfs path: /sys/bus/vmbus/devices/47505500-0004-0001-3130-444531303244
        Rel_ID=74, target_cpu=0

Examples

>>> assert len(lsvmbus.devices) == 4
>>> assert lsvmbus.devices[0].get('vmbus_id', None) == '18'
>>> assert lsvmbus.devices[0].get('device_id', None) == '47505500-0001-0000-3130-444531303244'
>>> assert lsvmbus.devices[0].get('rel_id', None) == '18'
>>> assert lsvmbus.devices[0].get('sysfs_path', None) == '/sys/bus/vmbus/devices/47505500-0001-0000-3130-444531303244'
>>> assert lsvmbus.devices[0].get('target_cpu', None) == '0'
devices

List of dict for each device. For example:

[
 {
  'vmbus_id': '18',
  'class_id': '44c4f61d-4444-4400-9d52-802e27ede19f',
  'type': 'PCI Express pass-through',
  'device_id': '47505500-0001-0000-3130-444531303244',
  'sysfs_path': '/sys/bus/vmbus/devices/47505500-0001-0000-3130-444531303244',
  'rel_id': '18',
  'target_cpu': '0'
 },
 {...}
]
Type

list

parse_content(content)[source]

This method must be implemented by classes based on this class.