summaryrefslogtreecommitdiff
path: root/qga/vss-win32/Makefile.objs
diff options
context:
space:
mode:
authorTomoki Sekiyama <tomoki.sekiyama@hds.com>2013-08-07 11:40:18 -0400
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-09-09 14:17:57 -0500
commitb39297aedfabe9b2c426cd540413be991500da25 (patch)
tree9fbd0f9e7da393290df5d70aa0be88e6a1428b44 /qga/vss-win32/Makefile.objs
parent20840d4cfe5198cde313ac953279e76f16c5b76d (diff)
downloadqemu-b39297aedfabe9b2c426cd540413be991500da25.tar.gz
qemu-b39297aedfabe9b2c426cd540413be991500da25.tar.bz2
qemu-b39297aedfabe9b2c426cd540413be991500da25.zip
qemu-ga: Add Windows VSS provider and requester as DLL
Adds VSS provider and requester as a qga-vss.dll, which is loaded by Windows VSS service as well as by qemu-ga. "provider.cpp" implements a basic stub of a software VSS provider. Currently, this module only relays a frozen event from VSS service to the agent, and thaw event from the agent to VSS service, to block VSS process to keep the system frozen while snapshots are taken at the host. To register the provider to the guest system as COM+ application, the type library (.tlb) for qga-vss.dll is required. To build it from COM IDL (.idl), VisualC++, MIDL and stdole2.tlb in Windows SDK are required. This patch also adds pre-compiled .tlb file in the repository in order to enable cross-compile qemu-ga.exe for Windows with VSS support. "requester.cpp" provides the VSS requester to kick the VSS snapshot process. Qemu-ga.exe works without the DLL, although fsfreeze features are disabled. These functions are only supported in Windows 2003 or later. In older systems, fsfreeze features are disabled. In several versions of Windows which don't support attribute VSS_VOLSNAP_ATTR_NO_AUTORECOVERY, DoSnapshotSet fails with error VSS_E_OBJECT_NOT_FOUND. In this patch, we just ignore this error. To solve this fundamentally, we need a framework to handle mount writable snapshot on guests, which is required by VSS auto-recovery feature (cleanup phase after a snapshot is taken). Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/vss-win32/Makefile.objs')
-rw-r--r--qga/vss-win32/Makefile.objs23
1 files changed, 23 insertions, 0 deletions
diff --git a/qga/vss-win32/Makefile.objs b/qga/vss-win32/Makefile.objs
new file mode 100644
index 0000000000..6a69d5008d
--- /dev/null
+++ b/qga/vss-win32/Makefile.objs
@@ -0,0 +1,23 @@
+# rules to build qga-vss.dll
+
+qga-vss-dll-obj-y += requester.o provider.o install.o
+
+obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y))
+$(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -fstack-protector-all, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
+
+$(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lole32 -loleaut32 -lshlwapi -luuid -static
+$(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def
+ $(call quiet-command,$(CXX) -o $@ $(qga-vss-dll-obj-y) $(SRC_PATH)/qga/vss-win32/qga-vss.def $(CXXFLAGS) $(LDFLAGS)," LINK $(TARGET_DIR)$@")
+
+
+# rules to build qga-provider.tlb
+# Currently, only native build is supported because building .tlb
+# (TypeLibrary) from .idl requires WindowsSDK and MIDL (and cl.exe in VC++).
+MIDL=$(WIN_SDK)/Bin/midl
+
+$(obj)/qga-vss.tlb: $(SRC_PATH)/$(obj)/qga-vss.idl
+ifeq ($(WIN_SDK),"")
+ $(call quiet-command,cp $(dir $<)qga-vss.tlb $@, " COPY $(TARGET_DIR)$@")
+else
+ $(call quiet-command,$(MIDL) -tlb $@ -I $(WIN_SDK)/Include $<," MIDL $(TARGET_DIR)$@")
+endif