aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
Diffstat (limited to 'qga')
-rw-r--r--qga/commands-win32.c6
-rw-r--r--qga/meson.build55
-rw-r--r--qga/vss-win32/install.cpp2
-rw-r--r--qga/vss-win32/meson.build52
-rw-r--r--qga/vss-win32/provider.cpp4
-rw-r--r--qga/vss-win32/qga-vss.tlbbin1528 -> 0 bytes
-rw-r--r--qga/vss-win32/requester.cpp4
-rw-r--r--qga/vss-win32/vss-common.h6
8 files changed, 82 insertions, 47 deletions
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 484cb1c6bd..4fbbad793f 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -18,7 +18,7 @@
#include <ws2tcpip.h>
#include <iptypes.h>
#include <iphlpapi.h>
-#ifdef CONFIG_QGA_NTDDSCSI
+#ifdef HAVE_NTDDSCSI
#include <winioctl.h>
#include <ntddscsi.h>
#endif
@@ -474,7 +474,7 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
}
}
-#ifdef CONFIG_QGA_NTDDSCSI
+#ifdef HAVE_NTDDSCSI
static GuestDiskBusType win2qemu[] = {
[BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
@@ -1111,7 +1111,7 @@ GuestDiskInfoList *qmp_guest_get_disks(Error **errp)
return NULL;
}
-#endif /* CONFIG_QGA_NTDDSCSI */
+#endif /* HAVE_NTDDSCSI */
static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
{
diff --git a/qga/meson.build b/qga/meson.build
index 1ee9dca60b..54f2da5b07 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -1,3 +1,33 @@
+if not have_ga
+ if get_option('guest_agent_msi').enabled()
+ error('Guest agent MSI requested, but the guest agent is not being built')
+ endif
+ have_qga_vss = false
+ subdir_done()
+endif
+
+have_qga_vss = get_option('qga_vss') \
+ .require(targetos == 'windows',
+ error_message: 'VSS support requires Windows') \
+ .require(link_language == 'cpp',
+ error_message: 'VSS support requires a C++ compiler') \
+ .require(have_vss, error_message: '''VSS support requires VSS headers.
+ If your Visual Studio installation doesn't have the VSS headers,
+ Please download and install Microsoft VSS SDK:
+ http://www.microsoft.com/en-us/download/details.aspx?id=23490
+ On POSIX-systems, MinGW doesn't yet provide working headers.
+ you can extract the SDK headers by:
+ $ scripts/extract-vsssdk-headers setup.exe
+ The headers are extracted in the directory 'inc/win2003'.
+ Then run configure with: --extra-cxxflags="-isystem /path/to/vss/inc/win2003"''') \
+ .require(midl.found() or widl.found(),
+ error_message: 'VSS support requires midl or widl') \
+ .require(not enable_static,
+ error_message: 'VSS support requires dynamic linking with GLib') \
+ .allowed()
+
+all_qga = []
+
qga_qapi_outputs = [
'qga-qapi-commands.c',
'qga-qapi-commands.h',
@@ -50,19 +80,26 @@ qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
qga_ss = qga_ss.apply(config_host, strict: false)
+gen_tlb = []
+qga_libs = []
+if targetos == 'windows'
+ qga_libs += ['-lws2_32', '-lwinmm', '-lpowrprof', '-lwtsapi32', '-lwininet', '-liphlpapi', '-lnetapi32']
+ if have_qga_vss
+ qga_libs += ['-lole32', '-loleaut32', '-lshlwapi', '-lstdc++', '-Wl,--enable-stdcall-fixup']
+ subdir('vss-win32')
+ endif
+ if have_ntddscsi
+ qga_libs += ['-lsetupapi', '-lcfgmgr32']
+ endif
+endif
+
qga = executable('qemu-ga', qga_ss.sources(),
- link_args: config_host['LIBS_QGA'].split(),
+ link_args: qga_libs,
dependencies: [qemuutil, libudev],
install: true)
-all_qga = [qga]
+all_qga += qga
if targetos == 'windows'
- if 'CONFIG_QGA_VSS' in config_host
- subdir('vss-win32')
- else
- gen_tlb = []
- endif
-
qemu_ga_msi_arch = {
'x86': ['-D', 'Arch=32'],
'x86_64': ['-a', 'x64', '-D', 'Arch=64']
@@ -77,7 +114,7 @@ if targetos == 'windows'
if wixl.found()
deps = [gen_tlb, qga]
qemu_ga_msi_vss = []
- if 'CONFIG_QGA_VSS' in config_host
+ if have_qga_vss
qemu_ga_msi_vss = ['-D', 'InstallVss']
deps += qga_vss
endif
diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index 40de133774..efc5bb9909 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -13,7 +13,7 @@
#include "qemu/osdep.h"
#include "vss-common.h"
-#include <inc/win2003/vscoordint.h>
+#include <vscoordint.h>
#include "install.h"
#include <wbemidl.h>
#include <comdef.h>
diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build
index 90825edef3..71c50d0866 100644
--- a/qga/vss-win32/meson.build
+++ b/qga/vss-win32/meson.build
@@ -1,36 +1,38 @@
-if add_languages('cpp', required: false)
- glib_dynamic = dependency('glib-2.0', static: false)
- link_args = cc.get_supported_link_arguments(['-fstack-protector-all', '-fstack-protector-strong',
- '-Wl,--add-stdcall-alias', '-Wl,--enable-stdcall-fixup'])
+link_args = cc.get_supported_link_arguments([
+ '-fstack-protector-all',
+ '-fstack-protector-strong',
+ '-Wl,--add-stdcall-alias',
+ '-Wl,--enable-stdcall-fixup'
+])
- qga_vss = shared_module('qga-vss', ['requester.cpp', 'provider.cpp', 'install.cpp'],
- name_prefix: '',
- cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'],
- link_args: link_args,
- vs_module_defs: 'qga-vss.def',
- dependencies: [glib_dynamic, socket,
- cc.find_library('ole32'),
- cc.find_library('oleaut32'),
- cc.find_library('shlwapi'),
- cc.find_library('uuid'),
- cc.find_library('intl')])
+qga_vss = shared_module(
+ 'qga-vss',
+ ['requester.cpp', 'provider.cpp', 'install.cpp'],
+ name_prefix: '',
+ cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'],
+ link_args: link_args,
+ vs_module_defs: 'qga-vss.def',
+ dependencies: [
+ glib,
+ socket,
+ cc.find_library('ole32'),
+ cc.find_library('oleaut32'),
+ cc.find_library('shlwapi'),
+ cc.find_library('uuid'),
+ cc.find_library('intl')
+ ]
+)
- all_qga += qga_vss
-endif
+all_qga += qga_vss
-# rules to build qga-vss.tlb
-# Currently, only native build is supported because building .tlb
-# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++).
-midl = find_program('midl', required: false)
if midl.found()
gen_tlb = custom_target('gen-tlb',
input: 'qga-vss.idl',
output: 'qga-vss.tlb',
- command: [midl, '-tlb', '-I' + config_host['WIN_SDK'],
- '@INPUT@', '@OUTPUT@'])
+ command: [midl, '@INPUT@', '/tlb', '@OUTPUT@'])
else
gen_tlb = custom_target('gen-tlb',
- input: 'qga-vss.tlb',
+ input: 'qga-vss.idl',
output: 'qga-vss.tlb',
- command: ['cp', '@INPUT@', '@OUTPUT@'])
+ command: [widl, '-t', '@INPUT@', '-o', '@OUTPUT@'])
endif
diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
index 72d8b0e19d..fd187fb66f 100644
--- a/qga/vss-win32/provider.cpp
+++ b/qga/vss-win32/provider.cpp
@@ -12,8 +12,8 @@
#include "qemu/osdep.h"
#include "vss-common.h"
-#include <inc/win2003/vscoordint.h>
-#include <inc/win2003/vsprov.h>
+#include <vscoordint.h>
+#include <vsprov.h>
#define VSS_TIMEOUT_MSEC (60*1000)
diff --git a/qga/vss-win32/qga-vss.tlb b/qga/vss-win32/qga-vss.tlb
deleted file mode 100644
index 226452a186..0000000000
--- a/qga/vss-win32/qga-vss.tlb
+++ /dev/null
Binary files differ
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 940a2c8f55..4513324dd2 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -14,8 +14,8 @@
#include "vss-common.h"
#include "requester.h"
#include "install.h"
-#include <inc/win2003/vswriter.h>
-#include <inc/win2003/vsbackup.h>
+#include <vswriter.h>
+#include <vsbackup.h>
/* Max wait time for frozen event (VSS can only hold writes for 10 seconds) */
#define VSS_TIMEOUT_FREEZE_MSEC 60000
diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h
index 61c170b52e..54f8de8c88 100644
--- a/qga/vss-win32/vss-common.h
+++ b/qga/vss-win32/vss-common.h
@@ -46,11 +46,7 @@
#undef VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED
#undef VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED
-/*
- * VSS headers must be installed from Microsoft VSS SDK 7.2 available at:
- * http://www.microsoft.com/en-us/download/details.aspx?id=23490
- */
-#include <inc/win2003/vss.h>
+#include <vss.h>
#include "vss-handles.h"
/* Macros to convert char definitions to wchar */