qemublocktest: Use "target only" mode in 'testJSONtoJSON' and 'testBackingXMLjsonXML'

Both tests pass a disk source definition which didn't go through the
preparation steps and thus contains only the target information that
were originally present, thus we should be using the
QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY flag.

For the same reason QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY
used in 'testJSONtoJSON' doesn't make sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-10-18 16:18:40 +02:00
parent e60c3057cc
commit b9a5541b49
3 changed files with 5 additions and 8 deletions

View File

@ -59,7 +59,7 @@ testBackingXMLjsonXML(const void *args)
g_autoptr(virStorageSource) xmlsrc = NULL;
g_autoptr(virStorageSource) jsonsrc = NULL;
g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER;
unsigned int backendpropsflags = 0;
unsigned int backendpropsflags = QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY;
if (data->legacy)
backendpropsflags |= QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY;
@ -157,7 +157,7 @@ testJSONtoJSON(const void *args)
}
if (!(jsonsrcout = qemuBlockStorageSourceGetBackendProps(src,
QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_AUTO_READONLY))) {
QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_TARGET_ONLY))) {
fprintf(stderr, "failed to format disk source json\n");
return -1;
}

View File

@ -2,8 +2,7 @@
"driver": "https",
"url": "https://test.host:443/whatever.img",
"sslverify": false,
"cookie": "some_cookie=\"some_value_or_whatever\"",
"timeout": 2000,
"readahead": 65536,
"auto-read-only": true,
"discard": "unmap"
"readahead": 65536
}

View File

@ -8,7 +8,5 @@
"user": "testuser",
"host-key-check": {
"mode": "none"
},
"auto-read-only": true,
"discard": "unmap"
}
}