Add support for URL query with disks

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2022-03-22 10:41:09 +01:00 committed by Cole Robinson
parent 9ac94ef739
commit a62e3df72f
2 changed files with 4 additions and 1 deletions

View File

@ -346,7 +346,7 @@
</disk> </disk>
<disk type="network" device="disk"> <disk type="network" device="disk">
<driver name="qemu"/> <driver name="qemu"/>
<source protocol="http" name="my/path"> <source protocol="http" name="my/path" query="query=foo">
<host name="1:2:3:4:1:2:3:4" port="5522"/> <host name="1:2:3:4:1:2:3:4" port="5522"/>
</source> </source>
<target dev="vdl" bus="virtio"/> <target dev="vdl" bus="virtio"/>

View File

@ -66,6 +66,7 @@ class _DiskSource(XMLBuilder):
name = XMLProperty("./@name") name = XMLProperty("./@name")
protocol = XMLProperty("./@protocol") protocol = XMLProperty("./@protocol")
query = XMLProperty("./@query")
type = XMLProperty("./@type") type = XMLProperty("./@type")
managed = XMLProperty("./@managed", is_yesno=True) managed = XMLProperty("./@managed", is_yesno=True)
@ -98,6 +99,8 @@ class _DiskSource(XMLBuilder):
self.name = uriobj.path self.name = uriobj.path
if self.name.startswith("/"): if self.name.startswith("/"):
self.name = self.name[1:] self.name = self.name[1:]
if uriobj.query:
self.query = uriobj.query
def build_url_from_network(self): def build_url_from_network(self):
""" """