[Spice-commits] 2 commits - common/vdcommon.cpp common/vdcommon.h vdagent/desktop_layout.cpp vdagent/desktop_layout.h vdagent/vdagent.vcproj vdservice/vdservice.cpp vdservice/vdservice.vcproj

Arnon Gilboa agilboa at kemper.freedesktop.org
Tue Nov 9 10:54:53 PST 2010


 common/vdcommon.cpp        |   19 -------------------
 common/vdcommon.h          |    2 --
 vdagent/desktop_layout.cpp |   19 ++++++++++++++++++-
 vdagent/desktop_layout.h   |    1 +
 vdagent/vdagent.vcproj     |    8 --------
 vdservice/vdservice.cpp    |   31 ++-----------------------------
 vdservice/vdservice.vcproj |    4 ----
 7 files changed, 21 insertions(+), 63 deletions(-)

New commits:
commit 875cc052921f7d8f613f62e72eac920c3ce2bf9f
Author: Arnon Gilboa <agilboa at redhat.com>
Date:   Tue Nov 9 20:52:52 2010 +0200

    Revert "vdservice: add missing vdcommon.cpp"
    
    This reverts commit 53b32d4db33af4422382fbe629bb0314e252bdda which becomes irrelevant due to previous revert.

diff --git a/common/vdcommon.cpp b/common/vdcommon.cpp
deleted file mode 100644
index 372d9bb..0000000
--- a/common/vdcommon.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "vdcommon.h"
-
-bool get_qxl_device_id(TCHAR* device_key, DWORD* device_id)
-{
-    DWORD type = REG_BINARY;
-    DWORD size = sizeof(*device_id);
-    bool key_found = false;
-    HKEY key;
-
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, wcsstr(device_key, L"System"),
-                     0L, KEY_QUERY_VALUE, &key) == ERROR_SUCCESS) {
-        if (RegQueryValueEx(key, L"QxlDeviceID", NULL, &type, (LPBYTE)device_id, &size) ==
-                                                                             ERROR_SUCCESS) {
-            key_found = true;
-        }
-        RegCloseKey(key);
-    }
-    return key_found;
-}
commit 35d1b7c835561d44f631e2e1777a13b3573c3ccf
Author: Arnon Gilboa <agilboa at redhat.com>
Date:   Tue Nov 9 20:50:21 2010 +0200

    Revert "vdservice: don't start when no qxl device present"
    
    This reverts commit 349e6a5bf8804b25c3af6e1f439122a7cc269cc2 which breaks vsdervice on Windows 7

diff --git a/common/vdcommon.h b/common/vdcommon.h
index 24d18d6..1097720 100644
--- a/common/vdcommon.h
+++ b/common/vdcommon.h
@@ -63,7 +63,5 @@ typedef struct VDPipeState {
     VDPipeBuffer read;
 } VDPipeState;
 
-bool get_qxl_device_id(TCHAR* device_key, DWORD* device_id);
-
 #endif
 
diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp
index b7a6b9c..32502bc 100644
--- a/vdagent/desktop_layout.cpp
+++ b/vdagent/desktop_layout.cpp
@@ -17,7 +17,6 @@
 
 #include "desktop_layout.h"
 #include "vdlog.h"
-#include "vdcommon.h"
 
 void DisplayMode::set_res(DWORD width, DWORD height, DWORD depth)
 {
@@ -156,6 +155,24 @@ bool DesktopLayout::is_attached(LPCTSTR dev_name)
     return !!dev_mode.dmBitsPerPel;
 }
 
+bool DesktopLayout::get_qxl_device_id(WCHAR* device_key, DWORD* device_id)
+{
+    DWORD type = REG_BINARY;
+    DWORD size = sizeof(*device_id);
+    bool key_found = false;
+    HKEY key;
+
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, wcsstr(device_key, L"System"),
+                     0L, KEY_QUERY_VALUE, &key) == ERROR_SUCCESS) {
+        if (RegQueryValueEx(key, L"QxlDeviceID", NULL, &type, (LPBYTE)device_id, &size) ==
+                                                                             ERROR_SUCCESS) {
+            key_found = true;
+        }
+        RegCloseKey(key);
+    }
+    return key_found;
+}
+
 void DesktopLayout::init_dev_mode(DEVMODE* dev_mode, DisplayMode* mode, bool set_pos)
 {
     ZeroMemory(dev_mode, sizeof(DEVMODE));
diff --git a/vdagent/desktop_layout.h b/vdagent/desktop_layout.h
index fe70e36..a43ee49 100644
--- a/vdagent/desktop_layout.h
+++ b/vdagent/desktop_layout.h
@@ -72,6 +72,7 @@ public:
 private:
     void clean_displays();
     static bool is_attached(LPCTSTR dev_name);
+    static bool get_qxl_device_id(WCHAR* device_key, DWORD* device_id);
     static void init_dev_mode(DEVMODE* dev_mode, DisplayMode* mode, bool set_pos);
 
 private:
diff --git a/vdagent/vdagent.vcproj b/vdagent/vdagent.vcproj
index ec703a5..0453c12 100644
--- a/vdagent/vdagent.vcproj
+++ b/vdagent/vdagent.vcproj
@@ -352,10 +352,6 @@
 				RelativePath="..\common\vdlog.cpp"
 				>
 			</File>
-			<File
-				RelativePath="..\common\vdcommon.cpp"
-				>
-			</File>
 		</Filter>
 		<Filter
 			Name="Header Files"
@@ -382,10 +378,6 @@
 				RelativePath="..\common\vdlog.h"
 				>
 			</File>
-			<File
-				RelativePath="..\common\vdcommon.cpp"
-				>
-			</File>
 		</Filter>
 		<Filter
 			Name="Resource Files"
diff --git a/vdservice/vdservice.cpp b/vdservice/vdservice.cpp
index 1e63694..ae5ad87 100644
--- a/vdservice/vdservice.cpp
+++ b/vdservice/vdservice.cpp
@@ -140,27 +140,6 @@ int supported_system_version()
     return 0;
 }
 
-bool has_qxl_device()
-{
-    DISPLAY_DEVICE dev_info;
-    bool ret = false;
-    DWORD dev_id = 0;
-    DWORD qxl_id;
-
-    ZeroMemory(&dev_info, sizeof(dev_info));
-    dev_info.cb = sizeof(dev_info);
-    while (EnumDisplayDevices(NULL, dev_id, &dev_info, 0)) {
-        if (wcsstr(dev_info.DeviceString, L"QXL") != NULL
-            && get_qxl_device_id(dev_info.DeviceKey, &qxl_id)) {
-            vd_printf("found QXL device at id %d, qxl_id %d", dev_id, qxl_id);
-            ret = true;
-            break;
-        }
-        dev_id++;
-    }
-    return ret;
-}
-
 VDService::VDService()
     : _status_handle (0)
     , _vdi_port (NULL)
@@ -359,10 +338,8 @@ VOID WINAPI VDService::main(DWORD argc, TCHAR* argv[])
         swprintf_s(log_path, MAX_PATH, VD_SERVICE_LOG_PATH, temp_path);
         s->_log = VDLog::get(log_path);
     }
-
     vd_printf("***Service started***");
     log_version();
-
     if (!SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS)) {
         vd_printf("SetPriorityClass failed %u", GetLastError());
     }
@@ -392,12 +369,8 @@ VOID WINAPI VDService::main(DWORD argc, TCHAR* argv[])
     status->dwCurrentState = SERVICE_RUNNING;
     SetServiceStatus(s->_status_handle, status);
 
-    if (has_qxl_device()) {
-        s->_running = true;
-        s->execute();
-    } else {
-        vd_printf("didn't find any qxl devices\n");
-    }
+    s->_running = true;
+    s->execute();
 
     // service was stopped
     status->dwCurrentState = SERVICE_STOP_PENDING;
diff --git a/vdservice/vdservice.vcproj b/vdservice/vdservice.vcproj
index e23d235..32ec7c8 100644
--- a/vdservice/vdservice.vcproj
+++ b/vdservice/vdservice.vcproj
@@ -375,10 +375,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\common\vdcommon.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\vdservice.cpp"
 				>
 			</File>


More information about the Spice-commits mailing list