On Sat, Nov 20, 2021 at 03:20:47 -0500, huangy81(a)chinatelecom.cn wrote:
From: Hyman Huang(黄勇) <huangy81(a)chinatelecom.cn>
introduce dirty_ring_size in struct "_virDomainDef" to hold
the ring size configured by user, and pass dirty_ring_size
when building qemu commandline if dirty ring feature enabled.
Signed-off-by: Hyman Huang(黄勇) <huangy81(a)chinatelecom.cn>
---
src/conf/domain_conf.c | 76 ++++++++++++++++++++++++++++++++++++++++-
src/conf/domain_conf.h | 4 +++
src/qemu/qemu_command.c | 3 ++
3 files changed, 82 insertions(+), 1 deletion(-)
[...]
@@ -27884,6 +27949,15 @@ virDomainDefFormatFeatures(virBuffer *buf,
def->kvm_features[j]));
break;
+ case VIR_DOMAIN_KVM_DIRTY_RING:
+ if (def->kvm_features[j] != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&childBuf, "<%s state='%s'
size='%d'/>\n",
+ virDomainKVMTypeToString(j),
+
virTristateSwitchTypeToString(def->kvm_features[j]),
+ def->dirty_ring_size);
+ }
+ break;
+
case VIR_DOMAIN_KVM_LAST:
break;
}
[...]
@@ -2933,6 +2934,9 @@ struct _virDomainDef {
should be re-run before starting */
unsigned int scsiBusMaxUnit;
+
+ /* size of dirty ring for each vcpu */
+ unsigned int dirty_ring_size;
};
One more thing. You are extending the XML in this commit. This means
that the new element also must be documented here and this commit
doesn't have any docs.
Additionally you will likely need addition to the XML schema.
Test XMLs are also required, but they can be added after the
implementation. I'll check whether that is happening.