]> git.ipfire.org Git - thirdparty/libvirt.git/commit
include: define constants for resetting NVRAM state
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 3 Feb 2022 15:58:54 +0000 (15:58 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 8 Feb 2022 13:04:11 +0000 (13:04 +0000)
commit12a658ecf7481c2632025c9956555e85e0f43353
tree3d3d37dfccd4f52ed411cdcdb359f5fe9b5e6b6d
parent5e3498744ed28a224edf5ab08dfbb5674e4470d4
include: define constants for resetting NVRAM state

When starting a guest with pflash based firmware, we will initialize
NVRAM from a template if it does not already exist. In theory if the
firmware code file is updated, the existing NVRAM variables should
continue to work correctly. It is inevitable that this could break
accidentally one day. Or a bug in the firmware might corrupt the
NVRAM storage. Or user might make bad changes to the settings that
prevent booting. Or the user might have re-configured the XML to
point to a different firmware file incompatible with the current
variables.

In all these cases it would be useful to delete the existing NVRAM
and initialize it from the pristine template.

To support this introduce a VIR_DOMAIN_START_RESET_NVRAM constant
for use with virDomainCreate / virDomainCreateXML, along with
VIR_DOMAIN_SAVE_RESET_NVRAM for use with virDomainRestore and
VIR_DOMAIN_SNAPSHOT_REVERT_RESET_NVRAM for use with
virDomainSnapshotRevert.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
include/libvirt/libvirt-domain-snapshot.h
include/libvirt/libvirt-domain.h
src/libvirt-domain-snapshot.c
src/libvirt-domain.c