Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DC/cluster level 4.8 and qcow2 discard-no-unref flag #938

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,9 @@ public enum ConfigValues {
@TypeConverterAttribute(Boolean.class)
IsDedicatedSupported,

@TypeConverterAttribute(Boolean.class)
EnableQemuDiscardNoUnref,

Invalid;

private ClientAccessLevel accessLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class VersionStorageFormatUtil {
versionToFormat.put(Version.v4_5, StorageFormatType.V5);
versionToFormat.put(Version.v4_6, StorageFormatType.V5);
versionToFormat.put(Version.v4_7, StorageFormatType.V5);
versionToFormat.put(Version.v4_8, StorageFormatType.V5);
};

private static final Map<StorageFormatType, Version> earliestVersionSupported = new TreeMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public class Version implements Comparable<Version>, Serializable {
public static final Version v4_5 = new Version(4, 5);
public static final Version v4_6 = new Version(4, 6);
public static final Version v4_7 = new Version(4, 7);
public static final Version v4_8 = new Version(4, 8);
public static final List<Version> ALL =
Collections.unmodifiableList(Arrays.asList(v4_2, v4_3, v4_4, v4_5, v4_6, v4_7));
Collections.unmodifiableList(Arrays.asList(v4_2, v4_3, v4_4, v4_5, v4_6, v4_7, v4_8));
public static final int VERSION_NOT_SET = -1;

public Version(String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2291,6 +2291,9 @@ private void writeDiskDriver(VmDevice device, Disk disk, DiskVmElement dve, int
writer.writeAttributeString("name", "qemu");
if (dve.isPassDiscard()) {
writer.writeAttributeString("discard", "unmap");
if ((boolean) Config.getValue(ConfigValues.EnableQemuDiscardNoUnref, vm.getClusterCompatibilityVersion().toString())) {
writer.writeAttributeString("discard_no_unref", "on");
}
}
if (pinTo > 0) {
writer.writeAttributeString("iothread", String.valueOf(pinTo));
Expand Down
2 changes: 1 addition & 1 deletion packaging/dbscripts/common_sp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ RETURNS VARCHAR [] AS $FUNCTION$
BEGIN

RETURN
ARRAY ['4.2', '4.3', '4.4', '4.5', '4.6', '4.7'];
ARRAY ['4.2', '4.3', '4.4', '4.5', '4.6', '4.7', '4.8'];

END;$FUNCTION$
LANGUAGE plpgsql;
Expand Down
176 changes: 122 additions & 54 deletions packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packaging/etc/engine-config/engine-config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,6 @@ CertExpirationWarnPeriodInDays.description=Number of days to issue warnings befo
CertExpirationWarnPeriodInDays.type=Integer
VdsCertificateValidityInDays.description=Number of days which the hypervisor certificate is valid for.
VdsCertificateValidityInDays.type=Integer
# Discard no Unref
EnableQemuDiscardNoUnref.description=Enable the QEMU discard-no-unref feature.
EnableQemuDiscardNoUnref.type=Boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you anticipate that users would want to enable/disable this feature manually using engine-config? If not, then you don't need to put it here

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _init(self):
)
self.environment.setdefault(
osetupcons.CoreEnv.UPGRADE_SUPPORTED_VERSIONS,
'4.2,4.3,4.4,4.5,4.6,4.7'
'4.2,4.3,4.4,4.5,4.6,4.7,4.8'
)

self.logger.debug(
Expand Down