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

core: Use virtio-vga driver for VGA #515

Merged
merged 1 commit into from
Jul 13, 2022
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 @@ -445,4 +445,14 @@ public static boolean isDedicatePolicySupported(Version version) {
public static boolean isReplicateExtendSupported(Version version) {
return Version.v4_7.lessOrEquals(version);
}

/**
* Check 'virtio' driver for 'vga' display type is supported.
*
* @param version Compatibility version to check for.
* @return true if 'virtio' driver is supported
*/
public static boolean isVirtioVgaSupported(Version version) {
return supportedInConfig(ConfigValues.VirtioVgaSupported, version);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,9 @@ public enum ConfigValues {
@TypeConverterAttribute(Boolean.class)
EnableBochsDisplay,

@TypeConverterAttribute(Boolean.class)
VirtioVgaSupported,

@TypeConverterAttribute(Integer.class)
HostMonitoringWatchdogIntervalInSeconds,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3014,7 +3014,7 @@ void writeVideo(VmDevice device) {
if (mdevDisplayOn) {
writer.writeAttributeString("type", "none");
} else {
writer.writeAttributeString("type", device.getDevice());
writer.writeAttributeString("type", getVideoType(device.getDevice()));
smelamud marked this conversation as resolved.
Show resolved Hide resolved
Object vram = device.getSpecParams().get(VdsProperties.VIDEO_VRAM);
writer.writeAttributeString("vram", vram != null ? vram.toString() : "32768");
Object heads = device.getSpecParams().get(VdsProperties.VIDEO_HEADS);
Expand All @@ -3033,6 +3033,13 @@ void writeVideo(VmDevice device) {
writer.writeEndElement();
}

private String getVideoType(String deviceType) {
if (!deviceType.equals("vga")) {
return deviceType;
}
return FeatureSupported.isVirtioVgaSupported(vm.getCompatibilityVersion()) && !legacyVirtio ? "virtio" : "vga";
}

private void writeDefaultVideo() {
writer.writeStartElement("video");
writer.writeStartElement("model");
Expand Down
2 changes: 2 additions & 0 deletions packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,8 @@ select fn_db_add_config_value_for_versions_up_to('NvramPersistenceSupported', 'f
select fn_db_add_config_value_for_versions_up_to('NvramPersistenceSupported', 'true', '4.7');
select fn_db_add_config_value_for_versions_up_to('EnableBochsDisplay','false','4.5');
select fn_db_add_config_value_for_versions_up_to('EnableBochsDisplay','true','4.7');
select fn_db_add_config_value_for_versions_up_to('VirtioVgaSupported','false','4.6');
select fn_db_add_config_value_for_versions_up_to('VirtioVgaSupported','true','4.7');
select fn_db_add_config_value_for_versions_up_to('ParallelMigrationsSupported', 'false', '4.6');
select fn_db_add_config_value_for_versions_up_to('ParallelMigrationsSupported', 'true', '4.7');
select fn_db_add_config_value_for_versions_up_to('IsDedicatedSupported', 'false', '4.6');
Expand Down
2 changes: 2 additions & 0 deletions packaging/etc/engine-config/engine-config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ NvramPersistenceSupported.description=Enable/Disable NVRAM data persistence.
NvramPersistenceSupported.type=Boolean
EnableBochsDisplay.type=Boolean
EnableBochsDisplay.description=Enable bochs display type support
VirtioVgaSupported.type=Boolean
VirtioVgaSupported.description=Enable virtio-vga driver usage for VGA displays.
# Host monitoring watchdog
HostMonitoringWatchdogIntervalInSeconds.type=Integer
HostMonitoringWatchdogIntervalInSeconds.description="Host monitoring watchdog service interval to check if host monitoring is running."
Expand Down