render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
fbe740
From f1650a0ed4fc226325e5a9772e6d04a95457f470 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <f1650a0ed4fc226325e5a9772e6d04a95457f470@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Mon, 16 Mar 2020 22:12:06 +0100
fbe740
Subject: [PATCH] qemu: block: Implement readahead and timeout properties for
fbe740
 'curl' driver
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Pass in the correct fields.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
(cherry picked from commit 9cac141cd67d2213074fd146b58812da8fe30603)
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804750
fbe740
Message-Id: <71cba24b72024183752fe9873d0fd5f01caf122b.1584391727.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_block.c                                       | 2 ++
fbe740
 tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args | 6 ++++--
fbe740
 tests/qemuxml2argvdata/disk-network-http.xml                | 2 ++
fbe740
 3 files changed, 8 insertions(+), 2 deletions(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
fbe740
index 80a8c7296d..b077e2e02f 100644
fbe740
--- a/src/qemu/qemu_block.c
fbe740
+++ b/src/qemu/qemu_block.c
fbe740
@@ -722,6 +722,8 @@ qemuBlockStorageSourceGetCURLProps(virStorageSourcePtr src,
fbe740
                                           "S:password-secret", passwordalias,
fbe740
                                           "T:sslverify", src->sslverify,
fbe740
                                           "S:cookie-secret", cookiealias,
fbe740
+                                          "P:timeout", src->timeout,
fbe740
+                                          "P:readahead", src->readahead,
fbe740
                                           NULL));
fbe740
 
fbe740
     return ret;
fbe740
diff --git a/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args b/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
index cbb69e16a9..2f2849ebdf 100644
fbe740
--- a/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
+++ b/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
@@ -28,13 +28,15 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
fbe740
 -boot strict=on \
fbe740
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
fbe740
 -blockdev '{"driver":"http","url":"http://example.org:80/test.img",\
fbe740
-"node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
fbe740
+"timeout":1234,"node-name":"libvirt-4-storage","auto-read-only":true,\
fbe740
+"discard":"unmap"}' \
fbe740
 -blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"raw",\
fbe740
 "file":"libvirt-4-storage"}' \
fbe740
 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x2,drive=libvirt-4-format,\
fbe740
 id=virtio-disk0,bootindex=1 \
fbe740
 -blockdev '{"driver":"https","url":"https://example.org:443/test2.img",\
fbe740
-"node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
fbe740
+"readahead":1024,"node-name":"libvirt-3-storage","auto-read-only":true,\
fbe740
+"discard":"unmap"}' \
fbe740
 -blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw",\
fbe740
 "file":"libvirt-3-storage"}' \
fbe740
 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=libvirt-3-format,\
fbe740
diff --git a/tests/qemuxml2argvdata/disk-network-http.xml b/tests/qemuxml2argvdata/disk-network-http.xml
fbe740
index 6acf75cf65..20024c732e 100644
fbe740
--- a/tests/qemuxml2argvdata/disk-network-http.xml
fbe740
+++ b/tests/qemuxml2argvdata/disk-network-http.xml
fbe740
@@ -17,6 +17,7 @@
fbe740
       <driver name='qemu' type='raw'/>
fbe740
       <source protocol='http' name='test.img'>
fbe740
         <host name='example.org'/>
fbe740
+        <timeout seconds='1234'/>
fbe740
       </source>
fbe740
       <target dev='vda' bus='virtio'/>
fbe740
     </disk>
fbe740
@@ -24,6 +25,7 @@
fbe740
       <driver name='qemu' type='raw'/>
fbe740
       <source protocol='https' name='test2.img'>
fbe740
         <host name='example.org'/>
fbe740
+        <readahead size='1024'/>
fbe740
       </source>
fbe740
       <target dev='vdb' bus='virtio'/>
fbe740
     </disk>
fbe740
-- 
fbe740
2.25.1
fbe740