11a887ec-cli-disk-Add-driver.metadata_cache-options.patch 7295ebfb-tests-cli-Fix-test-output-after-previous-commit.patch 58f5e36d-fsdetails-Fix-an-error-with-source.socket-of-virtiofs.patch c22a876e-tests-Add-a-compat-check-for-linux2020-in-amd-sev-test-case.patch fbdf0516-cli-cpu-Add-maxphysaddr.mode-bits-options.patch b0d05167-cloner-Sync-uuid-and-sysinfo-system-uuid.patch 999ccb85-virt-install-unattended-and-cloud-init-conflict.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=579
96 lines
3.9 KiB
Diff
96 lines
3.9 KiB
Diff
Subject: cli: --disk: Add driver.metadata_cache options
|
|
From: Lin Ma lma@suse.com Tue Aug 16 12:59:57 2022 +0800
|
|
Date: Wed Aug 17 09:57:29 2022 -0400:
|
|
Git: 11a887ece5b5bab287ff77b09337dc44c4e6e976
|
|
|
|
Properly setting the metadata cache size can provide better performance
|
|
in case of using big qcow2 images.
|
|
|
|
This patch introduces two driver options:
|
|
* driver.metadata_cache.max_size
|
|
* driver.metadata_cache.max_size.unit
|
|
|
|
E.g. --disk ...,driver.type=qcow2,\
|
|
driver.metadata_cache.max_size=2,\
|
|
driver.metadata_cache.max_size.unit=MiB
|
|
|
|
BTW, Metadata cache size control is currently supported only for qcow2.
|
|
Regarding how to properly caluclate the cache size of qcow2, Please refer
|
|
to qemu's documentation.
|
|
|
|
Signed-off-by: Lin Ma <lma@suse.com>
|
|
|
|
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
|
|
index a73343a9..a33dc16a 100644
|
|
--- a/tests/data/cli/compare/virt-install-many-devices.xml
|
|
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
|
|
@@ -423,6 +423,15 @@
|
|
</source>
|
|
<target dev="vdu" bus="virtio"/>
|
|
</disk>
|
|
+ <disk type="file" device="disk">
|
|
+ <driver name="qemu" type="qcow2">
|
|
+ <metadata_cache>
|
|
+ <max_size unit="KiB">2048</max_size>
|
|
+ </metadata_cache>
|
|
+ </driver>
|
|
+ <source file="/tmp/disk1.qcow2"/>
|
|
+ <target dev="vdv" bus="virtio"/>
|
|
+ </disk>
|
|
<controller type="usb" index="0" model="ich9-ehci1">
|
|
<address type="pci" domain="0" bus="0" slot="4" function="7"/>
|
|
</controller>
|
|
diff --git a/tests/test_cli.py b/tests/test_cli.py
|
|
index 774db098..259ac78c 100644
|
|
--- a/tests/test_cli.py
|
|
+++ b/tests/test_cli.py
|
|
@@ -605,6 +605,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
|
|
--disk path=/fooroot.img,size=.0001,transient=on
|
|
--disk source.dir=/
|
|
--disk type=nvme,source.type=pci,source.managed=no,source.namespace=2,source.address.domain=0x0001,source.address.bus=0x02,source.address.slot=0x00,source.address.function=0x0
|
|
+--disk /tmp/disk1.qcow2,size=16,driver.type=qcow2,driver.metadata_cache.max_size=2048,driver.metadata_cache.max_size.unit=KiB
|
|
|
|
|
|
--network user,mac=12:34:56:78:11:22,portgroup=foo,link_state=down,rom_bar=on,rom_file=/tmp/foo
|
|
diff --git a/virtinst/cli.py b/virtinst/cli.py
|
|
index c4dffd34..042b500f 100644
|
|
--- a/virtinst/cli.py
|
|
+++ b/virtinst/cli.py
|
|
@@ -3497,6 +3497,8 @@ class ParserDisk(VirtCLIParser):
|
|
"driver.io": "io",
|
|
"driver.name": "driver_name",
|
|
"driver.type": "driver_type",
|
|
+ "driver.metadata_cache.max_size": "metadata_cache.max_size",
|
|
+ "driver.metadata_cache.max_size.unit": "metadata_cache.max_size.unit",
|
|
}
|
|
|
|
def _add_advertised_aliases(self):
|
|
@@ -3696,6 +3698,11 @@ class ParserDisk(VirtCLIParser):
|
|
cls.add_arg("driver.queues", "driver_queues")
|
|
cls.add_arg("driver.error_policy", "error_policy")
|
|
|
|
+ cls.add_arg("driver.metadata_cache.max_size",
|
|
+ "driver_metadata_cache_max_size")
|
|
+ cls.add_arg("driver.metadata_cache.max_size.unit",
|
|
+ "driver_metadata_cache_max_size_unit")
|
|
+
|
|
cls.add_arg("iotune.read_bytes_sec", "iotune_rbs")
|
|
cls.add_arg("iotune.write_bytes_sec", "iotune_wbs")
|
|
cls.add_arg("iotune.total_bytes_sec", "iotune_tbs")
|
|
diff --git a/virtinst/devices/disk.py b/virtinst/devices/disk.py
|
|
index dc59fd13..9609ebac 100644
|
|
--- a/virtinst/devices/disk.py
|
|
+++ b/virtinst/devices/disk.py
|
|
@@ -481,6 +481,11 @@ class DeviceDisk(Device):
|
|
driver_iothread = XMLProperty("./driver/@iothread", is_int=True)
|
|
driver_queues = XMLProperty("./driver/@queues", is_int=True)
|
|
|
|
+ driver_metadata_cache_max_size = XMLProperty(
|
|
+ "./driver/metadata_cache/max_size", is_int=True)
|
|
+ driver_metadata_cache_max_size_unit = XMLProperty(
|
|
+ "./driver/metadata_cache/max_size/@unit")
|
|
+
|
|
error_policy = XMLProperty("./driver/@error_policy")
|
|
serial = XMLProperty("./serial")
|
|
wwn = XMLProperty("./wwn")
|