summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-02-03 15:58:54 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2022-02-08 13:04:11 +0000
commit12a658ecf7481c2632025c9956555e85e0f43353 (patch)
tree3d3d37dfccd4f52ed411cdcdb359f5fe9b5e6b6d /include
parent5e3498744ed28a224edf5ab08dfbb5674e4470d4 (diff)
downloadlibvirt-12a658ecf7481c2632025c9956555e85e0f43353.tar.gz
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>
Diffstat (limited to 'include')
-rw-r--r--include/libvirt/libvirt-domain-snapshot.h1
-rw-r--r--include/libvirt/libvirt-domain.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/libvirt/libvirt-domain-snapshot.h b/include/libvirt/libvirt-domain-snapshot.h
index 90673ed0fb..d729d1a532 100644
--- a/include/libvirt/libvirt-domain-snapshot.h
+++ b/include/libvirt/libvirt-domain-snapshot.h
@@ -198,6 +198,7 @@ typedef enum {
VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING = 1 << 0, /* Run after revert */
VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED = 1 << 1, /* Pause after revert */
VIR_DOMAIN_SNAPSHOT_REVERT_FORCE = 1 << 2, /* Allow risky reverts */
+ VIR_DOMAIN_SNAPSHOT_REVERT_RESET_NVRAM = 1 << 3, /* Re-initialize NVRAM from template */
} virDomainSnapshotRevertFlags;
/* Revert the domain to a point-in-time snapshot. The
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 374859fdff..8c16598817 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -302,6 +302,7 @@ typedef enum {
VIR_DOMAIN_START_BYPASS_CACHE = 1 << 2, /* Avoid file system cache pollution */
VIR_DOMAIN_START_FORCE_BOOT = 1 << 3, /* Boot, discarding any managed save */
VIR_DOMAIN_START_VALIDATE = 1 << 4, /* Validate the XML document against schema */
+ VIR_DOMAIN_START_RESET_NVRAM = 1 << 5, /* Re-initialize NVRAM from template */
} virDomainCreateFlags;
@@ -1268,6 +1269,7 @@ typedef enum {
VIR_DOMAIN_SAVE_BYPASS_CACHE = 1 << 0, /* Avoid file system cache pollution */
VIR_DOMAIN_SAVE_RUNNING = 1 << 1, /* Favor running over paused */
VIR_DOMAIN_SAVE_PAUSED = 1 << 2, /* Favor paused over running */
+ VIR_DOMAIN_SAVE_RESET_NVRAM = 1 << 3, /* Re-initialize NVRAM from template */
} virDomainSaveRestoreFlags;
int virDomainSave (virDomainPtr domain,