Francesco Romani has uploaded a new change for review.

Change subject: backend: enable virtio serial console
......................................................................

backend: enable virtio serial console

Enhance the Console Device configuration by providing the flag
that instruct VDSM to bind the vm virtual serial console to an Unix
Domain Socket.

This patch enables the last link to make the Serial Console
feature to actually work.

We inconditionally do this way because this one being implemented
was the original intent of the console device proper, so it doesn't
make much sense to have different operational mode for Console Devices.

Feature wiki page: http://www.ovirt.org/Features/Serial_Console

Bug-Url: https://bugzilla.redhat.com/1223671
Change-Id: I70b7f43b0b59bc9a038e1199859967b49cade856
Signed-off-by: Francesco Romani <from...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
2 files changed, 13 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/51/42151/4

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
index a0157b1..4732663 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
@@ -49,6 +49,7 @@
     public static final String selinux_mode = "mode";
     public static final String numOfIoThreads = "numOfIoThreads";
     public static final String pinToIoThread = "pinToIoThread";
+    public static final String virtioSerialConsoleEnabled = "enableSocket";
 
     // vds runtime (i.e. VdsDynamic req getVdsStats)
     public static final String netConfigDirty = "netConfigDirty";
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
index 8103f62..79143d6 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java
@@ -155,7 +155,7 @@
      */
     private void buildVmGraphicsDevicesFromDb(boolean usesGraphicsAsDevice) {
         if (usesGraphicsAsDevice) {
-            buildVmDevicesFromDb(VmDeviceGeneralType.GRAPHICS, false);
+            buildVmDevicesFromDb(VmDeviceGeneralType.GRAPHICS, false, null);
         }
 
         String legacyDisplay = deriveDisplayTypeLegacy();
@@ -575,15 +575,18 @@
 
     @Override
     protected void buildVmSoundDevices() {
-        buildVmDevicesFromDb(VmDeviceGeneralType.SOUND, true);
+        buildVmDevicesFromDb(VmDeviceGeneralType.SOUND, true, null);
     }
 
     @Override
     protected void buildVmConsoleDevice() {
-        buildVmDevicesFromDb(VmDeviceGeneralType.CONSOLE, false);
+        Map<String, Object> specParams = new HashMap<>();
+        specParams.put(VdsProperties.virtioSerialConsoleEnabled, true);
+
+        buildVmDevicesFromDb(VmDeviceGeneralType.CONSOLE, false, specParams);
     }
 
-    private void buildVmDevicesFromDb(VmDeviceGeneralType generalType, boolean 
addAddress) {
+    private void buildVmDevicesFromDb(VmDeviceGeneralType generalType, boolean 
addAddress, Map<String, Object> extraSpecParams) {
         List<VmDevice> vmDevices =
                 DbFacade.getInstance()
                         .getVmDeviceDao()
@@ -594,7 +597,11 @@
             Map struct = new HashMap();
             struct.put(VdsProperties.Type, vmDevice.getType().getValue());
             struct.put(VdsProperties.Device, vmDevice.getDevice());
-            struct.put(VdsProperties.SpecParams, vmDevice.getSpecParams());
+            Map<String, Object> specParams = vmDevice.getSpecParams();
+            if (extraSpecParams != null) {
+                specParams.putAll(extraSpecParams);
+            }
+            struct.put(VdsProperties.SpecParams, specParams);
             struct.put(VdsProperties.DeviceId, 
String.valueOf(vmDevice.getId().getDeviceId()));
             if (addAddress) {
                 addAddress(vmDevice, struct);


-- 
To view, visit https://gerrit.ovirt.org/42151
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70b7f43b0b59bc9a038e1199859967b49cade856
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Vitor de Lima <vdel...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to