mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 00:01:55 +00:00
qemuBlockStorageSourceGetURI: Pass through query component
If the storage source has the query part set, format it in the output. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
5636812472
commit
216860dd8b
@ -437,6 +437,8 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uri->query = g_strdup(src->query);
|
||||||
|
|
||||||
uri->server = g_strdup(src->hosts->name);
|
uri->server = g_strdup(src->hosts->name);
|
||||||
|
|
||||||
return g_steal_pointer(&uri);
|
return g_steal_pointer(&uri);
|
||||||
|
@ -7132,6 +7132,15 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (src->query &&
|
||||||
|
(actualType != VIR_STORAGE_TYPE_NETWORK ||
|
||||||
|
(src->protocol != VIR_STORAGE_NET_PROTOCOL_HTTPS &&
|
||||||
|
src->protocol != VIR_STORAGE_NET_PROTOCOL_HTTP))) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("query is supported only with HTTP(S) protocols"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ id=drive-ide0-0-0,readonly=on \
|
|||||||
-drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\
|
-drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\
|
||||||
id=drive-ide0-0-1,readonly=on \
|
id=drive-ide0-0-1,readonly=on \
|
||||||
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
|
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
|
||||||
-drive file=https://host.name:443/url/path/file.iso,format=raw,if=none,\
|
-drive 'file=https://host.name:443/url/path/file.iso?test=val,format=raw,\
|
||||||
id=drive-ide0-1-0,readonly=on \
|
if=none,id=drive-ide0-1-0,readonly=on' \
|
||||||
-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
|
-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
|
||||||
-drive file=tftp://host.name:69/url/path/file.iso,format=raw,if=none,\
|
-drive file=tftp://host.name:69/url/path/file.iso,format=raw,if=none,\
|
||||||
id=drive-ide0-1-1,readonly=on \
|
id=drive-ide0-1-1,readonly=on \
|
||||||
|
@ -32,8 +32,8 @@ id=drive-ide0-0-0,readonly=on \
|
|||||||
-drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\
|
-drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\
|
||||||
id=drive-ide0-0-1,readonly=on \
|
id=drive-ide0-0-1,readonly=on \
|
||||||
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
|
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
|
||||||
-drive file=https://host.name:443/url/path/file.iso,format=raw,if=none,\
|
-drive 'file=https://host.name:443/url/path/file.iso?test=val,format=raw,\
|
||||||
id=drive-ide0-1-0,readonly=on \
|
if=none,id=drive-ide0-1-0,readonly=on' \
|
||||||
-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
|
-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
|
||||||
-drive file=tftp://host.name:69/url/path/file.iso,format=raw,if=none,\
|
-drive file=tftp://host.name:69/url/path/file.iso,format=raw,if=none,\
|
||||||
id=drive-ide0-1-1,readonly=on \
|
id=drive-ide0-1-1,readonly=on \
|
||||||
|
@ -37,7 +37,8 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
|||||||
-blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"raw",\
|
-blockdev '{"node-name":"libvirt-3-format","read-only":true,"driver":"raw",\
|
||||||
"file":"libvirt-3-storage"}' \
|
"file":"libvirt-3-storage"}' \
|
||||||
-device ide-cd,bus=ide.0,unit=1,drive=libvirt-3-format,id=ide0-0-1 \
|
-device ide-cd,bus=ide.0,unit=1,drive=libvirt-3-format,id=ide0-0-1 \
|
||||||
-blockdev '{"driver":"https","url":"https://host.name:443/url/path/file.iso",\
|
-blockdev '{"driver":"https",\
|
||||||
|
"url":"https://host.name:443/url/path/file.iso?test=val",\
|
||||||
"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
|
"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||||
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw",\
|
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw",\
|
||||||
"file":"libvirt-2-storage"}' \
|
"file":"libvirt-2-storage"}' \
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
</disk>
|
</disk>
|
||||||
<disk type='network' device='cdrom'>
|
<disk type='network' device='cdrom'>
|
||||||
<driver name='qemu' type='raw'/>
|
<driver name='qemu' type='raw'/>
|
||||||
<source protocol='https' name='/url/path/file.iso'>
|
<source protocol='https' name='/url/path/file.iso' query='test=val'>
|
||||||
<host name='host.name' port='443'/>
|
<host name='host.name' port='443'/>
|
||||||
</source>
|
</source>
|
||||||
<target dev='hdc' bus='ide'/>
|
<target dev='hdc' bus='ide'/>
|
||||||
|
@ -55,8 +55,9 @@ id=virtio-disk2 \
|
|||||||
-object secret,id=libvirt-1-storage-httpcookie-secret0,\
|
-object secret,id=libvirt-1-storage-httpcookie-secret0,\
|
||||||
data=DrPR9NA6GKJb7qi1KbjHaealKEMVtOWUl2h3yvO5lgIh6cyLHemmlg+h9fcgwREA,\
|
data=DrPR9NA6GKJb7qi1KbjHaealKEMVtOWUl2h3yvO5lgIh6cyLHemmlg+h9fcgwREA,\
|
||||||
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
|
keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
|
||||||
-blockdev '{"driver":"https","url":"https://example.org:1234/test4.img",\
|
-blockdev '{"driver":"https",\
|
||||||
"sslverify":false,"cookie-secret":"libvirt-1-storage-httpcookie-secret0",\
|
"url":"https://example.org:1234/test4.img?par=val&other=ble","sslverify":false,\
|
||||||
|
"cookie-secret":"libvirt-1-storage-httpcookie-secret0",\
|
||||||
"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
|
"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||||
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw",\
|
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw",\
|
||||||
"file":"libvirt-1-storage"}' \
|
"file":"libvirt-1-storage"}' \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user