提交 fa3b5107 编写于 作者: M Michal Privoznik

qemuDomainSnapshotPrepare: Don't always assume vm->def->os.loader

In 9e246583 a check that denies internal snapshots when pflash
based loader is configured for the domain. However, if there's
none and an user tries to do an internal snapshot they will
witness daemon crash as in that case vm->def->os.loader is NULL
and we dereference it unconditionally.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 385c1cc9
...@@ -13889,6 +13889,7 @@ qemuDomainSnapshotPrepare(virConnectPtr conn, ...@@ -13889,6 +13889,7 @@ qemuDomainSnapshotPrepare(virConnectPtr conn,
* Avoid the issues by forbidding internal snapshot with pflash completely. * Avoid the issues by forbidding internal snapshot with pflash completely.
*/ */
if (found_internal && if (found_internal &&
vm->def->os.loader &&
vm->def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH) { vm->def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("internal snapshots of a VM with pflash based " _("internal snapshots of a VM with pflash based "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册