qemu: domain: Add 'errmsg' field to qemuDomainJobInfo

The field can be used by jobs to add an optional error message to a
completed (failed) job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Peter Krempa 2020-04-16 11:21:51 +02:00
parent 4f39774610
commit 75a66f1076
2 changed files with 5 additions and 0 deletions

View File

@ -308,6 +308,7 @@ qemuDomainDisableNamespace(virDomainObjPtr vm,
void
qemuDomainJobInfoFree(qemuDomainJobInfoPtr info)
{
g_free(info->errmsg);
g_free(info);
}
@ -319,6 +320,8 @@ qemuDomainJobInfoCopy(qemuDomainJobInfoPtr info)
memcpy(ret, info, sizeof(*info));
ret->errmsg = g_strdup(info->errmsg);
return ret;
}

View File

@ -175,6 +175,8 @@ struct _qemuDomainJobInfo {
qemuDomainBackupStats backup;
} stats;
qemuDomainMirrorStats mirrorStats;
char *errmsg; /* optional error message for failed completed jobs */
};
void