<hint-dedicated state='on'/>
<poll-control state='on'/>
<pv-ipi state='off'/>
+ <dirty-ring state='on' size='4096'/>
</kvm>
<xen>
<e820_host state='on'/>
``kvm``
Various features to change the behavior of the KVM hypervisor.
- ============== ============================================================================ ======= ============================
- Feature Description Value Since
- ============== ============================================================================ ======= ============================
- hidden Hide the KVM hypervisor from standard MSR based discovery on, off :since:`1.2.8 (QEMU 2.1.0)`
- hint-dedicated Allows a guest to enable optimizations when running on dedicated vCPUs on, off :since:`5.7.0 (QEMU 2.12.0)`
- poll-control Decrease IO completion latency by introducing a grace period of busy waiting on, off :since:`6.10.0 (QEMU 4.2)`
- pv-ipi Paravirtualized send IPIs on, off :since:`7.10.0 (QEMU 3.1)`
- ============== ============================================================================ ======= ============================
+ ============== ============================================================================ ====================================================== ============================
+ Feature Description Value Since
+ ============== ============================================================================ ====================================================== ============================
+ hidden Hide the KVM hypervisor from standard MSR based discovery on, off :since:`1.2.8 (QEMU 2.1.0)`
+ hint-dedicated Allows a guest to enable optimizations when running on dedicated vCPUs on, off :since:`5.7.0 (QEMU 2.12.0)`
+ poll-control Decrease IO completion latency by introducing a grace period of busy waiting on, off :since:`6.10.0 (QEMU 4.2)`
+ pv-ipi Paravirtualized send IPIs on, off :since:`7.10.0 (QEMU 3.1)`
+ dirty-ring Enable dirty ring feature on, off; size - must be power of 2, range [1024,65536] :since:`8.0.0 (QEMU 6.1)`
+ ============== ============================================================================ ====================================================== ============================
``xen``
Various features to change the behavior of the Xen hypervisor.
<ref name="featurestate"/>
</element>
</optional>
+ <optional>
+ <element name="dirty-ring">
+ <ref name="featurestate"/>
+ <optional>
+ <attribute name="size">
+ <data type="unsignedInt"/>
+ </attribute>
+ </optional>
+ </element>
+ </optional>
</interleave>
</element>
</define>
"hint-dedicated",
"poll-control",
"pv-ipi",
+ "dirty-ring",
);
VIR_ENUM_IMPL(virDomainXen,
kvm->features[feature] = value;
+ /* dirty ring feature should parse size property */
+ if (feature == VIR_DOMAIN_KVM_DIRTY_RING &&
+ value == VIR_TRISTATE_SWITCH_ON) {
+
+ if (virXMLPropUInt(node, "size", 0, VIR_XML_PROP_REQUIRED,
+ &kvm->dirty_ring_size) < 0) {
+ return -1;
+ }
+
+ if (!VIR_IS_POW2(kvm->dirty_ring_size) ||
+ kvm->dirty_ring_size < 1024 ||
+ kvm->dirty_ring_size > 65536) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("dirty ring must be power of 2 and ranges [1024, 65536]"));
+
+ return -1;
+ }
+ }
+
node = xmlNextElementSibling(node);
}
case VIR_DOMAIN_KVM_DEDICATED:
case VIR_DOMAIN_KVM_POLLCONTROL:
case VIR_DOMAIN_KVM_PVIPI:
+ case VIR_DOMAIN_KVM_DIRTY_RING:
if (src->kvm_features->features[i] != dst->kvm_features->features[i]) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("State of KVM feature '%s' differs: "
break;
}
}
+
+ if (src->kvm_features->dirty_ring_size != dst->kvm_features->dirty_ring_size) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("dirty ring size of KVM feature '%s' differs: "
+ "source: '%d', destination: '%d'"),
+ virDomainKVMTypeToString(i),
+ src->kvm_features->dirty_ring_size,
+ dst->kvm_features->dirty_ring_size);
+ return false;
+ }
}
/* smm */
def->kvm_features->features[j]));
break;
+ case VIR_DOMAIN_KVM_DIRTY_RING:
+ if (def->kvm_features->features[j] != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(&childBuf, "<%s state='%s'",
+ virDomainKVMTypeToString(j),
+ virTristateSwitchTypeToString(def->kvm_features->features[j]));
+ if (def->kvm_features->dirty_ring_size > 0) {
+ virBufferAsprintf(&childBuf, " size='%d'/>\n",
+ def->kvm_features->dirty_ring_size);
+ } else {
+ virBufferAddLit(&childBuf, "/>\n");
+ }
+ }
+ break;
+
case VIR_DOMAIN_KVM_LAST:
break;
}
VIR_DOMAIN_KVM_DEDICATED,
VIR_DOMAIN_KVM_POLLCONTROL,
VIR_DOMAIN_KVM_PVIPI,
+ VIR_DOMAIN_KVM_DIRTY_RING,
VIR_DOMAIN_KVM_LAST
} virDomainKVM;
typedef struct _virDomainFeatureKVM virDomainFeatureKVM;
struct _virDomainFeatureKVM {
int features[VIR_DOMAIN_KVM_LAST];
+
+ unsigned int dirty_ring_size; /* size of dirty ring for each vCPU, no units */
};
typedef struct _virDomainFeatureTCG virDomainFeatureTCG;
virBufferAddLit(&buf, ",kvm-pv-ipi=off");
break;
+ case VIR_DOMAIN_KVM_DIRTY_RING:
+ break;
+
case VIR_DOMAIN_KVM_LAST:
break;
}
<hint-dedicated state='off'/>
<poll-control state='off'/>
<pv-ipi state='off'/>
+ <dirty-ring state='off'/>
</kvm>
</features>
<cpu mode='host-passthrough' check='none'/>
<hint-dedicated state='on'/>
<poll-control state='on'/>
<pv-ipi state='on'/>
+ <dirty-ring state='on' size='4096'/>
</kvm>
</features>
<cpu mode='host-passthrough' check='none'/>
<hint-dedicated state='off'/>
<poll-control state='off'/>
<pv-ipi state='off'/>
+ <dirty-ring state='off'/>
</kvm>
</features>
<cpu mode='host-passthrough' check='none' migratable='off'/>
<hint-dedicated state='on'/>
<poll-control state='on'/>
<pv-ipi state='on'/>
+ <dirty-ring state='on' size='4096'/>
</kvm>
</features>
<cpu mode='host-passthrough' check='none' migratable='off'/>