summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorSimon Rettberg2023-07-27 15:57:42 +0200
committerSimon Rettberg2023-07-27 15:57:42 +0200
commit38ecf663bd4026d147b6ab730b484e8af5f89aad (patch)
treec492cd3e63190125d868828355475dab7dab122f /src/main/java
parent[libvirt] Fix expression: Wrong variable used (diff)
downloadmaster-sync-shared-38ecf663bd4026d147b6ab730b484e8af5f89aad.tar.gz
master-sync-shared-38ecf663bd4026d147b6ab730b484e8af5f89aad.tar.xz
master-sync-shared-38ecf663bd4026d147b6ab730b484e8af5f89aad.zip
[virt] Add check if VM is suspended (VMware only currently)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java14
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java7
2 files changed, 17 insertions, 4 deletions
diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java
index d4b3058..f548597 100644
--- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java
+++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java
@@ -129,14 +129,22 @@ public abstract class VirtualizationConfiguration
return displayName;
}
- /*
- * Getter for isMachineSnapshot
- */
public boolean isMachineSnapshot()
{
return isMachineSnapshot;
}
+ /**
+ * Return name of file that indicates this VM is currently suspended.
+ * The existence of this file means the VM is currently suspended.
+ * Can be null if this virtualizer doesn't support suspension, or if
+ * it's already known the VM is not in a suspended state.
+ */
+ public String getSuspendedFile()
+ {
+ return null;
+ }
+
private class VersionOption extends VirtOptionValue {
private final Version version;
diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java
index a237674..107014f 100644
--- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java
+++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java
@@ -139,7 +139,6 @@ public class VirtualizationConfigurationVmware extends VirtualizationConfigurati
removeEntriesStartingWith( controllerType + ":" + deviceId + "." );
}
}
- // TODO check if this machine is in a paused/suspended state
this.isMachineSnapshot = false;
// Add HDD to cleaned vmx
@@ -733,4 +732,10 @@ public class VirtualizationConfigurationVmware extends VirtualizationConfigurati
{
new VmWareUsbSpeed( 0, Usb.NONE ).apply();
}
+
+ @Override
+ public String getSuspendedFile()
+ {
+ return config.get( "checkpoint.vmState" );
+ }
}