mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
nodesuspend: report unsupported if systemd & pm-utils aren't available
When libvirtd is run inside a container it is normal that neither systemd nor pm-utils will be available. In this case there is no way to suspend the host, so libvirt should just report the feature unsupported instead of raising an error. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
7a232286b9
commit
0c1e035085
@ -330,11 +330,10 @@ virNodeSuspendSupportsTarget(unsigned int target, bool *supported)
|
||||
if (ret == -2)
|
||||
ret = virNodeSuspendSupportsTargetPMUtils(target, supported);
|
||||
|
||||
/* If still unavailable, then report error */
|
||||
/* If still unavailable, then report unsupported */
|
||||
if (ret == -2) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Cannot probe for supported suspend types"));
|
||||
ret = -1;
|
||||
*supported = false;
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user