Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 7868bcf

Browse files
committed
Add NodeDeviceParser module for parsing libvirt host device xml.
1 parent a5c5dc4 commit 7868bcf

15 files changed

Lines changed: 711 additions & 0 deletions

File tree

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@ def diff_compare(actual_out, filename):
7070
import storage
7171
import urltest
7272
import clonetest
73+
import nodedev
7374

tests/nodedev-xml/nodexml/net1.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<device>
2+
<name>net_00_1c_25_10_b1_e4</name>
3+
<parent>pci_8086_1049</parent>
4+
<capability type='net'>
5+
<interface>eth0</interface>
6+
<address>00:1c:25:10:b1:e4</address>
7+
<capability type='80203'/>
8+
</capability>
9+
</device>

tests/nodedev-xml/nodexml/net2.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<device>
2+
<name>net_00_1c_bf_04_29_a4</name>
3+
<parent>pci_8086_4227</parent>
4+
<capability type='net'>
5+
<interface>wlan0</interface>
6+
<address>00:1c:bf:04:29:a4</address>
7+
<capability type='80211'/>
8+
</capability>
9+
</device>

tests/nodedev-xml/nodexml/pci1.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<device>
2+
<name>pci_1180_592</name>
3+
<parent>pci_8086_2448</parent>
4+
<capability type='pci'>
5+
<domain>0</domain>
6+
<bus>21</bus>
7+
<slot>0</slot>
8+
<function>4</function>
9+
<product id='0x0592'>R5C592 Memory Stick Bus Host Adapter</product>
10+
<vendor id='0x1180'>Ricoh Co Ltd</vendor>
11+
</capability>
12+
</device>

tests/nodedev-xml/nodexml/pci2.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<device>
2+
<name>pci_8086_1049</name>
3+
<parent>computer</parent>
4+
<capability type='pci'>
5+
<domain>0</domain>
6+
<bus>0</bus>
7+
<slot>25</slot>
8+
<function>0</function>
9+
<product id='0x1049'>82566MM Gigabit Network Connection</product>
10+
<vendor id='0x8086'>Intel Corporation</vendor>
11+
</capability>
12+
</device>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<device>
2+
<name>usb_device_781_5151_2004453082054CA1BEEE_if0_scsi_host_0</name>
3+
<parent>usb_device_781_5151_2004453082054CA1BEEE_if0</parent>
4+
<capability type='scsi_host'>
5+
<host>5</host>
6+
</capability>
7+
</device>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<device>
2+
<name>usb_device_781_5151_2004453082054CA1BEEE_if0_scsi_host_0_scsi_device_lun0</name>
3+
<parent>usb_device_781_5151_2004453082054CA1BEEE_if0_scsi_host_0</parent>
4+
<capability type='scsi'>
5+
<host>5</host>
6+
<bus>0</bus>
7+
<target>0</target>
8+
<lun>0</lun>
9+
<type>disk</type>
10+
</capability>
11+
</device>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<device>
2+
<name>storage_serial_SATA_WDC_WD1600AAJS__WD_WCAP95119685</name>
3+
<parent>pci_8086_27c0_scsi_host_scsi_device_lun0</parent>
4+
<capability type='storage'>
5+
<block>/dev/sda</block>
6+
<bus>scsi</bus>
7+
<drive_type>disk</drive_type>
8+
<model>WDC WD1600AAJS-2</model>
9+
<vendor>ATA</vendor>
10+
<size>160041885696</size>
11+
</capability>
12+
</device>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<device>
2+
<name>storage_serial_SanDisk_Cruzer_Micro_2004453082054CA1BEEE_0_0</name>
3+
<parent>usb_device_781_5151_2004453082054CA1BEEE_if0_scsi_host_0_scsi_device_lun0</parent>
4+
<capability type='storage'>
5+
<block>/dev/sdb</block>
6+
<bus>usb</bus>
7+
<drive_type>disk</drive_type>
8+
<model>Cruzer Micro</model>
9+
<vendor>SanDisk</vendor>
10+
<capability type='removable'>
11+
<media_available>1</media_available>
12+
<media_size>12345678</media_size>
13+
</capability>
14+
<capability type='hotpluggable' />
15+
</capability>
16+
</device>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<device>
2+
<name>computer</name>
3+
<capability type='system'>
4+
<hardware>
5+
<vendor>LENOVO</vendor>
6+
<version>ThinkPad T61</version>
7+
<serial>L3B2616</serial>
8+
<uuid>97e80381-494f-11cb-8e0e-cbc168f7d753</uuid>
9+
</hardware>
10+
<firmware>
11+
<vendor>LENOVO</vendor>
12+
<version>7LET51WW (1.21 )</version>
13+
<release_date>08/22/2007</release_date>
14+
</firmware>
15+
</capability>
16+
</device>
17+

0 commit comments

Comments
 (0)