virJSONValuePtr ret = NULL;
g_autoptr(virURI) uri = NULL;
g_autofree char *uristr = NULL;
+ g_autofree char *cookiestr = NULL;
/**
* Common options:
if (srcPriv &&
srcPriv->httpcookie)
cookiealias = srcPriv->httpcookie->s.aes.alias;
+ } else {
+ /* format target string along with cookies */
+ cookiestr = qemuBlockStorageSourceGetCookieString(src);
}
ignore_value(virJSONValueObjectCreate(&ret,
"S:username", username,
"S:password-secret", passwordalias,
"T:sslverify", src->sslverify,
+ "S:cookie", cookiestr,
"S:cookie-secret", cookiealias,
"P:timeout", src->timeout,
"P:readahead", src->readahead,
/* generate simplified URIs for the easy cases */
if (actualType == VIR_STORAGE_TYPE_NETWORK &&
src->nhosts == 1 &&
- src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP) {
+ src->hosts->transport == VIR_STORAGE_NET_HOST_TRANS_TCP &&
+ src->timeout == 0 &&
+ src->ncookies == 0 &&
+ src->sslverify == VIR_TRISTATE_BOOL_ABSENT &&
+ src->timeout == 0 &&
+ src->readahead == 0) {
switch ((virStorageNetProtocol) src->protocol) {
case VIR_STORAGE_NET_PROTOCOL_NBD:
TEST_DISK_TO_JSON("network-qcow2-backing-chain-cache-unsafe");
TEST_DISK_TO_JSON("dir-fat-cache");
TEST_DISK_TO_JSON("network-nbd-tls");
+ TEST_DISK_TO_JSON("network-http-noopts");
+ TEST_DISK_TO_JSON("network-http-curlopts");
TEST_DISK_TO_JSON("block-raw-noopts");
TEST_DISK_TO_JSON("block-raw-reservations");
--- /dev/null
+(
+ source only properties:
+ {
+ "driver": "https",
+ "url": "https://host1.example.com:443/something",
+ "sslverify": false,
+ "cookie": "test=123456; blurb=here"
+ }
+ backing store string:
+ json:{"file":{
+ "driver": "https",
+ "url": "https://host1.example.com:443/something",
+ "sslverify": false,
+ "cookie": "test=123456; blurb=here"
+ }
+ }
+)
--- /dev/null
+{
+ "node-name": "node-b-f",
+ "read-only": false,
+ "driver": "qcow2",
+ "file": "node-a-s",
+ "backing": null
+}
+{
+ "driver": "https",
+ "url": "https://host1.example.com:443/something",
+ "sslverify": false,
+ "node-name": "node-a-s",
+ "auto-read-only": true,
+ "discard": "unmap"
+}
--- /dev/null
+<disk type='network' device='disk'>
+ <driver name='qemu' type='qcow2'/>
+ <source protocol='https' name='/something'>
+ <host name='host1.example.com'/>
+ <ssl verify='no'/>
+ <cookies>
+ <cookie name='test'>123456</cookie>
+ <cookie name='blurb'>here</cookie>
+ </cookies>
+ <privateData>
+ <nodenames>
+ <nodename type='storage' name='node-a-s'/>
+ <nodename type='format' name='node-b-f'/>
+ </nodenames>
+ </privateData>
+ </source>
+ <backingStore/>
+ <target dev='vda' bus='virtio'/>
+ <alias name='virtio-disk0'/>
+</disk>
--- /dev/null
+(
+ source only properties:
+ {
+ "driver": "https",
+ "url": "https://host1.example.com:443/something"
+ }
+ backing store string:
+ https://host1.example.com:443/something
+)
--- /dev/null
+{
+ "node-name": "node-b-f",
+ "read-only": false,
+ "driver": "qcow2",
+ "file": "node-a-s",
+ "backing": null
+}
+{
+ "driver": "https",
+ "url": "https://host1.example.com:443/something",
+ "node-name": "node-a-s",
+ "auto-read-only": true,
+ "discard": "unmap"
+}
--- /dev/null
+<disk type='network' device='disk'>
+ <driver name='qemu' type='qcow2'/>
+ <source protocol='https' name='/something'>
+ <host name='host1.example.com'/>
+ <privateData>
+ <nodenames>
+ <nodename type='storage' name='node-a-s'/>
+ <nodename type='format' name='node-b-f'/>
+ </nodenames>
+ </privateData>
+ </source>
+ <backingStore/>
+ <target dev='vda' bus='virtio'/>
+ <alias name='virtio-disk0'/>
+</disk>