On Wed, Sep 13, 2017 at 06:51:35AM -0400, John Ferlan wrote:
On 09/13/2017 05:21 AM, Liu Qing wrote:
> Qcow2 small IO random write performance will drop dramatically if the l2
> cache table could not cover the whole disk. This will be a lot of l2
> cache table RW operations if cache miss happens frequently.
>
> This patch exports the qcow2 driver parameter
> l2-cache-size/refcount-cache-size, first added in Qemu 2.2, and
> cache-clean-interval, first added in Qemu 2.5, in libvirt.
>
> Change since v3: a) copy qcow2 cache configurion from source to backing
> to backing file source.
The difference you list doesn't make any sense. The only difference
between this an V3 is removing the qemu_command.c from patch1. I did a
git diff between the two trees I have from your patches:
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c3b81e138..e95683965 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14318,11 +14318,6 @@
qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver,
if (!(dd->src = virStorageSourceCopy(snap->def->disks[i].src,
false)))
goto error;
- /* keep the qcow2 cache configuration */
- dd->src->l2_cache_size =
vm->def->disks[i]->src->l2_cache_size;
- dd->src->refcount_cache_size =
vm->def->disks[i]->src->refcount_cache_size;
- dd->src->cache_clean_interval =
vm->def->disks[i]->src->cache_clean_interval;
If these three lines are
not added, the qcow2 element(child of driver
element) will be missed after a external disk snapshot. This is due to the
values of the three parameters will be set to 0.
-
if (virStorageSourceInitChainElement(dd->src, dd->disk->src,
false) < 0)
goto error;
I'll stick with the v3 version and adjustments from comments that I made.
John
> Liu Qing (2):
> conf, docs: Add qcow2 cache configuration support
> qemu: add capability checking for qcow2 cache configuration
>
> docs/formatdomain.html.in | 43 ++++++++++
> docs/schemas/domaincommon.rng | 35 ++++++++
> src/conf/domain_conf.c | 95 +++++++++++++++++++++-
> src/qemu/qemu_capabilities.c | 9 ++
> src/qemu/qemu_capabilities.h | 3 +
> src/qemu/qemu_command.c | 33 ++++++++
> src/qemu/qemu_driver.c | 5 ++
> src/util/virstoragefile.c | 3 +
> src/util/virstoragefile.h | 6 ++
> tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 3 +
> .../caps_2.6.0-gicv2.aarch64.xml | 3 +
> .../caps_2.6.0-gicv3.aarch64.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.9.0.ppc64le.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 3 +
> tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 3 +
> .../qemuxml2argv-disk-drive-qcow2-cache.args | 28 +++++++
> .../qemuxml2argv-disk-drive-qcow2-cache.xml | 43 ++++++++++
> tests/qemuxml2argvtest.c | 4 +
> .../qemuxml2xmlout-disk-drive-qcow2-cache.xml | 43 ++++++++++
> tests/qemuxml2xmltest.c | 1 +
> 26 files changed, 386 insertions(+), 1 deletion(-)
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-qcow2-cache.args
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-qcow2-cache.xml
> create mode 100644
tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-qcow2-cache.xml
>