- docs: Document CPU clusters - docs: Improve documentation for CPU topology - tests: Verify handling of CPU clusters in QMP data - qemu: Make monitor aware of CPU clusters - qemu: Use CPU clusters for guests - qemu: Introduce QEMU_CAPS_SMP_CLUSTERS - conf: Allow specifying CPU clusters - conf: Report CPU clusters in capabilities XML - tests: Add hostcpudata for machine with CPU clusters - cpu_map: add kunpeng-920 features to arm features - cpu/aarch64: enable host-model cpu for AArch64 architecture - conf/domain_conf: pin the retry_interval and retry_timeout parameters to xml - nodedev: fix potential heap use after free - libvirt/conf: Set default values of retry fileds - qemu: Support 'retry' BLOCK_IO_ERROR event. - libvirt: Add 'retry' support for error policy - vdpa: support vdpa device migrate - vdpa: support vdpa device hot plug/unplug - hostdev:Introduce vDPA device to hostdev subsystem as a new subtype - node_device: fix leak of DIR* - migration/multifd-pin: support migration multifd thread pin - migration/multifd-pin: add qemu monitor callback functions - migration/migration-pin: add domainMigrationPid for qemuMonitorCallbacks - migration/migration-pin: add migrationpin for migration parameters - migration/migration-pin: add qemu monitor callback functions - migration/migration-pin:add some migration/multiFd params - qemu: add pointer check in qemuMonitorLastError - qemu: fix a concurrent operation situation - test/commandtest: skip the test4 if the testcase is run in the container env Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
87 lines
3.2 KiB
Diff
87 lines
3.2 KiB
Diff
From 2b79389fe60dc8fc0bf8788a346a35d63ae6883d Mon Sep 17 00:00:00 2001
|
|
From: Jiahui Cen <cenjiahui@huawei.com>
|
|
Date: Thu, 18 Mar 2021 15:14:20 +0800
|
|
Subject: [PATCH] libvirt/conf: Set default values of retry fileds
|
|
|
|
Currently the default values of retry_interval and retry_timeout are set
|
|
to -1, when 'driver' option exists without retry fileds. It conflicts
|
|
with the default values when the 'driver' option does not exist.
|
|
|
|
So let's set default values of retry_interval and retry_timeout to 0 when
|
|
retry policy is not enabled.
|
|
|
|
Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
|
|
---
|
|
src/conf/domain_conf.c | 18 ++++++++++++------
|
|
src/conf/domain_conf.h | 2 ++
|
|
2 files changed, 14 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
index f31f06b428..0aa514bda3 100644
|
|
--- a/src/conf/domain_conf.c
|
|
+++ b/src/conf/domain_conf.c
|
|
@@ -7775,6 +7775,7 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def,
|
|
xmlNodePtr cur)
|
|
{
|
|
g_autofree char *tmp = NULL;
|
|
+ bool retry_enabled = false;
|
|
|
|
def->driverName = virXMLPropString(cur, "name");
|
|
|
|
@@ -7799,28 +7800,33 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def,
|
|
return -1;
|
|
}
|
|
|
|
- def->retry_interval = -1;
|
|
+ retry_enabled = (def->error_policy == VIR_DOMAIN_DISK_ERROR_POLICY_RETRY) ||
|
|
+ (def->rerror_policy == VIR_DOMAIN_DISK_ERROR_POLICY_RETRY);
|
|
+
|
|
if ((tmp = virXMLPropString(cur, "retry_interval")) &&
|
|
- ((def->error_policy != VIR_DOMAIN_DISK_ERROR_POLICY_RETRY &&
|
|
- def->rerror_policy != VIR_DOMAIN_DISK_ERROR_POLICY_RETRY) ||
|
|
+ (!retry_enabled ||
|
|
(virStrToLong_ll(tmp, NULL, 10, &def->retry_interval) < 0) ||
|
|
(def->retry_interval < 0))) {
|
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
_("unknown disk retry interval '%s'"), tmp);
|
|
return -1;
|
|
}
|
|
+ if (retry_enabled && !tmp) {
|
|
+ def->retry_interval = VIR_DOMAIN_DISK_DEFAULT_RETRY_INTERVAL;
|
|
+ }
|
|
VIR_FREE(tmp);
|
|
|
|
- def->retry_timeout = -1;
|
|
if ((tmp = virXMLPropString(cur, "retry_timeout")) &&
|
|
- ((def->error_policy != VIR_DOMAIN_DISK_ERROR_POLICY_RETRY &&
|
|
- def->rerror_policy != VIR_DOMAIN_DISK_ERROR_POLICY_RETRY) ||
|
|
+ (!retry_enabled ||
|
|
(virStrToLong_ll(tmp, NULL, 10, &def->retry_timeout) < 0) ||
|
|
(def->retry_timeout < 0))) {
|
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
_("unknown disk retry interval '%s'"), tmp);
|
|
return -1;
|
|
}
|
|
+ if (retry_enabled && !tmp) {
|
|
+ def->retry_timeout = VIR_DOMAIN_DISK_DEFAULT_RETRY_TIMEOUT;
|
|
+ }
|
|
|
|
if (virXMLPropEnum(cur, "io", virDomainDiskIoTypeFromString,
|
|
VIR_XML_PROP_NONZERO, &def->iomode) < 0)
|
|
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
|
index 021623cce7..c810721d5b 100644
|
|
--- a/src/conf/domain_conf.h
|
|
+++ b/src/conf/domain_conf.h
|
|
@@ -515,6 +515,8 @@ typedef enum {
|
|
|
|
VIR_ENUM_DECL(virDomainSnapshotLocation);
|
|
|
|
+#define VIR_DOMAIN_DISK_DEFAULT_RETRY_INTERVAL 1000
|
|
+#define VIR_DOMAIN_DISK_DEFAULT_RETRY_TIMEOUT 0
|
|
|
|
/* Stores the virtual disk configuration */
|
|
struct _virDomainDiskDef {
|
|
--
|
|
2.27.0
|
|
|