mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virDomainRestoreFlags: Require VIR_DOMAIN_SAVE_PARAM_FILE for now
Calling virDomainRestoreFlags() with no typed params results in an error in open() because it tries to open a NULL path. Obviously, this is wrong and path to restore from must be provided, at least for now until other sources of restore are introduced. Then this limitation can be relaxed. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
f4e2910552
commit
af1933713b
@ -1190,7 +1190,9 @@ virDomainRestoreFlags(virConnectPtr conn, const char *from, const char *dxml,
|
||||
* @nparams: number of restore parameters
|
||||
* @flags: bitwise-OR of virDomainSaveRestoreFlags
|
||||
*
|
||||
* This method extends virDomainRestoreFlags by adding parameters.
|
||||
* This method extends virDomainRestoreFlags by adding parameters. For
|
||||
* now, VIR_DOMAIN_SAVE_PARAM_FILE is required but this requirement may
|
||||
* be lifted in the future.
|
||||
*
|
||||
* Returns 0 in case of success and -1 in case of failure.
|
||||
*
|
||||
|
@ -5967,6 +5967,12 @@ qemuDomainRestoreParams(virConnectPtr conn,
|
||||
VIR_DOMAIN_SAVE_PARAM_DXML, &dxml) < 0)
|
||||
return -1;
|
||||
|
||||
if (!path) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("missing path to restore from"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = qemuDomainRestoreInternal(conn, path, dxml, flags,
|
||||
virDomainRestoreParamsEnsureACL);
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user