qemublocktest: xml->json: Add test for NVMe

Based on the configuration from the only qemuxml2argv test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2020-03-18 18:49:10 +01:00
parent 5793b8baa7
commit 2337dbfdd1
4 changed files with 34 additions and 0 deletions

View File

@ -1203,6 +1203,8 @@ mymain(void)
TEST_DISK_TO_JSON("block-raw-noopts");
TEST_DISK_TO_JSON("block-raw-reservations");
TEST_DISK_TO_JSON("nvme-raw-noopts");
#define TEST_JSON_TO_JSON(nme) \
do { \
jsontojsondata.name = nme; \

View File

@ -0,0 +1,5 @@
{
"driver": "nvme",
"device": "0000:01:00.0",
"namespace": 1
}

View File

@ -0,0 +1,14 @@
{
"node-name": "0123456789ABCDEF0123456789ABCDE",
"read-only": false,
"driver": "raw",
"file": "0123456789ABCDEF0123456789ABCDE"
}
{
"driver": "nvme",
"device": "0000:01:00.0",
"namespace": 1,
"node-name": "0123456789ABCDEF0123456789ABCDE",
"auto-read-only": true,
"discard": "unmap"
}

View File

@ -0,0 +1,13 @@
<disk type='nvme' device='disk'>
<driver name='qemu' type='raw'/>
<source type='pci' managed='yes' namespace='1'>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
<privateData>
<nodenames>
<nodename type='storage' name='0123456789ABCDEF0123456789ABCDE'/>
<nodename type='format' name='0123456789ABCDEF0123456789ABCDE'/>
</nodenames>
</privateData>
</source>
<target dev='vda' bus='virtio'/>
</disk>