[PATCH] Add a changelog entry for the esx NIC limit changes
by Bastien Orivel
This was forgotten in 4bd375b6ce3a4c134bab19cd7c9a7a83609547c8
---
NEWS.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index cc35cb26b2..ce5d227068 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -20,6 +20,11 @@ v6.6.0 (unreleased)
* **Improvements**
+ * esx: Change the NIC limit for recent virtualHW versions
+
+ Specifying a virtualHW version greater or equal to 7 (ESXi 4.0) will allow
+ you to use up to 10 NICs instead of 4 as it was previously.
+
* **Bug fixes**
--
2.20.1
4 years, 4 months
[GSoC][PATCH v2] qemu_domainjob: removal of its dependency on other qemu-files
by Prathamesh Chavan
It was seen that `qemu_domain.h` file depended upon
`qemu_migration_params.h` and `qmeu_monitor.h` as they
were required by some qemu_domainjob stuctures.
This dependency was removed by the introduction of
a `void *privateData` pointer. This privateData pointer
was handled using a structure of callback functions.
Additionally, the patch also moves funcitons
`qemuDomainObjPrivateXMLFormatJob` and
`qemuDomainObjPrivateXMLParseJob` from `qemu_domain`
and handles them using the callback structure of
domain jobs.
Signed-off-by: Prathamesh Chavan <pc44800(a)gmail.com>
---
Previous version of this patch can be found here[1].
This patch adds a funciton to the domainJobInfo callback
structure to specifically to copy the jobInfo privateData
structure.
Also, it was noticed that qemuDomainNamespace was reciding
in `qmeu_domainjob.c`, and should rather be in its original file
`qmeu_domain.c`. hence was moved.
src/qemu/qemu_backup.c | 13 +-
src/qemu/qemu_domain.c | 251 +-------------------
src/qemu/qemu_domainjob.c | 386 ++++++++++++++++++++++++++++---
src/qemu/qemu_domainjob.h | 69 ++++--
src/qemu/qemu_driver.c | 21 +-
src/qemu/qemu_migration.c | 45 ++--
src/qemu/qemu_migration_cookie.c | 7 +-
src/qemu/qemu_migration_params.c | 9 +-
src/qemu/qemu_migration_params.h | 28 +++
src/qemu/qemu_process.c | 24 +-
10 files changed, 515 insertions(+), 338 deletions(-)
diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index b711f8f623..82dc7797cb 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -529,17 +529,19 @@ qemuBackupJobTerminate(virDomainObjPtr vm,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobInfoPrivatePtr completedJobInfo;
size_t i;
qemuDomainJobInfoUpdateTime(priv->job.current);
g_clear_pointer(&priv->job.completed, qemuDomainJobInfoFree);
priv->job.completed = qemuDomainJobInfoCopy(priv->job.current);
+ completedJobInfo = priv->job.completed->privateData;
- priv->job.completed->stats.backup.total = priv->backup->push_total;
- priv->job.completed->stats.backup.transferred = priv->backup->push_transferred;
- priv->job.completed->stats.backup.tmp_used = priv->backup->pull_tmp_used;
- priv->job.completed->stats.backup.tmp_total = priv->backup->pull_tmp_total;
+ completedJobInfo->stats.backup.total = priv->backup->push_total;
+ completedJobInfo->stats.backup.transferred = priv->backup->push_transferred;
+ completedJobInfo->stats.backup.tmp_used = priv->backup->pull_tmp_used;
+ completedJobInfo->stats.backup.tmp_total = priv->backup->pull_tmp_total;
priv->job.completed->status = jobstatus;
priv->job.completed->errmsg = g_strdup(priv->backup->errmsg);
@@ -1069,7 +1071,8 @@ qemuBackupGetJobInfoStats(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuDomainJobInfoPtr jobInfo)
{
- qemuDomainBackupStats *stats = &jobInfo->stats.backup;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
+ qemuDomainBackupStats *stats = &jobInfoPriv->stats.backup;
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuMonitorJobInfoPtr *blockjobs = NULL;
size_t nblockjobs = 0;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 42cc78ac1b..c77e809045 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -83,6 +83,11 @@
VIR_LOG_INIT("qemu.qemu_domain");
+VIR_ENUM_IMPL(qemuDomainNamespace,
+ QEMU_DOMAIN_NS_LAST,
+ "mount",
+);
+
/**
* qemuDomainObjFromDomain:
* @domain: Domain pointer that has to be looked up
@@ -2162,103 +2167,6 @@ qemuDomainObjPrivateXMLFormatPR(virBufferPtr buf,
virBufferAddLit(buf, "<prDaemon/>\n");
}
-
-static int
-qemuDomainObjPrivateXMLFormatNBDMigrationSource(virBufferPtr buf,
- virStorageSourcePtr src,
- virDomainXMLOptionPtr xmlopt)
-{
- g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
- g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
-
- virBufferAsprintf(&attrBuf, " type='%s' format='%s'",
- virStorageTypeToString(src->type),
- virStorageFileFormatTypeToString(src->format));
-
- if (virDomainDiskSourceFormat(&childBuf, src, "source", 0, false,
- VIR_DOMAIN_DEF_FORMAT_STATUS,
- false, false, xmlopt) < 0)
- return -1;
-
- virXMLFormatElement(buf, "migrationSource", &attrBuf, &childBuf);
-
- return 0;
-}
-
-
-static int
-qemuDomainObjPrivateXMLFormatNBDMigration(virBufferPtr buf,
- virDomainObjPtr vm)
-{
- qemuDomainObjPrivatePtr priv = vm->privateData;
- size_t i;
- virDomainDiskDefPtr disk;
- qemuDomainDiskPrivatePtr diskPriv;
-
- for (i = 0; i < vm->def->ndisks; i++) {
- g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
- g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
- disk = vm->def->disks[i];
- diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
-
- virBufferAsprintf(&attrBuf, " dev='%s' migrating='%s'",
- disk->dst, diskPriv->migrating ? "yes" : "no");
-
- if (diskPriv->migrSource &&
- qemuDomainObjPrivateXMLFormatNBDMigrationSource(&childBuf,
- diskPriv->migrSource,
- priv->driver->xmlopt) < 0)
- return -1;
-
- virXMLFormatElement(buf, "disk", &attrBuf, &childBuf);
- }
-
- return 0;
-}
-
-
-static int
-qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
- virDomainObjPtr vm,
- qemuDomainObjPrivatePtr priv)
-{
- g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
- g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
- qemuDomainJob job = priv->job.active;
-
- if (!qemuDomainTrackJob(job))
- job = QEMU_JOB_NONE;
-
- if (job == QEMU_JOB_NONE &&
- priv->job.asyncJob == QEMU_ASYNC_JOB_NONE)
- return 0;
-
- virBufferAsprintf(&attrBuf, " type='%s' async='%s'",
- qemuDomainJobTypeToString(job),
- qemuDomainAsyncJobTypeToString(priv->job.asyncJob));
-
- if (priv->job.phase) {
- virBufferAsprintf(&attrBuf, " phase='%s'",
- qemuDomainAsyncJobPhaseToString(priv->job.asyncJob,
- priv->job.phase));
- }
-
- if (priv->job.asyncJob != QEMU_ASYNC_JOB_NONE)
- virBufferAsprintf(&attrBuf, " flags='0x%lx'", priv->job.apiFlags);
-
- if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT &&
- qemuDomainObjPrivateXMLFormatNBDMigration(&childBuf, vm) < 0)
- return -1;
-
- if (priv->job.migParams)
- qemuMigrationParamsFormat(&childBuf, priv->job.migParams);
-
- virXMLFormatElement(buf, "job", &attrBuf, &childBuf);
-
- return 0;
-}
-
-
static bool
qemuDomainHasSlirp(virDomainObjPtr vm)
{
@@ -2394,7 +2302,7 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf,
if (priv->lockState)
virBufferAsprintf(buf, "<lockstate>%s</lockstate>\n", priv->lockState);
- if (qemuDomainObjPrivateXMLFormatJob(buf, vm, priv) < 0)
+ if (priv->job.cb.formatJob(buf, vm, &priv->job) < 0)
return -1;
if (priv->fakeReboot)
@@ -2894,151 +2802,6 @@ qemuDomainObjPrivateXMLParsePR(xmlXPathContextPtr ctxt,
}
-static int
-qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
- xmlXPathContextPtr ctxt,
- virDomainDiskDefPtr disk,
- virDomainXMLOptionPtr xmlopt)
-{
- VIR_XPATH_NODE_AUTORESTORE(ctxt);
- qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
- g_autofree char *format = NULL;
- g_autofree char *type = NULL;
- g_autoptr(virStorageSource) migrSource = NULL;
- xmlNodePtr sourceNode;
-
- ctxt->node = node;
-
- if (!(ctxt->node = virXPathNode("./migrationSource", ctxt)))
- return 0;
-
- if (!(type = virXMLPropString(ctxt->node, "type"))) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("missing storage source type"));
- return -1;
- }
-
- if (!(format = virXMLPropString(ctxt->node, "format"))) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("missing storage source format"));
- return -1;
- }
-
- if (!(migrSource = virDomainStorageSourceParseBase(type, format, NULL)))
- return -1;
-
- /* newer libvirt uses the <source> subelement instead of formatting the
- * source directly into <migrationSource> */
- if ((sourceNode = virXPathNode("./source", ctxt)))
- ctxt->node = sourceNode;
-
- if (virDomainStorageSourceParse(ctxt->node, ctxt, migrSource,
- VIR_DOMAIN_DEF_PARSE_STATUS, xmlopt) < 0)
- return -1;
-
- diskPriv->migrSource = g_steal_pointer(&migrSource);
- return 0;
-}
-
-
-static int
-qemuDomainObjPrivateXMLParseJobNBD(virDomainObjPtr vm,
- qemuDomainObjPrivatePtr priv,
- xmlXPathContextPtr ctxt)
-{
- g_autofree xmlNodePtr *nodes = NULL;
- size_t i;
- int n;
-
- if ((n = virXPathNodeSet("./disk[@migrating='yes']", ctxt, &nodes)) < 0)
- return -1;
-
- if (n > 0) {
- if (priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT) {
- VIR_WARN("Found disks marked for migration but we were not "
- "migrating");
- n = 0;
- }
- for (i = 0; i < n; i++) {
- virDomainDiskDefPtr disk;
- g_autofree char *dst = NULL;
-
- if ((dst = virXMLPropString(nodes[i], "dev")) &&
- (disk = virDomainDiskByTarget(vm->def, dst))) {
- QEMU_DOMAIN_DISK_PRIVATE(disk)->migrating = true;
-
- if (qemuDomainObjPrivateXMLParseJobNBDSource(nodes[i], ctxt,
- disk,
- priv->driver->xmlopt) < 0)
- return -1;
- }
- }
- }
-
- return 0;
-}
-
-
-static int
-qemuDomainObjPrivateXMLParseJob(virDomainObjPtr vm,
- qemuDomainObjPrivatePtr priv,
- xmlXPathContextPtr ctxt)
-{
- VIR_XPATH_NODE_AUTORESTORE(ctxt);
- g_autofree char *tmp = NULL;
-
- if (!(ctxt->node = virXPathNode("./job[1]", ctxt)))
- return 0;
-
- if ((tmp = virXPathString("string(@type)", ctxt))) {
- int type;
-
- if ((type = qemuDomainJobTypeFromString(tmp)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown job type %s"), tmp);
- return -1;
- }
- VIR_FREE(tmp);
- priv->job.active = type;
- }
-
- if ((tmp = virXPathString("string(@async)", ctxt))) {
- int async;
-
- if ((async = qemuDomainAsyncJobTypeFromString(tmp)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown async job type %s"), tmp);
- return -1;
- }
- VIR_FREE(tmp);
- priv->job.asyncJob = async;
-
- if ((tmp = virXPathString("string(@phase)", ctxt))) {
- priv->job.phase = qemuDomainAsyncJobPhaseFromString(async, tmp);
- if (priv->job.phase < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown job phase %s"), tmp);
- return -1;
- }
- VIR_FREE(tmp);
- }
- }
-
- if (virXPathULongHex("string(@flags)", ctxt, &priv->job.apiFlags) == -2) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid job flags"));
- return -1;
- }
-
- if (qemuDomainObjPrivateXMLParseJobNBD(vm, priv, ctxt) < 0)
- return -1;
-
- if (qemuMigrationParamsParse(ctxt, &priv->job.migParams) < 0)
- return -1;
-
- return 0;
-}
-
-
static int
qemuDomainObjPrivateXMLParseSlirpFeatures(xmlNodePtr featuresNode,
xmlXPathContextPtr ctxt,
@@ -3198,7 +2961,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
priv->lockState = virXPathString("string(./lockstate)", ctxt);
- if (qemuDomainObjPrivateXMLParseJob(vm, priv, ctxt) < 0)
+ if (priv->job.cb.parseJob(vm, &priv->job, ctxt, priv->driver->xmlopt) < 0)
goto error;
priv->fakeReboot = virXPathBoolean("boolean(./fakereboot)", ctxt) == 1;
diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index 7111acadda..389777153b 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -63,11 +63,6 @@ VIR_ENUM_IMPL(qemuDomainAsyncJob,
"backup",
);
-VIR_ENUM_IMPL(qemuDomainNamespace,
- QEMU_DOMAIN_NS_LAST,
- "mount",
-);
-
const char *
qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job,
@@ -121,22 +116,68 @@ qemuDomainAsyncJobPhaseFromString(qemuDomainAsyncJob job,
return -1;
}
+static void
+qemuJobInfoFreePrivateData(qemuDomainJobInfoPrivatePtr priv)
+{
+ g_free(&priv->stats);
+}
+
+static void
+qemuJobInfoFreePrivate(void *opaque)
+{
+ qemuDomainJobInfoPtr jobInfo = (qemuDomainJobInfoPtr) opaque;
+ qemuJobInfoFreePrivateData(jobInfo->privateData);
+}
void
qemuDomainJobInfoFree(qemuDomainJobInfoPtr info)
{
+ info->cb.freeJobInfoPrivate(info);
g_free(info->errmsg);
g_free(info);
}
+static void *
+qemuDomainJobInfoPrivateAlloc(void)
+{
+ qemuDomainJobInfoPrivatePtr retPriv = g_new0(qemuDomainJobInfoPrivate, 1);
+ return (void *)retPriv;
+}
+
+static void
+qemuDomainJobInfoPrivateCopy(qemuDomainJobInfoPtr src,
+ qemuDomainJobInfoPtr dest)
+{
+ memcpy(dest->privateData, src->privateData,
+ sizeof(qemuDomainJobInfoPrivate));
+}
+
+static qemuDomainJobInfoPtr
+qemuDomainJobInfoAlloc(void)
+{
+ qemuDomainJobInfoPtr ret = g_new0(qemuDomainJobInfo, 1);
+ ret->cb.allocJobInfoPrivate = &qemuDomainJobInfoPrivateAlloc;
+ ret->cb.freeJobInfoPrivate = &qemuJobInfoFreePrivate;
+ ret->cb.copyJobInfoPrivate = &qemuDomainJobInfoPrivateCopy;
+ ret->privateData = ret->cb.allocJobInfoPrivate();
+ return ret;
+}
+
+static void
+qemuDomainCurrentJobInfoInit(qemuDomainJobObjPtr job)
+{
+ job->current = qemuDomainJobInfoAlloc();
+ job->current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
+}
+
qemuDomainJobInfoPtr
qemuDomainJobInfoCopy(qemuDomainJobInfoPtr info)
{
- qemuDomainJobInfoPtr ret = g_new0(qemuDomainJobInfo, 1);
+ qemuDomainJobInfoPtr ret = qemuDomainJobInfoAlloc();
memcpy(ret, info, sizeof(*info));
-
+ ret->cb.copyJobInfoPrivate(info, ret);
ret->errmsg = g_strdup(info->errmsg);
return ret;
@@ -166,10 +207,43 @@ qemuDomainEventEmitJobCompleted(virQEMUDriverPtr driver,
}
+static void *
+qemuJobAllocPrivate(void)
+{
+ qemuDomainJobPrivatePtr priv;
+ if (VIR_ALLOC(priv) < 0)
+ return NULL;
+ return (void *)priv;
+}
+
+
+static void
+qemuJobFreePrivateData(qemuDomainJobPrivatePtr priv)
+{
+ priv->spiceMigration = false;
+ priv->spiceMigrated = false;
+ priv->dumpCompleted = false;
+ qemuMigrationParamsFree(priv->migParams);
+ priv->migParams = NULL;
+}
+
+static void
+qemuJobFreePrivate(void *opaque)
+{
+ qemuDomainJobObjPtr job = (qemuDomainJobObjPtr) opaque;
+ qemuJobFreePrivateData(job->privateData);
+}
+
+
int
qemuDomainObjInitJob(qemuDomainJobObjPtr job)
{
memset(job, 0, sizeof(*job));
+ job->cb.allocJobPrivate = &qemuJobAllocPrivate;
+ job->cb.freeJobPrivate = &qemuJobFreePrivate;
+ job->cb.formatJob = &qemuDomainObjPrivateXMLFormatJob;
+ job->cb.parseJob = &qemuDomainObjPrivateXMLParseJob;
+ job->privateData = job->cb.allocJobPrivate();
if (virCondInit(&job->cond) < 0)
return -1;
@@ -213,13 +287,9 @@ qemuDomainObjResetAsyncJob(qemuDomainJobObjPtr job)
job->phase = 0;
job->mask = QEMU_JOB_DEFAULT_MASK;
job->abortJob = false;
- job->spiceMigration = false;
- job->spiceMigrated = false;
- job->dumpCompleted = false;
VIR_FREE(job->error);
g_clear_pointer(&job->current, qemuDomainJobInfoFree);
- qemuMigrationParamsFree(job->migParams);
- job->migParams = NULL;
+ job->cb.freeJobPrivate(job);
job->apiFlags = 0;
}
@@ -235,7 +305,7 @@ qemuDomainObjRestoreJob(virDomainObjPtr obj,
job->asyncJob = priv->job.asyncJob;
job->asyncOwner = priv->job.asyncOwner;
job->phase = priv->job.phase;
- job->migParams = g_steal_pointer(&priv->job.migParams);
+ job->privateData = g_steal_pointer(&priv->job.privateData);
job->apiFlags = priv->job.apiFlags;
qemuDomainObjResetJob(&priv->job);
@@ -285,6 +355,7 @@ int
qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfoPtr jobInfo)
{
unsigned long long now;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
if (!jobInfo->stopped)
return 0;
@@ -298,8 +369,8 @@ qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfoPtr jobInfo)
return 0;
}
- jobInfo->stats.mig.downtime = now - jobInfo->stopped;
- jobInfo->stats.mig.downtime_set = true;
+ jobInfoPriv->stats.mig.downtime = now - jobInfo->stopped;
+ jobInfoPriv->stats.mig.downtime_set = true;
return 0;
}
@@ -334,38 +405,39 @@ int
qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo,
virDomainJobInfoPtr info)
{
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
info->type = qemuDomainJobStatusToType(jobInfo->status);
info->timeElapsed = jobInfo->timeElapsed;
switch (jobInfo->statsType) {
case QEMU_DOMAIN_JOB_STATS_TYPE_MIGRATION:
- info->memTotal = jobInfo->stats.mig.ram_total;
- info->memRemaining = jobInfo->stats.mig.ram_remaining;
- info->memProcessed = jobInfo->stats.mig.ram_transferred;
- info->fileTotal = jobInfo->stats.mig.disk_total +
+ info->memTotal = jobInfoPriv->stats.mig.ram_total;
+ info->memRemaining = jobInfoPriv->stats.mig.ram_remaining;
+ info->memProcessed = jobInfoPriv->stats.mig.ram_transferred;
+ info->fileTotal = jobInfoPriv->stats.mig.disk_total +
jobInfo->mirrorStats.total;
- info->fileRemaining = jobInfo->stats.mig.disk_remaining +
+ info->fileRemaining = jobInfoPriv->stats.mig.disk_remaining +
(jobInfo->mirrorStats.total -
jobInfo->mirrorStats.transferred);
- info->fileProcessed = jobInfo->stats.mig.disk_transferred +
+ info->fileProcessed = jobInfoPriv->stats.mig.disk_transferred +
jobInfo->mirrorStats.transferred;
break;
case QEMU_DOMAIN_JOB_STATS_TYPE_SAVEDUMP:
- info->memTotal = jobInfo->stats.mig.ram_total;
- info->memRemaining = jobInfo->stats.mig.ram_remaining;
- info->memProcessed = jobInfo->stats.mig.ram_transferred;
+ info->memTotal = jobInfoPriv->stats.mig.ram_total;
+ info->memRemaining = jobInfoPriv->stats.mig.ram_remaining;
+ info->memProcessed = jobInfoPriv->stats.mig.ram_transferred;
break;
case QEMU_DOMAIN_JOB_STATS_TYPE_MEMDUMP:
- info->memTotal = jobInfo->stats.dump.total;
- info->memProcessed = jobInfo->stats.dump.completed;
+ info->memTotal = jobInfoPriv->stats.dump.total;
+ info->memProcessed = jobInfoPriv->stats.dump.completed;
info->memRemaining = info->memTotal - info->memProcessed;
break;
case QEMU_DOMAIN_JOB_STATS_TYPE_BACKUP:
- info->fileTotal = jobInfo->stats.backup.total;
- info->fileProcessed = jobInfo->stats.backup.transferred;
+ info->fileTotal = jobInfoPriv->stats.backup.total;
+ info->fileProcessed = jobInfoPriv->stats.backup.transferred;
info->fileRemaining = info->fileTotal - info->fileProcessed;
break;
@@ -387,7 +459,8 @@ qemuDomainMigrationJobInfoToParams(qemuDomainJobInfoPtr jobInfo,
virTypedParameterPtr *params,
int *nparams)
{
- qemuMonitorMigrationStats *stats = &jobInfo->stats.mig;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
+ qemuMonitorMigrationStats *stats = &jobInfoPriv->stats.mig;
qemuDomainMirrorStatsPtr mirrorStats = &jobInfo->mirrorStats;
virTypedParameterPtr par = NULL;
int maxpar = 0;
@@ -564,7 +637,8 @@ qemuDomainDumpJobInfoToParams(qemuDomainJobInfoPtr jobInfo,
virTypedParameterPtr *params,
int *nparams)
{
- qemuMonitorDumpStats *stats = &jobInfo->stats.dump;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
+ qemuMonitorDumpStats *stats = &jobInfoPriv->stats.dump;
virTypedParameterPtr par = NULL;
int maxpar = 0;
int npar = 0;
@@ -607,7 +681,8 @@ qemuDomainBackupJobInfoToParams(qemuDomainJobInfoPtr jobInfo,
virTypedParameterPtr *params,
int *nparams)
{
- qemuDomainBackupStats *stats = &jobInfo->stats.backup;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
+ qemuDomainBackupStats *stats = &jobInfoPriv->stats.backup;
g_autoptr(virTypedParamList) par = g_new0(virTypedParamList, 1);
if (virTypedParamListAddInt(par, jobInfo->operation,
@@ -782,6 +857,7 @@ qemuDomainObjCanSetJob(qemuDomainJobObjPtr job,
/* Give up waiting for mutex after 30 seconds */
#define QEMU_JOB_WAIT_TIME (1000ull * 30)
+
/**
* qemuDomainObjBeginJobInternal:
* @driver: qemu driver
@@ -890,8 +966,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
qemuDomainAsyncJobTypeToString(asyncJob),
obj, obj->def->name);
qemuDomainObjResetAsyncJob(&priv->job);
- priv->job.current = g_new0(qemuDomainJobInfo, 1);
- priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
+ qemuDomainCurrentJobInfoInit(&priv->job);
priv->job.asyncJob = asyncJob;
priv->job.asyncOwner = virThreadSelfID();
priv->job.asyncOwnerAPI = virThreadJobGet();
@@ -1190,3 +1265,248 @@ qemuDomainObjAbortAsyncJob(virDomainObjPtr obj)
priv->job.abortJob = true;
virDomainObjBroadcast(obj);
}
+
+
+static int
+qemuDomainObjPrivateXMLFormatNBDMigrationSource(virBufferPtr buf,
+ virStorageSourcePtr src,
+ virDomainXMLOptionPtr xmlopt)
+{
+ g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
+ g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
+
+ virBufferAsprintf(&attrBuf, " type='%s' format='%s'",
+ virStorageTypeToString(src->type),
+ virStorageFileFormatTypeToString(src->format));
+
+ if (virDomainDiskSourceFormat(&childBuf, src, "source", 0, false,
+ VIR_DOMAIN_DEF_FORMAT_STATUS,
+ false, false, xmlopt) < 0)
+ return -1;
+
+ virXMLFormatElement(buf, "migrationSource", &attrBuf, &childBuf);
+
+ return 0;
+}
+
+
+static int
+qemuDomainObjPrivateXMLFormatNBDMigration(virBufferPtr buf,
+ virDomainObjPtr vm)
+{
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+ size_t i;
+ virDomainDiskDefPtr disk;
+ qemuDomainDiskPrivatePtr diskPriv;
+
+ for (i = 0; i < vm->def->ndisks; i++) {
+ g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
+ g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
+ disk = vm->def->disks[i];
+ diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
+
+ virBufferAsprintf(&attrBuf, " dev='%s' migrating='%s'",
+ disk->dst, diskPriv->migrating ? "yes" : "no");
+
+ if (diskPriv->migrSource &&
+ qemuDomainObjPrivateXMLFormatNBDMigrationSource(&childBuf,
+ diskPriv->migrSource,
+ priv->driver->xmlopt) < 0)
+ return -1;
+
+ virXMLFormatElement(buf, "disk", &attrBuf, &childBuf);
+ }
+
+ return 0;
+}
+
+
+int
+qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
+ virDomainObjPtr vm,
+ qemuDomainJobObjPtr jobObj)
+{
+ g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
+ g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
+ qemuDomainJob job = jobObj->active;
+ qemuDomainJobPrivatePtr jobPriv = jobObj->privateData;
+
+ if (!qemuDomainTrackJob(job))
+ job = QEMU_JOB_NONE;
+
+ if (job == QEMU_JOB_NONE &&
+ jobObj->asyncJob == QEMU_ASYNC_JOB_NONE)
+ return 0;
+
+ virBufferAsprintf(&attrBuf, " type='%s' async='%s'",
+ qemuDomainJobTypeToString(job),
+ qemuDomainAsyncJobTypeToString(jobObj->asyncJob));
+
+ if (jobObj->phase) {
+ virBufferAsprintf(&attrBuf, " phase='%s'",
+ qemuDomainAsyncJobPhaseToString(jobObj->asyncJob,
+ jobObj->phase));
+ }
+
+ if (jobObj->asyncJob != QEMU_ASYNC_JOB_NONE)
+ virBufferAsprintf(&attrBuf, " flags='0x%lx'", jobObj->apiFlags);
+
+ if (jobObj->asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT &&
+ qemuDomainObjPrivateXMLFormatNBDMigration(&childBuf, vm) < 0)
+ return -1;
+
+ if (jobPriv->migParams)
+ qemuMigrationParamsFormat(&childBuf, jobPriv->migParams);
+
+ virXMLFormatElement(buf, "job", &attrBuf, &childBuf);
+
+ return 0;
+}
+
+
+static int
+qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
+ virDomainDiskDefPtr disk,
+ virDomainXMLOptionPtr xmlopt)
+{
+ VIR_XPATH_NODE_AUTORESTORE(ctxt);
+ qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
+ g_autofree char *format = NULL;
+ g_autofree char *type = NULL;
+ g_autoptr(virStorageSource) migrSource = NULL;
+ xmlNodePtr sourceNode;
+
+ ctxt->node = node;
+
+ if (!(ctxt->node = virXPathNode("./migrationSource", ctxt)))
+ return 0;
+
+ if (!(type = virXMLPropString(ctxt->node, "type"))) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing storage source type"));
+ return -1;
+ }
+
+ if (!(format = virXMLPropString(ctxt->node, "format"))) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing storage source format"));
+ return -1;
+ }
+
+ if (!(migrSource = virDomainStorageSourceParseBase(type, format, NULL)))
+ return -1;
+
+ /* newer libvirt uses the <source> subelement instead of formatting the
+ * source directly into <migrationSource> */
+ if ((sourceNode = virXPathNode("./source", ctxt)))
+ ctxt->node = sourceNode;
+
+ if (virDomainStorageSourceParse(ctxt->node, ctxt, migrSource,
+ VIR_DOMAIN_DEF_PARSE_STATUS, xmlopt) < 0)
+ return -1;
+
+ diskPriv->migrSource = g_steal_pointer(&migrSource);
+ return 0;
+}
+
+
+static int
+qemuDomainObjPrivateXMLParseJobNBD(virDomainObjPtr vm,
+ qemuDomainJobObjPtr job,
+ xmlXPathContextPtr ctxt,
+ virDomainXMLOptionPtr xmlopt)
+{
+ g_autofree xmlNodePtr *nodes = NULL;
+ size_t i;
+ int n;
+
+ if ((n = virXPathNodeSet("./disk[@migrating='yes']", ctxt, &nodes)) < 0)
+ return -1;
+
+ if (n > 0) {
+ if (job->asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT) {
+ VIR_WARN("Found disks marked for migration but we were not "
+ "migrating");
+ n = 0;
+ }
+ for (i = 0; i < n; i++) {
+ virDomainDiskDefPtr disk;
+ g_autofree char *dst = NULL;
+
+ if ((dst = virXMLPropString(nodes[i], "dev")) &&
+ (disk = virDomainDiskByTarget(vm->def, dst))) {
+ QEMU_DOMAIN_DISK_PRIVATE(disk)->migrating = true;
+
+ if (qemuDomainObjPrivateXMLParseJobNBDSource(nodes[i], ctxt,
+ disk,
+ xmlopt) < 0)
+ return -1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+int
+qemuDomainObjPrivateXMLParseJob(virDomainObjPtr vm,
+ qemuDomainJobObjPtr job,
+ xmlXPathContextPtr ctxt,
+ virDomainXMLOptionPtr xmlopt)
+{
+ qemuDomainJobPrivatePtr jobPriv = job->privateData;
+ VIR_XPATH_NODE_AUTORESTORE(ctxt);
+ g_autofree char *tmp = NULL;
+
+ if (!(ctxt->node = virXPathNode("./job[1]", ctxt)))
+ return 0;
+
+ if ((tmp = virXPathString("string(@type)", ctxt))) {
+ int type;
+
+ if ((type = qemuDomainJobTypeFromString(tmp)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown job type %s"), tmp);
+ return -1;
+ }
+ VIR_FREE(tmp);
+ job->active = type;
+ }
+
+ if ((tmp = virXPathString("string(@async)", ctxt))) {
+ int async;
+
+ if ((async = qemuDomainAsyncJobTypeFromString(tmp)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown async job type %s"), tmp);
+ return -1;
+ }
+ VIR_FREE(tmp);
+ job->asyncJob = async;
+
+ if ((tmp = virXPathString("string(@phase)", ctxt))) {
+ job->phase = qemuDomainAsyncJobPhaseFromString(async, tmp);
+ if (job->phase < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown job phase %s"), tmp);
+ return -1;
+ }
+ VIR_FREE(tmp);
+ }
+ }
+
+ if (virXPathULongHex("string(@flags)", ctxt, &job->apiFlags) == -2) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid job flags"));
+ return -1;
+ }
+
+ if (qemuDomainObjPrivateXMLParseJobNBD(vm, job, ctxt, xmlopt) < 0)
+ return -1;
+
+ if (qemuMigrationParamsParse(ctxt, &jobPriv->migParams) < 0)
+ return -1;
+
+ return 0;
+}
diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h
index 124664354d..ca546c8844 100644
--- a/src/qemu/qemu_domainjob.h
+++ b/src/qemu/qemu_domainjob.h
@@ -19,7 +19,6 @@
#pragma once
#include <glib-object.h>
-#include "qemu_migration_params.h"
#define JOB_MASK(job) (job == 0 ? 0 : 1 << (job - 1))
#define QEMU_JOB_DEFAULT_MASK \
@@ -99,7 +98,6 @@ typedef enum {
QEMU_DOMAIN_JOB_STATS_TYPE_BACKUP,
} qemuDomainJobStatsType;
-
typedef struct _qemuDomainMirrorStats qemuDomainMirrorStats;
typedef qemuDomainMirrorStats *qemuDomainMirrorStatsPtr;
struct _qemuDomainMirrorStats {
@@ -107,16 +105,22 @@ struct _qemuDomainMirrorStats {
unsigned long long total;
};
-typedef struct _qemuDomainBackupStats qemuDomainBackupStats;
-struct _qemuDomainBackupStats {
- unsigned long long transferred;
- unsigned long long total;
- unsigned long long tmp_used;
- unsigned long long tmp_total;
-};
typedef struct _qemuDomainJobInfo qemuDomainJobInfo;
typedef qemuDomainJobInfo *qemuDomainJobInfoPtr;
+
+typedef void *(*qemuDomainObjJobInfoPrivateAlloc)(void);
+typedef void (*qemuDomainObjJobInfoPrivateFree)(void *);
+typedef void (*qemuDomainObjJobInfoPrivateCopy)(qemuDomainJobInfoPtr,
+ qemuDomainJobInfoPtr);
+
+typedef struct _qemuDomainObjPrivateJobInfoCallbacks qemuDomainObjPrivateJobInfoCallbacks;
+struct _qemuDomainObjPrivateJobInfoCallbacks {
+ qemuDomainObjJobInfoPrivateAlloc allocJobInfoPrivate;
+ qemuDomainObjJobInfoPrivateFree freeJobInfoPrivate;
+ qemuDomainObjJobInfoPrivateCopy copyJobInfoPrivate;
+};
+
struct _qemuDomainJobInfo {
qemuDomainJobStatus status;
virDomainJobOperation operation;
@@ -136,16 +140,15 @@ struct _qemuDomainJobInfo {
bool timeDeltaSet;
/* Raw values from QEMU */
qemuDomainJobStatsType statsType;
- union {
- qemuMonitorMigrationStats mig;
- qemuMonitorDumpStats dump;
- qemuDomainBackupStats backup;
- } stats;
qemuDomainMirrorStats mirrorStats;
char *errmsg; /* optional error message for failed completed jobs */
+
+ void *privateData; /* job specific collection of info */
+ qemuDomainObjPrivateJobInfoCallbacks cb;
};
+
void
qemuDomainJobInfoFree(qemuDomainJobInfoPtr info);
@@ -156,6 +159,25 @@ qemuDomainJobInfoCopy(qemuDomainJobInfoPtr info);
typedef struct _qemuDomainJobObj qemuDomainJobObj;
typedef qemuDomainJobObj *qemuDomainJobObjPtr;
+
+typedef void *(*qemuDomainObjPrivateJobAlloc)(void);
+typedef void (*qemuDomainObjPrivateJobFree)(void *);
+typedef int (*qemuDomainObjPrivateJobFormat)(virBufferPtr,
+ virDomainObjPtr,
+ qemuDomainJobObjPtr);
+typedef int (*qemuDomainObjPrivateJobParse)(virDomainObjPtr,
+ qemuDomainJobObjPtr,
+ xmlXPathContextPtr,
+ virDomainXMLOptionPtr);
+
+typedef struct _qemuDomainObjPrivateJobCallbacks qemuDomainObjPrivateJobCallbacks;
+struct _qemuDomainObjPrivateJobCallbacks {
+ qemuDomainObjPrivateJobAlloc allocJobPrivate;
+ qemuDomainObjPrivateJobFree freeJobPrivate;
+ qemuDomainObjPrivateJobFormat formatJob;
+ qemuDomainObjPrivateJobParse parseJob;
+};
+
struct _qemuDomainJobObj {
virCond cond; /* Use to coordinate jobs */
@@ -182,14 +204,10 @@ struct _qemuDomainJobObj {
qemuDomainJobInfoPtr current; /* async job progress data */
qemuDomainJobInfoPtr completed; /* statistics data of a recently completed job */
bool abortJob; /* abort of the job requested */
- bool spiceMigration; /* we asked for spice migration and we
- * should wait for it to finish */
- bool spiceMigrated; /* spice migration completed */
char *error; /* job event completion error */
- bool dumpCompleted; /* dump completed */
-
- qemuMigrationParamsPtr migParams;
unsigned long apiFlags; /* flags passed to the API which started the async job */
+ void *privateData; /* job specific collection of data */
+ qemuDomainObjPrivateJobCallbacks cb;
};
const char *qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job,
@@ -267,3 +285,14 @@ void qemuDomainObjFreeJob(qemuDomainJobObjPtr job);
int qemuDomainObjInitJob(qemuDomainJobObjPtr job);
bool qemuDomainJobAllowed(qemuDomainJobObjPtr jobs, qemuDomainJob newJob);
+
+int
+qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
+ virDomainObjPtr vm,
+ qemuDomainJobObjPtr jobObj);
+
+int
+qemuDomainObjPrivateXMLParseJob(virDomainObjPtr vm,
+ qemuDomainJobObjPtr job,
+ xmlXPathContextPtr ctxt,
+ virDomainXMLOptionPtr xmlopt);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cd8d7ffb56..3ff5c5db53 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3701,14 +3701,16 @@ static int
qemuDumpWaitForCompletion(virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = priv->job.current->privateData;
VIR_DEBUG("Waiting for dump completion");
- while (!priv->job.dumpCompleted && !priv->job.abortJob) {
+ while (!jobPriv->dumpCompleted && !priv->job.abortJob) {
if (virDomainObjWait(vm) < 0)
return -1;
}
- if (priv->job.current->stats.dump.status == QEMU_MONITOR_DUMP_STATUS_FAILED) {
+ if (jobInfoPriv->stats.dump.status == QEMU_MONITOR_DUMP_STATUS_FAILED) {
if (priv->job.error)
virReportError(VIR_ERR_OPERATION_FAILED,
_("memory-only dump failed: %s"),
@@ -13554,6 +13556,7 @@ qemuDomainGetJobInfoDumpStats(virQEMUDriverPtr driver,
qemuDomainJobInfoPtr jobInfo)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
qemuMonitorDumpStats stats = { 0 };
int rc;
@@ -13565,33 +13568,33 @@ qemuDomainGetJobInfoDumpStats(virQEMUDriverPtr driver,
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
return -1;
- jobInfo->stats.dump = stats;
+ jobInfoPriv->stats.dump = stats;
if (qemuDomainJobInfoUpdateTime(jobInfo) < 0)
return -1;
- switch (jobInfo->stats.dump.status) {
+ switch (jobInfoPriv->stats.dump.status) {
case QEMU_MONITOR_DUMP_STATUS_NONE:
case QEMU_MONITOR_DUMP_STATUS_FAILED:
case QEMU_MONITOR_DUMP_STATUS_LAST:
virReportError(VIR_ERR_OPERATION_FAILED,
_("dump query failed, status=%d"),
- jobInfo->stats.dump.status);
+ jobInfoPriv->stats.dump.status);
return -1;
break;
case QEMU_MONITOR_DUMP_STATUS_ACTIVE:
jobInfo->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
VIR_DEBUG("dump active, bytes written='%llu' remaining='%llu'",
- jobInfo->stats.dump.completed,
- jobInfo->stats.dump.total -
- jobInfo->stats.dump.completed);
+ jobInfoPriv->stats.dump.completed,
+ jobInfoPriv->stats.dump.total -
+ jobInfoPriv->stats.dump.completed);
break;
case QEMU_MONITOR_DUMP_STATUS_COMPLETED:
jobInfo->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
VIR_DEBUG("dump completed, bytes written='%llu'",
- jobInfo->stats.dump.completed);
+ jobInfoPriv->stats.dump.completed);
break;
}
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 13427c1203..a45d13aaac 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1422,12 +1422,13 @@ static int
qemuMigrationSrcWaitForSpice(virDomainObjPtr vm)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
- if (!priv->job.spiceMigration)
+ if (!jobPriv->spiceMigration)
return 0;
VIR_DEBUG("Waiting for SPICE to finish migration");
- while (!priv->job.spiceMigrated && !priv->job.abortJob) {
+ while (!jobPriv->spiceMigrated && !priv->job.abortJob) {
if (virDomainObjWait(vm) < 0)
return -1;
}
@@ -1438,7 +1439,8 @@ qemuMigrationSrcWaitForSpice(virDomainObjPtr vm)
static void
qemuMigrationUpdateJobType(qemuDomainJobInfoPtr jobInfo)
{
- switch ((qemuMonitorMigrationStatus) jobInfo->stats.mig.status) {
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
+ switch ((qemuMonitorMigrationStatus) jobInfoPriv->stats.mig.status) {
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY:
jobInfo->status = QEMU_DOMAIN_JOB_STATUS_POSTCOPY;
break;
@@ -1485,6 +1487,7 @@ qemuMigrationAnyFetchStats(virQEMUDriverPtr driver,
char **error)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
qemuMonitorMigrationStats stats;
int rv;
@@ -1496,7 +1499,7 @@ qemuMigrationAnyFetchStats(virQEMUDriverPtr driver,
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
return -1;
- jobInfo->stats.mig = stats;
+ jobInfoPriv->stats.mig = stats;
return 0;
}
@@ -1538,12 +1541,14 @@ qemuMigrationJobCheckStatus(virQEMUDriverPtr driver,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuDomainJobInfoPtr jobInfo = priv->job.current;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
+
char *error = NULL;
bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT);
int ret = -1;
if (!events ||
- jobInfo->stats.mig.status == QEMU_MONITOR_MIGRATION_STATUS_ERROR) {
+ jobInfoPriv->stats.mig.status == QEMU_MONITOR_MIGRATION_STATUS_ERROR) {
if (qemuMigrationAnyFetchStats(driver, vm, asyncJob, jobInfo, &error) < 0)
return -1;
}
@@ -1777,6 +1782,7 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriverPtr driver,
const char *graphicsuri)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
int ret = -1;
const char *listenAddress = NULL;
virSocketAddr addr;
@@ -1858,7 +1864,7 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriverPtr driver,
QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
ret = qemuMonitorGraphicsRelocate(priv->mon, type, listenAddress,
port, tlsPort, tlsSubject);
- priv->job.spiceMigration = !ret;
+ jobPriv->spiceMigration = !ret;
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
}
@@ -1993,6 +1999,7 @@ qemuMigrationSrcCleanup(virDomainObjPtr vm,
{
virQEMUDriverPtr driver = opaque;
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
VIR_DEBUG("vm=%s, conn=%p, asyncJob=%s, phase=%s",
vm->def->name, conn,
@@ -2018,7 +2025,7 @@ qemuMigrationSrcCleanup(virDomainObjPtr vm,
" domain was successfully started on destination or not",
vm->def->name);
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
- priv->job.migParams, priv->job.apiFlags);
+ jobPriv->migParams, priv->job.apiFlags);
/* clear the job and let higher levels decide what to do */
qemuDomainObjDiscardAsyncJob(driver, vm);
break;
@@ -2403,6 +2410,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
bool relabel = false;
int rv;
char *tlsAlias = NULL;
+ qemuDomainJobPrivatePtr jobPriv = NULL;
virNWFilterReadLockFilterUpdates();
@@ -2410,7 +2418,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
if (flags & (VIR_MIGRATE_NON_SHARED_DISK |
VIR_MIGRATE_NON_SHARED_INC)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("offline migration cannot handle "
+ _("offlineqemuDomainJobPrivatePtr jobPriv = priv->job.privateData;priv migration cannot handle "
"non-shared storage"));
goto cleanup;
}
@@ -2519,6 +2527,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
*def = NULL;
priv = vm->privateData;
+ jobPriv = priv->job.privateData;
priv->origname = g_strdup(origname);
if (taint_hook) {
@@ -2726,7 +2735,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
stopjob:
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
- priv->job.migParams, priv->job.apiFlags);
+ jobPriv->migParams, priv->job.apiFlags);
if (stopProcess) {
unsigned int stopFlags = VIR_QEMU_PROCESS_STOP_MIGRATED;
@@ -3000,6 +3009,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuDomainJobInfoPtr jobInfo = NULL;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
"flags=0x%x, retcode=%d",
@@ -3025,6 +3035,8 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
/* Update times with the values sent by the destination daemon */
if (mig->jobInfo && jobInfo) {
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
+ qemuDomainJobInfoPrivatePtr migJobInfoPriv = mig->jobInfo->privateData;
int reason;
/* We need to refresh migration statistics after a completed post-copy
@@ -3040,8 +3052,8 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
qemuDomainJobInfoUpdateTime(jobInfo);
jobInfo->timeDeltaSet = mig->jobInfo->timeDeltaSet;
jobInfo->timeDelta = mig->jobInfo->timeDelta;
- jobInfo->stats.mig.downtime_set = mig->jobInfo->stats.mig.downtime_set;
- jobInfo->stats.mig.downtime = mig->jobInfo->stats.mig.downtime;
+ jobInfoPriv->stats.mig.downtime_set = migJobInfoPriv->stats.mig.downtime_set;
+ jobInfoPriv->stats.mig.downtime = migJobInfoPriv->stats.mig.downtime;
}
if (flags & VIR_MIGRATE_OFFLINE)
@@ -3084,7 +3096,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
qemuMigrationSrcRestoreDomainState(driver, vm);
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
- priv->job.migParams, priv->job.apiFlags);
+ jobPriv->migParams, priv->job.apiFlags);
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
VIR_WARN("Failed to save status on vm %s", vm->def->name);
@@ -4681,6 +4693,7 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver,
virErrorPtr orig_err = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
flags) < 0)
@@ -4738,7 +4751,7 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver,
*/
if (!v3proto && ret < 0)
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
- priv->job.migParams, priv->job.apiFlags);
+ jobPriv->migParams, priv->job.apiFlags);
qemuMigrationSrcRestoreDomainState(driver, vm);
@@ -4780,6 +4793,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver,
unsigned long resource)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
int ret = -1;
/* If we didn't start the job in the begin phase, start it now. */
@@ -4814,7 +4828,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver,
endjob:
if (ret < 0) {
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
- priv->job.migParams, priv->job.apiFlags);
+ jobPriv->migParams, priv->job.apiFlags);
qemuMigrationJobFinish(driver, vm);
} else {
qemuMigrationJobContinue(vm);
@@ -5019,6 +5033,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
virErrorPtr orig_err = NULL;
int cookie_flags = 0;
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
unsigned short port;
unsigned long long timeReceived = 0;
@@ -5272,7 +5287,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
}
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
- priv->job.migParams, priv->job.apiFlags);
+ jobPriv->migParams, priv->job.apiFlags);
qemuMigrationJobFinish(driver, vm);
if (!virDomainObjIsActive(vm))
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index fb8b5bcd92..b5f4647539 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -641,7 +641,8 @@ static void
qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf,
qemuDomainJobInfoPtr jobInfo)
{
- qemuMonitorMigrationStats *stats = &jobInfo->stats.mig;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = jobInfo->privateData;
+ qemuMonitorMigrationStats *stats = &jobInfoPriv->stats.mig;
virBufferAddLit(buf, "<statistics>\n");
virBufferAdjustIndent(buf, 2);
@@ -1044,6 +1045,7 @@ static qemuDomainJobInfoPtr
qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt)
{
qemuDomainJobInfoPtr jobInfo = NULL;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv = NULL;
qemuMonitorMigrationStats *stats;
VIR_XPATH_NODE_AUTORESTORE(ctxt);
@@ -1051,8 +1053,9 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt)
return NULL;
jobInfo = g_new0(qemuDomainJobInfo, 1);
+ jobInfoPriv = jobInfo->privateData;
- stats = &jobInfo->stats.mig;
+ stats = &jobInfoPriv->stats.mig;
jobInfo->status = QEMU_DOMAIN_JOB_STATUS_COMPLETED;
virXPathULongLong("string(./started[1])", ctxt, &jobInfo->started);
diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 6953badcfe..ba3eb14831 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -953,6 +953,7 @@ qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver,
qemuMigrationParamsPtr migParams)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
virJSONValuePtr tlsProps = NULL;
virJSONValuePtr secProps = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
@@ -965,7 +966,7 @@ qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver,
goto error;
}
- if (!priv->job.migParams->params[QEMU_MIGRATION_PARAM_TLS_CREDS].set) {
+ if (!jobPriv->migParams->params[QEMU_MIGRATION_PARAM_TLS_CREDS].set) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("TLS migration is not supported with this "
"QEMU binary"));
@@ -1038,8 +1039,9 @@ qemuMigrationParamsDisableTLS(virDomainObjPtr vm,
qemuMigrationParamsPtr migParams)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
- if (!priv->job.migParams->params[QEMU_MIGRATION_PARAM_TLS_CREDS].set)
+ if (!jobPriv->migParams->params[QEMU_MIGRATION_PARAM_TLS_CREDS].set)
return 0;
if (qemuMigrationParamsSetString(migParams,
@@ -1168,6 +1170,7 @@ qemuMigrationParamsCheck(virQEMUDriverPtr driver,
virBitmapPtr remoteCaps)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
+ qemuDomainJobPrivatePtr jobPriv = priv->job.privateData;
qemuMigrationCapability cap;
qemuMigrationParty party;
size_t i;
@@ -1221,7 +1224,7 @@ qemuMigrationParamsCheck(virQEMUDriverPtr driver,
* to ask QEMU for their current settings.
*/
- return qemuMigrationParamsFetch(driver, vm, asyncJob, &priv->job.migParams);
+ return qemuMigrationParamsFetch(driver, vm, asyncJob, &jobPriv->migParams);
}
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index 9aea24725f..381eabbe4a 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -70,6 +70,34 @@ typedef enum {
QEMU_MIGRATION_DESTINATION = (1 << 1),
} qemuMigrationParty;
+typedef struct _qemuDomainJobPrivate qemuDomainJobPrivate;
+typedef qemuDomainJobPrivate *qemuDomainJobPrivatePtr;
+struct _qemuDomainJobPrivate {
+ bool spiceMigration; /* we asked for spice migration and we
+ * should wait for it to finish */
+ bool spiceMigrated; /* spice migration completed */
+ bool dumpCompleted; /* dump completed */
+ qemuMigrationParamsPtr migParams;
+};
+
+
+typedef struct _qemuDomainBackupStats qemuDomainBackupStats;
+struct _qemuDomainBackupStats {
+ unsigned long long transferred;
+ unsigned long long total;
+ unsigned long long tmp_used;
+ unsigned long long tmp_total;
+};
+
+typedef struct _qemuDomainJobInfoPrivate qemuDomainJobInfoPrivate;
+typedef qemuDomainJobInfoPrivate *qemuDomainJobInfoPrivatePtr;
+struct _qemuDomainJobInfoPrivate {
+ union {
+ qemuMonitorMigrationStats mig;
+ qemuMonitorDumpStats dump;
+ qemuDomainBackupStats backup;
+ } stats;
+};
virBitmapPtr
qemuMigrationParamsGetAlwaysOnCaps(qemuMigrationParty party);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d36088ba98..97c6b2ec27 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1608,6 +1608,7 @@ qemuProcessHandleSpiceMigrated(qemuMonitorPtr mon G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
qemuDomainObjPrivatePtr priv;
+ qemuDomainJobPrivatePtr jobPriv;
virObjectLock(vm);
@@ -1615,12 +1616,13 @@ qemuProcessHandleSpiceMigrated(qemuMonitorPtr mon G_GNUC_UNUSED,
vm, vm->def->name);
priv = vm->privateData;
+ jobPriv = priv->job.privateData;
if (priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT) {
VIR_DEBUG("got SPICE_MIGRATE_COMPLETED event without a migration job");
goto cleanup;
}
- priv->job.spiceMigrated = true;
+ jobPriv->spiceMigrated = true;
virDomainObjBroadcast(vm);
cleanup:
@@ -1636,6 +1638,7 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon G_GNUC_UNUSED,
void *opaque)
{
qemuDomainObjPrivatePtr priv;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv;
virQEMUDriverPtr driver = opaque;
virObjectEventPtr event = NULL;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
@@ -1648,12 +1651,13 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon G_GNUC_UNUSED,
qemuMonitorMigrationStatusTypeToString(status));
priv = vm->privateData;
+ jobInfoPriv = priv->job.current->privateData;
if (priv->job.asyncJob == QEMU_ASYNC_JOB_NONE) {
VIR_DEBUG("got MIGRATION event without a migration job");
goto cleanup;
}
- priv->job.current->stats.mig.status = status;
+ jobInfoPriv->stats.mig.status = status;
virDomainObjBroadcast(vm);
if (status == QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY &&
@@ -1720,6 +1724,8 @@ qemuProcessHandleDumpCompleted(qemuMonitorPtr mon G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED)
{
qemuDomainObjPrivatePtr priv;
+ qemuDomainJobPrivatePtr jobPriv;
+ qemuDomainJobInfoPrivatePtr jobInfoPriv;
virObjectLock(vm);
@@ -1727,18 +1733,20 @@ qemuProcessHandleDumpCompleted(qemuMonitorPtr mon G_GNUC_UNUSED,
vm, vm->def->name, stats, NULLSTR(error));
priv = vm->privateData;
+ jobPriv = priv->job.privateData;
+ jobInfoPriv = priv->job.current->privateData;
if (priv->job.asyncJob == QEMU_ASYNC_JOB_NONE) {
VIR_DEBUG("got DUMP_COMPLETED event without a dump_completed job");
goto cleanup;
}
- priv->job.dumpCompleted = true;
- priv->job.current->stats.dump = *stats;
+ jobPriv->dumpCompleted = true;
+ jobInfoPriv->stats.dump = *stats;
priv->job.error = g_strdup(error);
/* Force error if extracting the DUMP_COMPLETED status failed */
if (!error && status < 0) {
priv->job.error = g_strdup(virGetLastErrorMessage());
- priv->job.current->stats.dump.status = QEMU_MONITOR_DUMP_STATUS_FAILED;
+ jobInfoPriv->stats.dump.status = QEMU_MONITOR_DUMP_STATUS_FAILED;
}
virDomainObjBroadcast(vm);
@@ -3411,6 +3419,7 @@ qemuProcessRecoverMigrationIn(virQEMUDriverPtr driver,
virDomainState state,
int reason)
{
+ qemuDomainJobPrivatePtr jobPriv = job->privateData;
bool postcopy = (state == VIR_DOMAIN_PAUSED &&
reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED) ||
(state == VIR_DOMAIN_RUNNING &&
@@ -3459,7 +3468,7 @@ qemuProcessRecoverMigrationIn(virQEMUDriverPtr driver,
}
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_NONE,
- job->migParams, job->apiFlags);
+ jobPriv->migParams, job->apiFlags);
return 0;
}
@@ -3471,6 +3480,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
int reason,
unsigned int *stopFlags)
{
+ qemuDomainJobPrivatePtr jobPriv = job->privateData;
bool postcopy = state == VIR_DOMAIN_PAUSED &&
(reason == VIR_DOMAIN_PAUSED_POSTCOPY ||
reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED);
@@ -3554,7 +3564,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
}
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_NONE,
- job->migParams, job->apiFlags);
+ jobPriv->migParams, job->apiFlags);
return 0;
}
--
2.17.1
4 years, 4 months
[PATCH] src: fix word spell typos
by Fangge Jin
Signed-off-by: Fangge Jin <fjin(a)redhat.com>
---
src/bhyve/libvirtd_bhyve.aug | 2 +-
src/cpu/cpu_arm.c | 4 ++--
src/esx/esx_vi.c | 2 +-
src/interface/interface_backend_udev.c | 4 ++--
src/internal.h | 2 +-
src/libvirt-domain.c | 2 +-
src/libvirt-nodedev.c | 2 +-
src/libxl/libxl_conf.c | 2 +-
src/libxl/libxl_driver.c | 2 +-
src/libxl/libxl_logger.c | 2 +-
src/locking/libvirt_lockd.aug | 2 +-
src/locking/libvirt_sanlock.aug | 2 +-
src/locking/virtlockd.aug | 2 +-
src/logging/virtlogd.aug | 2 +-
src/lxc/libvirtd_lxc.aug | 2 +-
src/lxc/lxc_native.c | 2 +-
src/lxc/lxc_process.c | 2 +-
src/node_device/node_device_udev.c | 2 +-
src/qemu/qemu_agent.c | 2 +-
src/qemu/qemu_blockjob.c | 2 +-
src/qemu/qemu_capabilities.c | 4 ++--
src/qemu/qemu_command.c | 4 ++--
src/qemu/qemu_conf.c | 2 +-
src/qemu/qemu_domain.c | 8 ++++----
src/qemu/qemu_domain_address.c | 2 +-
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_migration.c | 2 +-
src/qemu/qemu_monitor.c | 2 +-
src/qemu/qemu_qapi.c | 4 ++--
src/qemu/qemu_security.c | 2 +-
src/remote/libvirtd.aug.in | 2 +-
src/remote/remote_daemon_dispatch.c | 2 +-
src/rpc/virnetlibsshsession.c | 4 ++--
src/rpc/virnetserverprogram.c | 2 +-
src/rpc/virnetsshsession.c | 4 ++--
src/storage/storage_util.c | 4 ++--
src/util/virbuffer.h | 2 +-
src/util/vircommand.c | 2 +-
src/util/virdnsmasq.c | 2 +-
src/util/virhostcpu.c | 2 +-
src/util/virnetdev.c | 2 +-
src/util/virnetdevopenvswitch.c | 4 ++--
src/util/virnetdevtap.c | 2 +-
src/util/virqemu.c | 2 +-
src/util/virresctrl.c | 2 +-
src/util/virsysinfo.c | 2 +-
src/util/virsystemd.c | 2 +-
src/util/virtpm.c | 2 +-
src/vbox/vbox_common.h | 2 +-
src/vbox/vbox_network.c | 4 ++--
src/vbox/vbox_snapshot_conf.c | 4 ++--
src/vbox/vbox_tmpl.c | 2 +-
src/vmx/vmx.c | 2 +-
src/vz/vz_driver.c | 2 +-
src/vz/vz_sdk.c | 4 ++--
56 files changed, 72 insertions(+), 72 deletions(-)
diff --git a/src/bhyve/libvirtd_bhyve.aug b/src/bhyve/libvirtd_bhyve.aug
index 66079376c4..b6bee261a6 100644
--- a/src/bhyve/libvirtd_bhyve.aug
+++ b/src/bhyve/libvirtd_bhyve.aug
@@ -24,7 +24,7 @@ module Libvirtd_bhyve =
let log_entry = str_entry "firmware_dir"
- (* Each enty in the config is one of the following three ... *)
+ (* Each entry in the config is one of the following three ... *)
let entry = log_entry
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
let empty = [ label "#empty" . eol ]
diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index cd4f720c95..016d414143 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -528,9 +528,9 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data)
asm("mrs %0, MIDR_EL1" : "=r" (cpuid));
VIR_DEBUG("CPUID read from register: 0x%016lx", cpuid);
- /* parse the coresponding part_id bits */
+ /* parse the corresponding part_id bits */
data->pvr = (cpuid >> 4) & 0xfff;
- /* parse the coresponding vendor_id bits */
+ /* parse the corresponding vendor_id bits */
data->vendor_id = (cpuid >> 24) & 0xff;
hwcaps = getauxval(AT_HWCAP);
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 16690edfbe..7564ece7e9 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -3419,7 +3419,7 @@ esxVI_LookupFileInfoByDatastorePath(esxVI_Context *ctx,
if (STREQ(directoryName, directoryAndFileName)) {
/*
- * The <path> part of the datatore path didn't contain a '/', assume
+ * The <path> part of the datastore path didn't contain a '/', assume
* that the <path> part is actually the file name.
*/
datastorePathWithoutFileName = g_strdup_printf("[%s]", datastoreName);
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index e388f98536..670de48d52 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -653,7 +653,7 @@ udevGetIfaceDefBond(struct udev *udev,
/* bonding/mode is in the format: "balance-rr 0" so we find the
* space and increment the pointer to get the number and convert
- * it to an interger. libvirt uses 1 through 7 while the raw
+ * it to an integer. libvirt uses 1 through 7 while the raw
* number is 0 through 6 so increment it by 1.
*/
tmp_str = udev_device_get_sysattr_value(dev, "bonding/mode");
@@ -684,7 +684,7 @@ udevGetIfaceDefBond(struct udev *udev,
/* bonding/arp_validate is in the format: "none 0" so we find the
* space and increment the pointer to get the number and convert
- * it to an interger.
+ * it to an integer.
*/
tmp_str = udev_device_get_sysattr_value(dev, "bonding/arp_validate");
if (!tmp_str) {
diff --git a/src/internal.h b/src/internal.h
index e181218067..c054e3ce96 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -490,7 +490,7 @@ enum {
#endif
/* Ideally callers would use the g_*printf
- * functions directly but there are alot to
+ * functions directly but there are a lot to
* convert, so until then...
*/
#ifndef VIR_NO_GLIB_STDIO
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 52ce3ef798..9f65cba2e8 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -10016,7 +10016,7 @@ virDomainGetBlockJobInfo(virDomainPtr dom, const char *disk,
* @bandwidth: specify bandwidth limit; flags determine the unit
* @flags: bitwise-OR of virDomainBlockJobSetSpeedFlags
*
- * Set the maximimum allowable bandwidth that a block job may consume. If
+ * Set the maximum allowable bandwidth that a block job may consume. If
* bandwidth is 0, the limit will revert to the hypervisor default of
* unlimited.
*
diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c
index cdec123568..ca6c2bb057 100644
--- a/src/libvirt-nodedev.c
+++ b/src/libvirt-nodedev.c
@@ -492,7 +492,7 @@ virNodeDeviceRef(virNodeDevicePtr dev)
* virNodeDeviceDettach:
* @dev: pointer to the node device
*
- * Dettach the node device from the node itself so that it may be
+ * Detach the node device from the node itself so that it may be
* assigned to a guest domain.
*
* Depending on the hypervisor, this may involve operations such
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index a0059fc2a7..a2a2abfd8d 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1866,7 +1866,7 @@ int libxlDriverConfigLoadFile(libxlDriverConfigPtr cfg,
}
/*
- * dom0's maximum memory can be controled by the user with the 'dom0_mem' Xen
+ * dom0's maximum memory can be controlled by the user with the 'dom0_mem' Xen
* command line parameter. E.g. to set dom0's initial memory to 4G and max
* memory to 8G: dom0_mem=4G,max:8G
* Supported unit suffixes are [bBkKmMgGtT]. If not specified the default
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index a80bc3fe3a..1585d8d0b3 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1533,7 +1533,7 @@ libxlDomainPMWakeup(virDomainPtr dom, unsigned int flags)
goto endjob;
}
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_WAKEUP);
- /* reenable death event - libxl reports it only once */
+ /* re-enable death event - libxl reports it only once */
if (priv->deathW)
libxl_evdisable_domain_death(cfg->ctx, priv->deathW);
if (libxl_evenable_domain_death(cfg->ctx, vm->def->id, 0, &priv->deathW))
diff --git a/src/libxl/libxl_logger.c b/src/libxl/libxl_logger.c
index 379d7a8d00..58b6e7bfa1 100644
--- a/src/libxl/libxl_logger.c
+++ b/src/libxl/libxl_logger.c
@@ -119,7 +119,7 @@ libvirt_progress(xentoollog_logger *logger_in G_GNUC_UNUSED,
unsigned long done G_GNUC_UNUSED,
unsigned long total G_GNUC_UNUSED)
{
- /* This function purposedly does nothing: it's no logging info */
+ /* This function purposely does nothing: it's no logging info */
}
static void
diff --git a/src/locking/libvirt_lockd.aug b/src/locking/libvirt_lockd.aug
index 6888e8e9b7..8cdb71a8a4 100644
--- a/src/locking/libvirt_lockd.aug
+++ b/src/locking/libvirt_lockd.aug
@@ -16,7 +16,7 @@ module Libvirt_lockd =
let int_entry (kw:string) = [ key kw . value_sep . int_val ]
- (* Each enty in the config is one of the following three ... *)
+ (* Each entry in the config is one of the following three ... *)
let entry = bool_entry "auto_disk_leases"
| bool_entry "require_lease_for_disks"
| str_entry "file_lockspace_dir"
diff --git a/src/locking/libvirt_sanlock.aug b/src/locking/libvirt_sanlock.aug
index 88435902d2..184ea1f181 100644
--- a/src/locking/libvirt_sanlock.aug
+++ b/src/locking/libvirt_sanlock.aug
@@ -16,7 +16,7 @@ module Libvirt_sanlock =
let int_entry (kw:string) = [ key kw . value_sep . int_val ]
- (* Each enty in the config is one of the following three ... *)
+ (* Each entry in the config is one of the following three ... *)
let entry = str_entry "disk_lease_dir"
| bool_entry "auto_disk_leases"
| int_entry "host_id"
diff --git a/src/locking/virtlockd.aug b/src/locking/virtlockd.aug
index 06d508e6e5..4b8224b7bc 100644
--- a/src/locking/virtlockd.aug
+++ b/src/locking/virtlockd.aug
@@ -30,7 +30,7 @@ module Virtlockd =
| int_entry "max_clients"
| int_entry "admin_max_clients"
- (* Each enty in the config is one of the following three ... *)
+ (* Each entry in the config is one of the following three ... *)
let entry = logging_entry
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
let empty = [ label "#empty" . eol ]
diff --git a/src/logging/virtlogd.aug b/src/logging/virtlogd.aug
index 04580734d6..0f1b290c72 100644
--- a/src/logging/virtlogd.aug
+++ b/src/logging/virtlogd.aug
@@ -32,7 +32,7 @@ module Virtlogd =
| int_entry "max_size"
| int_entry "max_backups"
- (* Each enty in the config is one of the following three ... *)
+ (* Each entry in the config is one of the following three ... *)
let entry = logging_entry
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
let empty = [ label "#empty" . eol ]
diff --git a/src/lxc/libvirtd_lxc.aug b/src/lxc/libvirtd_lxc.aug
index be6402cc01..0e7666a70e 100644
--- a/src/lxc/libvirtd_lxc.aug
+++ b/src/lxc/libvirtd_lxc.aug
@@ -28,7 +28,7 @@ module Libvirtd_lxc =
| bool_entry "security_default_confined"
| bool_entry "security_require_confined"
- (* Each enty in the config is one of the following three ... *)
+ (* Each entry in the config is one of the following three ... *)
let entry = log_entry
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
let empty = [ label "#empty" . eol ]
diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 9e879e438a..cc545f5fda 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -713,7 +713,7 @@ lxcNetworkGetParseDataByIndexLegacy(lxcNetworkParseDataArray *networks,
if (ndata > 0)
return networks->parseData[ndata - 1];
- /* Not able to retrive an element */
+ /* Not able to retrieve an element */
return NULL;
}
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index f3d57875ad..fc59c2e5af 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -861,7 +861,7 @@ int virLXCProcessStop(virLXCDriverPtr driver,
/* If the LXC domain is suspended we send all processes a SIGKILL
* and thaw them. Upon wakeup the process sees the pending signal
* and dies immediately. It is guaranteed that priv->cgroup != NULL
- * here because the domain has aleady been suspended using the
+ * here because the domain has already been suspended using the
* freezer cgroup.
*/
if (reason == VIR_DOMAIN_SHUTOFF_DESTROYED &&
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index cec99cb898..ab993438ee 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1409,7 +1409,7 @@ udevEnumerateAddMatches(struct udev_enumerate *udev_enumerate)
for (i = 0; i < G_N_ELEMENTS(subsystem_ignored); i++) {
const char *s = subsystem_ignored[i];
if (udev_enumerate_add_nomatch_subsystem(udev_enumerate, s) < 0) {
- virReportSystemError(errno, "%s", _("failed to add susbsystem filter"));
+ virReportSystemError(errno, "%s", _("failed to add subsystem filter"));
return -1;
}
}
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 6fa48c06e3..609567664f 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -90,7 +90,7 @@ struct _qemuAgentMessage {
bool finished;
/* true for sync command */
bool sync;
- /* id of the issued sync comand */
+ /* id of the issued sync command */
unsigned long long id;
bool first;
};
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 435c945b78..0039bc0e9f 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -519,7 +519,7 @@ qemuBlockJobRefreshJobs(virQEMUDriverPtr driver,
/* try cancelling invalid jobs - this works only if the job is not
* concluded. In such case it will fail. We'll leave such job linger
* in qemu and just forget about it in libvirt because there's not much
- * we coud do besides killing the VM */
+ * we could do besides killing the VM */
if (job->invalidData) {
qemuBlockJobMarkBroken(job);
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 8d5b76d9ec..eb86cd9e81 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -615,7 +615,7 @@ typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData;
typedef virQEMUCapsHostCPUData *virQEMUCapsHostCPUDataPtr;
struct _virQEMUCapsHostCPUData {
/* Only the "info" part is stored in the capabilities cache, the rest is
- * re-computed from other fields and external data sources everytime we
+ * re-computed from other fields and external data sources every time we
* probe QEMU or load the cache.
*/
qemuMonitorCPUModelInfoPtr info;
@@ -5280,7 +5280,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
virQEMUCapsInitQMPBasicArch(qemuCaps);
- /* initiate all capapbilities based on qemu version */
+ /* initiate all capabilities based on qemu version */
virQEMUCapsInitQMPVersionCaps(qemuCaps);
if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7f215b4cc6..7b497f5330 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -806,7 +806,7 @@ qemuBuildRBDSecinfoURI(virBufferPtr buf,
/* qemuBuildTLSx509BackendProps:
* @tlspath: path to the TLS credentials
- * @listen: boolen listen for client or server setting
+ * @listen: boolean listen for client or server setting
* @verifypeer: boolean to enable peer verification (form of authorization)
* @alias: alias for the TLS credentials object
* @secalias: if one exists, the alias of the security object for passwordid
@@ -847,7 +847,7 @@ qemuBuildTLSx509BackendProps(const char *tlspath,
/* qemuBuildTLSx509CommandLine:
* @cmd: Pointer to command
* @tlspath: path to the TLS credentials
- * @listen: boolen listen for client or server setting
+ * @listen: boolean listen for client or server setting
* @verifypeer: boolean to enable peer verification (form of authorization)
* @certEncSecretAlias: alias of a 'secret' object for decrypting TLS private key
* (optional)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 30d7c61cf9..4762f2a88a 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1646,7 +1646,7 @@ qemuSharedDeviceEntryRemove(virQEMUDriverPtr driver,
if (!(entry = virHashLookup(driver->sharedDevices, key)))
return -1;
- /* Nothing to do if the shared disk is not recored in the table. */
+ /* Nothing to do if the shared disk is not recorded in the table. */
if (!qemuSharedDeviceEntryDomainExists(entry, name, &idx))
return 0;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 42cc78ac1b..befe95f819 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4931,7 +4931,7 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont,
if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT && qemuCaps) {
/* Pick a suitable default model for the USB controller if none
* has been selected by the user and we have the qemuCaps for
- * figuring out which contollers are supported.
+ * figuring out which controllers are supported.
*
* We rely on device availability instead of setting the model
* unconditionally because, for some machine types, there's a
@@ -8193,7 +8193,7 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def)
* @mem: memory device definition object
*
* Aligns the size of the memory module as qemu enforces it. The size is updated
- * inplace. Default rounding is now to 1 MiB (qemu requires rouding to page,
+ * inplace. Default rounding is now to 1 MiB (qemu requires rounding to page,
* size so this should be safe).
*/
int
@@ -9307,7 +9307,7 @@ qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver,
if (vm->def->virtType == VIR_DOMAIN_VIRT_QEMU)
return 0;
- /* The halted state is interresting only on s390(x). On other platforms
+ /* The halted state is interesting only on s390(x). On other platforms
* the data would be stale at the time when it would be used.
* Calling qemuMonitorGetCpuHalted() can adversely affect the running
* VM's performance unless QEMU supports query-cpus-fast.
@@ -9402,7 +9402,7 @@ qemuDomainDiskByName(virDomainDefPtr def,
*
* Validate whether the disk source is valid for disk device='lun'.
*
- * Returns 0 if the configuration is valid -1 and a libvirt error if the soure
+ * Returns 0 if the configuration is valid -1 and a libvirt error if the source
* is invalid.
*/
int
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index d2a0bd9c02..058cbda2a2 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2580,7 +2580,7 @@ qemuDomainAddressFindNewBusNr(virDomainDefPtr def)
* never need any additional child buses (probably only a few of the
* 32 will ever be used). So for pci-expander-bus we find the lowest
* existing busNr, and set this one to the current lowest - 2 (one
- * for the pxb, one for the intergrated pci-bridge), thus leaving the
+ * for the pxb, one for the integrated pci-bridge), thus leaving the
* maximum possible bus numbers available for other buses plugged
* into pci-root (i.e. pci-bridges and other
* pci-expander-buses). Anyone who needs more than 32 devices
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cd8d7ffb56..63b54e9f7b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6432,7 +6432,7 @@ qemuDomainDelIOThread(virDomainPtr dom,
*
* Alter the specified @iothread_id with the values provided.
*
- * Returs 0 on success, -1 on failure
+ * Returns 0 on success, -1 on failure
*/
static int
qemuDomainSetIOThreadParams(virDomainPtr dom,
@@ -6770,7 +6770,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
}
if (header->version > QEMU_SAVE_VERSION) {
- /* convert endianess and try again */
+ /* convert endianness and try again */
bswap_header(header);
}
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 3954ad1109..e897c059dd 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -62,7 +62,7 @@ VIR_LOG_INIT("qemu.qemu_hotplug");
#define CHANGE_MEDIA_TIMEOUT 5000
-/* Timeout in miliseconds for device removal. PPC64 domains
+/* Timeout in milliseconds for device removal. PPC64 domains
* can experience a bigger delay in unplug operations during
* heavy guest activity (vcpu being the most notable case), thus
* the timeout for PPC64 is also bigger. */
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 13427c1203..ee3371c098 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3288,7 +3288,7 @@ static void qemuMigrationSrcIOFunc(void *arg)
virErrorRestore(&err);
error:
- /* Let the source qemu know that the transfer cant continue anymore.
+ /* Let the source qemu know that the transfer can't continue anymore.
* Don't copy the error for EPIPE as destination has the actual error. */
VIR_FORCE_CLOSE(data->sock);
if (!virLastErrorIsSystemErrno(EPIPE))
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 5033cbeabf..4b7e6e4e90 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4340,7 +4340,7 @@ qemuMonitorSetWatchdogAction(qemuMonitorPtr mon,
* @jobname: name of the job
* @props: JSON object describing the blockdev to add
*
- * Instructs qemu to create/format a new stroage or format layer. Note that
+ * Instructs qemu to create/format a new storage or format layer. Note that
* the job does not add the created/formatted image into qemu and
* qemuMonitorBlockdevAdd needs to be called separately with corresponding
* arguments. Note that the arguments for creating and adding are different.
diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c
index e6b5ea3763..a793ae74dd 100644
--- a/src/qemu/qemu_qapi.c
+++ b/src/qemu/qemu_qapi.c
@@ -403,12 +403,12 @@ virQEMUQAPISchemaTraverse(const char *baseName,
* '*subattribute': same as above but the selected member must be optional
* (has a property named 'default' in the schema)
* '+variant": In the case of unionized objects, select a specific variant of
- * the prevously selected member
+ * the previously selected member
*
* - Boolean queries - @entry remains NULL, return value indicates success:
* '^enumval': returns true if the previously selected enum contains 'enumval'
* '!basictype': returns true if previously selected type is of 'basictype'
- * JSON type. Spported are 'null', 'string', 'number', 'value',
+ * JSON type. Supported are 'null', 'string', 'number', 'value',
* 'int' and 'boolean.
* '$feature': returns true if the previously selected type supports 'feature'
* ('feature' is in the 'features' array of given type)
diff --git a/src/qemu/qemu_security.c b/src/qemu/qemu_security.c
index 3b6d6e91f4..f93d189df9 100644
--- a/src/qemu/qemu_security.c
+++ b/src/qemu/qemu_security.c
@@ -455,7 +455,7 @@ qemuSecurityRestoreChardevLabel(virQEMUDriverPtr driver,
* @existstatus: pointer to int returning exit status of process
* @cmdret: pointer to int returning result of virCommandRun
*
- * Start the vhost-user-gpu process with approriate labels.
+ * Start the vhost-user-gpu process with appropriate labels.
* This function returns -1 on security setup error, 0 if all the
* setup was done properly. In case the virCommand failed to run
* 0 is returned but cmdret is set appropriately with the process
diff --git a/src/remote/libvirtd.aug.in b/src/remote/libvirtd.aug.in
index 23a01c41e2..61ea8067b9 100644
--- a/src/remote/libvirtd.aug.in
+++ b/src/remote/libvirtd.aug.in
@@ -91,7 +91,7 @@ module @DAEMON_NAME_UC@ =
| str_entry "host_uuid_source"
| int_entry "ovs_timeout"
- (* Each enty in the config is one of the following three ... *)
+ (* Each entry in the config is one of the following three ... *)
let entry = sock_acl_entry
| authentication_entry
@CUT_ENABLE_IP@
diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index 67b86cff78..85ca78a261 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -1931,7 +1931,7 @@ void *remoteClientNew(virNetServerClientPtr client,
* stateless ones inside libvirt.so). All the interesting
* drivers are in separate daemons. Thus when we get a NULL
* URI we need to simulate probing that virConnectOpen would
- * previously do. We use the existance of the UNIX domain
+ * previously do. We use the existence of the UNIX domain
* socket as our hook for probing.
*
* This assumes no stale sockets left over from a now dead
diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c
index 0a566eaa54..9c0875ef9f 100644
--- a/src/rpc/virnetlibsshsession.c
+++ b/src/rpc/virnetlibsshsession.c
@@ -598,7 +598,7 @@ virNetLibsshAuthenticatePassword(virNetLibsshSessionPtr sess,
VIR_DEBUG("sess=%p", sess);
if (priv->password) {
- /* tunelled password authentication */
+ /* tunnelled password authentication */
if ((rc = ssh_userauth_password(sess->session, NULL,
priv->password)) == 0)
return SSH_AUTH_SUCCESS;
@@ -621,7 +621,7 @@ virNetLibsshAuthenticatePassword(virNetLibsshSessionPtr sess,
sess->hostname)))
return SSH_AUTH_ERROR;
- /* tunelled password authentication */
+ /* tunnelled password authentication */
if ((rc = ssh_userauth_password(sess->session, NULL,
password)) == 0)
return SSH_AUTH_SUCCESS;
diff --git a/src/rpc/virnetserverprogram.c b/src/rpc/virnetserverprogram.c
index 8df92fb8df..f8d7fe85ed 100644
--- a/src/rpc/virnetserverprogram.c
+++ b/src/rpc/virnetserverprogram.c
@@ -354,7 +354,7 @@ int virNetServerProgramDispatch(virNetServerProgramPtr prog,
*
* This method is used to dispatch a message representing an
* incoming method call from a client. It decodes the payload
- * to obtain method call arguments, invokves the method and
+ * to obtain method call arguments, invokes the method and
* then sends a reply packet with the return values
*
* Returns 0 if the reply was sent, or -1 upon fatal error
diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
index b4dea15452..752c3fc915 100644
--- a/src/rpc/virnetsshsession.c
+++ b/src/rpc/virnetsshsession.c
@@ -681,7 +681,7 @@ virNetSSHAuthenticatePassword(virNetSSHSessionPtr sess,
VIR_DEBUG("sess=%p", sess);
if (priv->password) {
- /* tunelled password authentication */
+ /* tunnelled password authentication */
if ((rc = libssh2_userauth_password(sess->session,
priv->username,
priv->password)) == 0) {
@@ -705,7 +705,7 @@ virNetSSHAuthenticatePassword(virNetSSHSessionPtr sess,
sess->hostname)))
goto cleanup;
- /* tunelled password authentication */
+ /* tunnelled password authentication */
if ((rc = libssh2_userauth_password(sess->session,
priv->username,
password)) == 0) {
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 1ec1d13625..666a7a91e8 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -2403,7 +2403,7 @@ virStorageBackendVolUploadLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED,
virCheckFlags(VIR_STORAGE_VOL_UPLOAD_SPARSE_STREAM, -1);
/* if volume has target format VIR_STORAGE_FILE_PLOOP
* we need to restore DiskDescriptor.xml, according to
- * new contents of volume. This operation will be perfomed
+ * new contents of volume. This operation will be performed
* when volUpload is fully finished. */
if (vol->target.format == VIR_STORAGE_FILE_PLOOP) {
/* Fail if the volume contains snapshots or we failed to check it.*/
@@ -2989,7 +2989,7 @@ virStorageBackendBLKIDFindPart(blkid_probe probe,
* however, the blkid_do_probe for "dvh" returns "sgi" and
* for "pc98" it returns "dos". Although "bsd" is recognized,
* it seems that the parted created partition table is not being
- * properly recogized. Since each of these will cause problems
+ * properly recognized. Since each of these will cause problems
* with startup comparison, let's just treat them as UNKNOWN causing
* the caller to fallback to using PARTED */
if (STREQ(format, "dvh") || STREQ(format, "pc98") || STREQ(format, "bsd"))
diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h
index b66b1f2b23..e035135c1c 100644
--- a/src/util/virbuffer.h
+++ b/src/util/virbuffer.h
@@ -39,7 +39,7 @@ typedef virBuffer *virBufferPtr;
* VIR_BUFFER_INIT_CHILD:
* @parentbuf: parent buffer for XML element formatting
*
- * Intitialize a virBuffer structure and set up the indentation level for
+ * Initialize a virBuffer structure and set up the indentation level for
* formatting XML subelements of @parentbuf.
*/
#define VIR_BUFFER_INIT_CHILD(parentbuf) { NULL, (parentbuf)->indent + 2 }
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index aae0ddb730..f87400fc38 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -1426,7 +1426,7 @@ virCommandAddEnvBuffer(virCommandPtr cmd, virBufferPtr buf)
* @name: the name to look up in current environment
*
* Pass an environment variable to the child
- * using current process' value
+ * using current process's value
*/
void
virCommandAddEnvPass(virCommandPtr cmd, const char *name)
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index 818219fbeb..b0f180cd85 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -868,7 +868,7 @@ dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsFlags flag)
*
* Turns a vector of dnsmasqDhcpHost into the string that is ought to be
* stored in the hostsfile, this functionality is split to make hostsfiles
- * testable. Returs NULL if nhosts is 0.
+ * testable. Returns NULL if nhosts is 0.
*/
char *
dnsmasqDhcpHostsToString(dnsmasqDhcpHost *hosts,
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 39bbcf8ca8..c9a9b016a9 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -663,7 +663,7 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo,
* subcore will vary accordingly to 8, 4 and 2 respectively.
* So, On host threads_per_core what is arrived at from sysfs in the
* current logic is actually the subcores_per_core. Threads per subcore
- * can only be obtained from the kvm device. For example, on P8 wih 1
+ * can only be obtained from the kvm device. For example, on P8 with 1
* core having 8 threads, sub_cores_percore=4, the threads 0,2,4 & 6
* will be online. The sysfs reflects this and in the current logic
* variable 'threads' will be 4 which is nothing but subcores_per_core.
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 1d024b8b97..41dc5bd4c4 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1067,7 +1067,7 @@ virNetDevSysfsDeviceFile(char **pf_sysfs_device_link, const char *ifname,
*
* https://www.kernel.org/doc/html/latest/admin-guide/sysfs-rules.html
*
- * Returns true if devpath's susbsystem is pci, false otherwise.
+ * Returns true if devpath's subsystem is pci, false otherwise.
*/
static bool
virNetDevIsPCIDevice(const char *devpath)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index dbb489d174..45fbf3f360 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -35,7 +35,7 @@
VIR_LOG_INIT("util.netdevopenvswitch");
/*
- * Set openvswitch default timout
+ * Set openvswitch default timeout
*/
static unsigned int virNetDevOpenvswitchTimeout = VIR_NETDEV_OVS_DEFAULT_TIMEOUT;
@@ -473,7 +473,7 @@ virNetDevOpenvswitchInterfaceGetMaster(const char *ifname, char **master)
* @path: the path of the unix socket
* @ifname: the retrieved name of the interface
*
- * Retreives the ovs ifname from vhostuser unix socket path.
+ * Retrieves the ovs ifname from vhostuser unix socket path.
*
* Returns: 1 if interface is an openvswitch interface,
* 0 if it is not, but no other error occurred,
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 7bd30ea0f9..c0a7c3019e 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -515,7 +515,7 @@ virNetDevTapAttachBridge(const char *tapname,
* the bridge, or if it is smaller than the current MTU of the
* bridge). If MTU isn't specified for the new device (i.e. 0),
* we need to set the interface MTU to the current MTU of the
- * bridge (to avoid inadvertantly changing the bridge's MTU).
+ * bridge (to avoid inadvertently changing the bridge's MTU).
*/
if (mtu > 0) {
if (virNetDevSetMTU(tapname, mtu) < 0)
diff --git a/src/util/virqemu.c b/src/util/virqemu.c
index 321ddeb7e3..c3626189b9 100644
--- a/src/util/virqemu.c
+++ b/src/util/virqemu.c
@@ -110,7 +110,7 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
/**
- * This array convertor is for quirky cases where the QMP schema mandates an
+ * This array converter is for quirky cases where the QMP schema mandates an
* array of objects with only one attribute 'str' which needs to be formatted as
* repeated key-value pairs without the 'str' being printed:
*
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index e17f6bd1bd..f77adcfd6d 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -1412,7 +1412,7 @@ virResctrlAllocGetID(virResctrlAllocPtr alloc)
*
* MB:0=100;1=100
*
- * which indicates node id 0 has 100 percent bandwith and node id 1
+ * which indicates node id 0 has 100 percent bandwidth and node id 1
* has 100 percent bandwidth. A trailing semi-colon is not formatted.
*/
static int
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index db84339bda..1e993ec53f 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -1002,7 +1002,7 @@ virSysinfoParseOEMStrings(const char *base,
/* If OEM String contains newline, dmidecode escapes it as a dot.
* If this is the case then run dmidecode again to get raw string.
- * Unfortunately, we can't dinstinguish betwen dot an new line at
+ * Unfortunately, we can't dinstinguish between dot an new line at
* this level. */
if (memchr(cur, '.', eol - cur)) {
char *str;
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 1d41ed34f7..9227b7aeba 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -916,7 +916,7 @@ virSystemdActivationNew(virSystemdActivationMap *map,
*
* Acquire an object for handling systemd activation.
* If no activation FDs have been provided the returned object
- * will be NULL, indicating normal sevice setup can be performed
+ * will be NULL, indicating normal service setup can be performed
* If the returned object is non-NULL then at least one file
* descriptor will be present. No normal service setup should
* be performed.
diff --git a/src/util/virtpm.c b/src/util/virtpm.c
index 71c1a2ecb3..1a3b5a05aa 100644
--- a/src/util/virtpm.c
+++ b/src/util/virtpm.c
@@ -89,7 +89,7 @@ virTPMCreateCancelPath(const char *devpath)
/*
* executables for the swtpm; to be found on the host along with
- * capabilties bitmap
+ * capabilities bitmap
*/
static virMutex swtpm_tools_lock = VIR_MUTEX_INITIALIZER;
static char *swtpm_path;
diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h
index 6144714477..8b1fb2ac30 100644
--- a/src/vbox/vbox_common.h
+++ b/src/vbox/vbox_common.h
@@ -34,7 +34,7 @@
* vbox_CAPI_v*.h, or it would cause multiple
* definitions.
*
- * You can see the more informations in vbox_api.h
+ * You can see the more information in vbox_api.h
*/
/* Copied definitions from vbox_CAPI_*.h.
diff --git a/src/vbox/vbox_network.c b/src/vbox/vbox_network.c
index cf273b9a48..dafbc114f6 100644
--- a/src/vbox/vbox_network.c
+++ b/src/vbox/vbox_network.c
@@ -439,7 +439,7 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start)
VBOX_UTF8_TO_UTF16(networkNameUtf8, &networkNameUtf16);
/* Currently support only one dhcp server per network
- * with contigious address space from start to end
+ * with contiguous address space from start to end
*/
addr = ipdef->ranges[0].addr;
if ((ipdef->nranges >= 1) &&
@@ -834,7 +834,7 @@ static char *vboxNetworkGetXMLDesc(virNetworkPtr network, unsigned int flags)
gVBoxAPI.UIDHCPServer.GetLowerIP(dhcpServer, &fromIPAddressUtf16);
gVBoxAPI.UIDHCPServer.GetUpperIP(dhcpServer, &toIPAddressUtf16);
/* Currently virtualbox supports only one dhcp server per network
- * with contigious address space from start to end
+ * with contiguous address space from start to end
*/
addr = ipdef->ranges[0].addr;
if (vboxSocketParseAddrUtf16(data, ipAddressUtf16,
diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c
index 3876955981..5c3269b825 100644
--- a/src/vbox/vbox_snapshot_conf.c
+++ b/src/vbox/vbox_snapshot_conf.c
@@ -877,7 +877,7 @@ virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine,
if (snapshot->nchildren > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("This snapshot has children, "
- "please delete theses snapshots before"));
+ "please delete these snapshots before"));
return -1;
}
@@ -1387,7 +1387,7 @@ virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr machine,
return hardDisk->uuid;
}
-/*Retreive the whole ancestry of the vboxSnapshotXmlHardDiskPtr whose location is
+/*Retrieve the whole ancestry of the vboxSnapshotXmlHardDiskPtr whose location is
*'location', and store them in a newly allocated list of vboxSnapshotXmlHardDiskPtr.
*This list begins with the requested disk, and ends with the farthest ancestor.
*return array length on success, -1 on failure.*/
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index a1a462cc74..a8ffd9f148 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -1556,7 +1556,7 @@ _vrdeServerGetPorts(vboxDriverPtr data, IVRDEServer *VRDEServer,
char *portUtf8 = NULL;
/* get active (effective) port - available only when VM is running and has
- * the VBOX extensions installed (without extenstions RDP server
+ * the VBOX extensions installed (without extensions RDP server
* functionality is disabled)
*/
port = vboxGetActiveVRDEServerPort(data->vboxSession, machine);
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 67bbe27fde..b9130d0902 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -888,7 +888,7 @@ virVMXSCSIDiskNameToControllerAndUnit(const char *name, int *controller, int *un
*controller = idx / 15;
*unit = idx % 15;
- /* Skip the controller ifself at unit 7 */
+ /* Skip the controller itself at unit 7 */
if (*unit >= 7)
++(*unit);
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index d882b91def..8d11719e7a 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -2628,7 +2628,7 @@ vzDomainSnapshotCreateXML(virDomainPtr domain,
if (vzEnsureDomainExists(dom) < 0)
goto cleanup;
- /* snaphot name is ignored, it will be set to auto generated by sdk uuid */
+ /* snapshot name is ignored, it will be set to auto generated by sdk uuid */
if (prlsdkCreateSnapshot(dom, def->parent.description) < 0)
goto cleanup;
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 9cee6f1fde..b5e69b385f 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2073,7 +2073,7 @@ prlsdkNewStateToEvent(VIRTUAL_MACHINE_STATE domainState,
int *lvEventTypeDetails)
{
/* We skip all intermediate states here, because
- * libvirt doesn't have correspoding event types for
+ * libvirt doesn't have corresponding event types for
* them */
switch ((int)domainState) {
case VMS_STOPPED:
@@ -2549,7 +2549,7 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
/*
* Though we don't support NUMA configuration at the moment
* virDomainDefPtr always contain non zero NUMA configuration
- * So, just make sure this configuration does't differ from auto generated.
+ * So, just make sure this configuration doesn't differ from auto generated.
*/
if ((virDomainNumatuneGetMode(def->numa, -1, &memMode) == 0 &&
memMode == VIR_DOMAIN_NUMATUNE_MEM_STRICT) ||
--
2.20.1
4 years, 4 months
[libvirt PATCH] Replace "OS-X" with "macOS" in index.html.in
by Ján Tomko
From: Ryan Schmidt <git(a)ryandesign.com>
Apple changed the operating system's name from "OS X" to "macOS" a few years ago.
Signed-off-by: Ryan Schmidt <git(a)ryandesign.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
docs/index.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/index.html.in b/docs/index.html.in
index 586defff54..20184a7441 100644
--- a/docs/index.html.in
+++ b/docs/index.html.in
@@ -27,7 +27,7 @@
<a href="drvlxc.html">LXC</a>,
<a href="drvbhyve.html">BHyve</a> and
<a href="drivers.html">more</a></li>
- <li>targets Linux, FreeBSD, <a href="windows.html">Windows</a> and OS-X</li>
+ <li>targets Linux, FreeBSD, <a href="windows.html">Windows</a> and macOS</li>
<li>is used by many <a href="apps.html">applications</a></li>
</ul>
<p>Recent / forthcoming <a href="news.html">release changes</a></p>
--
2.25.4
4 years, 4 months
[PULL 00/20] Audio 20200706 patches
by Gerd Hoffmann
The following changes since commit eb6490f544388dd24c0d054a96dd304bc7284450:
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200703' into staging (2020-07-04 16:08:41 +0100)
are available in the Git repository at:
git://git.kraxel.org/qemu tags/audio-20200706-pull-request
for you to fetch changes up to 2336172d9b396b4fa4483712f5560a563c25352f:
audio: set default value for pcspk.iobase property (2020-07-06 17:01:11 +0200)
----------------------------------------------------------------
audio: deprecate -soundhw
----------------------------------------------------------------
Gerd Hoffmann (20):
stubs: add isa_create_simple
stubs: add pci_create_simple
audio: add deprecated_register_soundhw
audio: deprecate -soundhw ac97
audio: deprecate -soundhw es1370
audio: deprecate -soundhw adlib
audio: deprecate -soundhw cs4231a
audio: deprecate -soundhw gus
audio: deprecate -soundhw sb16
audio: deprecate -soundhw hda
pc_basic_device_init: pass PCMachineState
pc_basic_device_init: drop has_pit arg
pc_basic_device_init: drop no_vmport arg
softmmu: initialize spice and audio earlier
audio: rework pcspk_init()
audio: create pcspk device early
audio: deprecate -soundhw pcspk
audio: add soundhw deprecation notice
pcspk: update docs/system/target-i386-desc.rst.inc
audio: set default value for pcspk.iobase property
include/hw/audio/pcspk.h | 12 ++----------
include/hw/audio/soundhw.h | 2 ++
include/hw/i386/pc.h | 6 +++---
hw/audio/ac97.c | 9 ++-------
hw/audio/adlib.c | 8 +-------
hw/audio/cs4231a.c | 8 +-------
hw/audio/es1370.c | 9 ++-------
hw/audio/gus.c | 8 +-------
hw/audio/intel-hda.c | 3 +++
hw/audio/pcspk.c | 26 ++++++++++++++++++++++----
hw/audio/sb16.c | 9 ++-------
hw/audio/soundhw.c | 24 +++++++++++++++++++++++-
hw/i386/pc.c | 14 ++++++++------
hw/i386/pc_piix.c | 3 +--
hw/i386/pc_q35.c | 3 +--
hw/isa/i82378.c | 2 +-
hw/mips/jazz.c | 2 +-
qdev-monitor.c | 2 ++
softmmu/vl.c | 12 ++++++------
stubs/isa-bus.c | 7 +++++++
stubs/pci-bus.c | 7 +++++++
docs/system/deprecated.rst | 9 +++++++++
docs/system/target-i386-desc.rst.inc | 13 ++++++++++++-
stubs/Makefile.objs | 2 ++
24 files changed, 121 insertions(+), 79 deletions(-)
create mode 100644 stubs/isa-bus.c
create mode 100644 stubs/pci-bus.c
--
2.18.4
4 years, 4 months
[PATCH] Change the virtual NICs limit for the ESX driver
by Bastien Orivel
Since the ESX virtual hardware version 4.0, virtual machines support up
to 10 virtual NICs instead of 4 previously. This changes the limit
accordingly based on the provided `virtualHW.version`.
Signed-off-by: Bastien Orivel <bastien.orivel(a)diateam.net>
---
src/vmx/vmx.c | 20 ++++++++++++++------
src/vmx/vmx.h | 2 +-
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 67bbe27fde..afe6fe0a1a 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -290,7 +290,7 @@ def->fss[0]... <=> sharedFolder0.present = "true"
################################################################################
## nets ########################################################################
- ethernet[0..3] -> <controller>
+ ethernet[0..9] -> <controller>
ethernet0.present = "true" # defaults to "false"
ethernet0.startConnected = "true" # defaults to "true"
@@ -3376,7 +3376,7 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe
/* def:nets */
for (i = 0; i < def->nnets; ++i) {
- if (virVMXFormatEthernet(def->nets[i], i, &buffer) < 0)
+ if (virVMXFormatEthernet(def->nets[i], i, &buffer, virtualHW_version) < 0)
goto cleanup;
}
@@ -3732,15 +3732,23 @@ virVMXFormatFileSystem(virDomainFSDefPtr def, int number, virBufferPtr buffer)
int
virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
- virBufferPtr buffer)
+ virBufferPtr buffer, int virtualHW_version)
{
char mac_string[VIR_MAC_STRING_BUFLEN];
unsigned int prefix, suffix;
- if (controller < 0 || controller > 3) {
+ /*
+ * Machines older than virtualHW.version = 7 (ESXi 4.0) only support up to 4
+ * virtual NICs. New machines support up to 10.
+ */
+ int controller_limit = 4;
+ if (virtualHW_version >= 7)
+ controller_limit = 10;
+
+ if (controller < 0 || controller > controller_limit) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Ethernet controller index %d out of [0..3] range"),
- controller);
+ _("Ethernet controller index %d out of [0..%d] range"),
+ controller, controller_limit - 1);
return -1;
}
diff --git a/src/vmx/vmx.h b/src/vmx/vmx.h
index 63f47822fb..7069a50b6e 100644
--- a/src/vmx/vmx.h
+++ b/src/vmx/vmx.h
@@ -131,7 +131,7 @@ int virVMXFormatFileSystem(virDomainFSDefPtr def, int number,
virBufferPtr buffer);
int virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
- virBufferPtr buffer);
+ virBufferPtr buffer, int virtualHW_version);
int virVMXFormatSerial(virVMXContext *ctx, virDomainChrDefPtr def,
virBufferPtr buffer);
--
2.20.1
4 years, 4 months
[PATCH 0/7] consider available CPUs in vcpupin/emulatorpin output
by Daniel Henrique Barboza
Hi,
This series contains 5 cleanups and refactorings I found
on my way to fixing [1]. Last 2 patches contains the actual
fix for the bug.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1434276
Daniel Henrique Barboza (7):
qemu_driver.c: use g_autoptr in qemuDomainGetEmulatorPinInfo()
virhostcpu.c: use g_autoptr in virHostCPUGetMap()
virsh-domain.c: modernize virshVcpuinfoInactive()
virsh-domain.c: modernize cmdVcpuinfo()
virhostcpu.c: refactor virHostCPUParseCountLinux()
virhostcpu.c: introduce virHostCPUGetAvailableCPUsBitmap()
conf, qemu: consider available CPUs in vcpupin/emulatorpin output
src/conf/domain_conf.c | 4 +--
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 10 ++-----
src/util/virhostcpu.c | 63 ++++++++++++++++++++++++----------------
src/util/virhostcpu.h | 2 ++
tools/virsh-domain.c | 44 ++++++++++------------------
6 files changed, 59 insertions(+), 65 deletions(-)
--
2.26.2
4 years, 4 months
[PATCH] docs: kbase: Fix the libvirt-host--validate typo
by Boris Fiuczynski
In f0d0cd61797 I introduced this typo.
Suggested-by: Erik Skultety <eskultet(a)redhat.com>
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
---
docs/kbase/s390_protected_virt.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/kbase/s390_protected_virt.rst b/docs/kbase/s390_protected_virt.rst
index f38d16d743..1718a556d4 100644
--- a/docs/kbase/s390_protected_virt.rst
+++ b/docs/kbase/s390_protected_virt.rst
@@ -57,7 +57,7 @@ or an IBM LinuxONE III (or newer).
It is also necessary that the IBM Secure Execution feature is
enabled for that system. With libvirt >= 6.5.0 you can run
-``libvirt-host--validate`` or otherwise check for facility '158', e.g.
+``virt-host-validate`` or otherwise check for facility '158', e.g.
::
--
2.25.1
4 years, 4 months
How to best handle NULL return from xmlNodeGetContent()
by Laine Stump
libvirt has several uses of xmlNodeGetContent() (from libxml2) added at
different times over the years. Some of those uses report an Out of
Memory error when xmlNodeGetContent() returns NULL, and some of them
ignore a NULL return (treating it as if it were ""), and some just
assume that the return will never be NULL, but always at least a pointer
to "".
I ran across this when I noticed a usage of the latter type - it wasn't
checking for NULL at all. A lack of check seemed troubling, so I looked
at other uses within libvirt and found the hodge-podge described above,
so no help there in determining the right thing to do. I then looked at
the libxml2 documentation for xmlNodeGetContent(), which says:
Returns: a new #xmlChar * or NULL if no content is available.
To an uninformed outsider, this sounds like the function could return
NULL simply if the node was empty (e.g. "<wwn/>"). But when we look at
the return from xmlNodeGetContent() for this example, it says that the
content is "", not NULL.
In the meantime, since libxml doesn't abort on OOM errors (as libvirt
does), it could also be possible that it's returning NULL due to OOM. So
using anecdotal evidence acquired so far, one *could* surmise that any
time libvirt gets a NULL return from xmlNodeGetContent(), it is indeed
an OOM error.
The purist in me thinks that isn't right, though - I took a quick look
at the libxml code and saw cases where it returns NULL that don't seem
related to OOM, but rather to the type of node or something. But being
an outsider and not wanting to learn any more than necessary about the
internals of libxml, I'm not sure if any of those cases even apply to
libvirt's simple use of xmlNodeGetContent().
So, in the end I just want to modify libvirt's dozen or so calls to
xmlNodeGetContent() to consistently do the right thing, but first I want
to learn the true answers to these questions:
1) Keeping in mind that we've already successfully parsed the XML, will
calls to xmlNodeGetContent() in the simple cases as when libvirt calls
it only return NULL for OOM, but not for any other reason?
2) If not, is the proper way to distinguish OOM in this case to call
xmlGetLasterror(), and check if the domain is XML_FROM_MEMORY?
3) Aside from returning NULL in the case of errors, would it ever be
possible for correct XML to return NULL as valid "node content", or is
it always an error of some kind?
Since libvirt now aborts on OOM, an OOM error could be handled in one
place by a wrapper function around xmlNodeGetContent() (we already have
such a function, currently a one-liner passthrough, and not called by
everyone). But if there is any chance that any other libxml error could
be encountered, then I suppose we really should be reporting those
without aborting, and then still checking for NULL on return from the
wrapper function (presumably by just logging the contents of "message"
from the xmlErrorPtr returned from xmlGetLastError().
4 years, 4 months
[PATCH v4 0/3] tpm: Fix default choices for CRB and SPAPR dev models
by Stefan Berger
From: Stefan Berger <stefanb(a)linux.ibm.com>
This series of patches adds an additional check for the SPAPR device model
that prevents the choice of a TPM 1.2 backend and chooses a TPM 2 as default.
Also CRB now chooses a TPM 2 as default since TPM 1.2 wouldn't work with it,
either.
Stefan
Stefan Berger (3):
qemu: Move setting of TPM default to post parse function
qemu: Set SPAPR TPM default to 2.0 and prevent 1.2 choice
qemu: Choose TPM 2 for backend as default for CRB interface
src/qemu/qemu_domain.c | 12 +++++++++---
src/qemu/qemu_validate.c | 10 ++++++----
2 files changed, 15 insertions(+), 7 deletions(-)
--
2.17.1
4 years, 4 months