mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2015-09-01-v2-tag' into staging
qemu-ga patch queue * add config file dump/load support for qemu-ga * various w32 build fixes, particularly WRT to msi package creation * fixes for msi installer * w32 support for guest-set-user-password v2: * replaced g_list_free_full with g_list_foreach to maintain glib 2.22 compatibility # gpg: Signature made Tue 01 Sep 2015 19:34:15 BST using RSA key ID F108B584 # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" # gpg: aka "Michael Roth <mdroth@utexas.edu>" # gpg: aka "Michael Roth <mdroth@linux.vnet.ibm.com>" * remotes/mdroth/tags/qga-pull-2015-09-01-v2-tag: (26 commits) Makefile: qemu-ga: fix msi target error message build: qemu-ga: fix VSS dependencies configure: qemu-ga: explicitly enable qemu-ga MSI support when probed configure: qemu-ga: move MSI installer probe after qga probe qemu-ga: implement win32 guest-set-user-password qga: start a man page qga: add --dump-conf option qga: add an optional qemu-ga.conf system configuration qga: free a bit more qga: move agent run in a separate function qga: fill default options in main() qga: move option parsing to separate function qga: copy argument strings qga: rename 'path' to 'channel_path' qga: make split_list() return allocated strings qga: move string split in separate function qga: use exit() when parsing options qga: misc spelling configure: qemu-ga: report MSI install support in summary qemu-ga: Fixed paths issue with MSI build ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
*.cp
|
||||
*.dvi
|
||||
*.exe
|
||||
*.msi
|
||||
*.dll
|
||||
*.so
|
||||
*.mo
|
||||
|
||||
@@ -88,7 +88,8 @@ LIBS+=-lz $(LIBS_TOOLS)
|
||||
HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
|
||||
|
||||
ifdef BUILD_DOCS
|
||||
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
|
||||
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
|
||||
DOCS+=qmp-commands.txt
|
||||
ifdef CONFIG_LINUX
|
||||
DOCS+=kvm_stat.1
|
||||
endif
|
||||
@@ -289,28 +290,27 @@ $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
|
||||
QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
|
||||
$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
|
||||
|
||||
qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a
|
||||
$(call LINK, $^)
|
||||
# we require QGA_VSS_PROVIDER files to be built alongside qemu-ga
|
||||
# executable since they are shipped together, but we don't want to actually
|
||||
# link against them
|
||||
qemu-ga$(EXESUF): $(qga-obj-y) libqemuutil.a libqemustub.a $(QGA_VSS_PROVIDER)
|
||||
$(call LINK, $(filter-out $(QGA_VSS_PROVIDER), $^))
|
||||
|
||||
ifdef QEMU_GA_MSI_ENABLED
|
||||
QEMU_GA_MSI=qemu-ga-$(ARCH).msi
|
||||
|
||||
msi: ${QEMU_GA_MSI}
|
||||
msi: $(QEMU_GA_MSI)
|
||||
|
||||
$(QEMU_GA_MSI): qemu-ga.exe
|
||||
|
||||
ifdef QEMU_GA_MSI_WITH_VSS
|
||||
$(QEMU_GA_MSI): qga/vss-win32/qga-vss.dll
|
||||
endif
|
||||
|
||||
$(QEMU_GA_MSI): config-host.mak
|
||||
|
||||
$(QEMU_GA_MSI): qga/installer/qemu-ga.wxs
|
||||
$(call quiet-command,QEMU_GA_VERSION="$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER="$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO="$(QEMU_GA_DISTRO)" \
|
||||
$(QEMU_GA_MSI): $(SRC_PATH)/qga/installer/qemu-ga.wxs
|
||||
$(call quiet-command,QEMU_GA_VERSION="$(QEMU_GA_VERSION)" QEMU_GA_MANUFACTURER="$(QEMU_GA_MANUFACTURER)" QEMU_GA_DISTRO="$(QEMU_GA_DISTRO)" BUILD_DIR="$(BUILD_DIR)" \
|
||||
wixl -o $@ $(QEMU_GA_MSI_ARCH) $(QEMU_GA_MSI_WITH_VSS) $(QEMU_GA_MSI_MINGW_DLL_PATH) $<, " WIXL $@")
|
||||
else
|
||||
msi:
|
||||
@echo MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)
|
||||
@echo "MSI build not configured or dependency resolution failed (reconfigure with --enable-guest-agent-msi option)"
|
||||
endif
|
||||
|
||||
clean:
|
||||
@@ -400,6 +400,9 @@ ifneq ($(TOOLS),)
|
||||
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
|
||||
$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
|
||||
endif
|
||||
ifneq (,$(findstring qemu-ga,$(TOOLS)))
|
||||
$(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_VIRTFS
|
||||
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
|
||||
@@ -538,6 +541,12 @@ qemu-nbd.8: qemu-nbd.texi
|
||||
$(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
|
||||
" GEN $@")
|
||||
|
||||
qemu-ga.8: qemu-ga.texi
|
||||
$(call quiet-command, \
|
||||
perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-ga.pod && \
|
||||
$(POD2MAN) --section=8 --center=" " --release=" " qemu-ga.pod > $@, \
|
||||
" GEN $@")
|
||||
|
||||
kvm_stat.1: scripts/kvm/kvm_stat.texi
|
||||
$(call quiet-command, \
|
||||
perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< kvm_stat.pod && \
|
||||
@@ -551,7 +560,7 @@ pdf: qemu-doc.pdf qemu-tech.pdf
|
||||
|
||||
qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
|
||||
qemu-img.texi qemu-nbd.texi qemu-options.texi \
|
||||
qemu-monitor.texi qemu-img-cmds.texi
|
||||
qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi
|
||||
|
||||
ifdef CONFIG_WIN32
|
||||
|
||||
|
||||
@@ -732,7 +732,7 @@ if test "$mingw32" = "yes" ; then
|
||||
sysconfdir="\${prefix}"
|
||||
local_statedir=
|
||||
confsuffix=""
|
||||
libs_qga="-lws2_32 -lwinmm -lpowrprof -liphlpapi $libs_qga"
|
||||
libs_qga="-lws2_32 -lwinmm -lpowrprof -liphlpapi -lnetapi32 $libs_qga"
|
||||
fi
|
||||
|
||||
werror=""
|
||||
@@ -3851,6 +3851,7 @@ EOF
|
||||
guest_agent_with_vss="yes"
|
||||
QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
|
||||
libs_qga="-lole32 -loleaut32 -lshlwapi -luuid -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga"
|
||||
qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb"
|
||||
else
|
||||
if test "$vss_win32_sdk" != "" ; then
|
||||
echo "ERROR: Please download and install Microsoft VSS SDK:"
|
||||
@@ -3904,58 +3905,6 @@ EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
##########################################
|
||||
# Guest agent Window MSI package
|
||||
|
||||
if test "$guest_agent" != yes; then
|
||||
if test "$guest_agent_msi" = yes; then
|
||||
error_exit "MSI guest agent package requires guest agent enabled"
|
||||
fi
|
||||
guest_agent_msi=no
|
||||
elif test "$mingw32" != "yes"; then
|
||||
if test "$guest_agent_msi" = "yes"; then
|
||||
error_exit "MSI guest agent package is available only for MinGW Windows cross-compilation"
|
||||
fi
|
||||
guest_agent_msi=no
|
||||
elif ! has wixl; then
|
||||
if test "$guest_agent_msi" = "yes"; then
|
||||
error_exit "MSI guest agent package requires wixl tool installed ( usually from msitools package )"
|
||||
fi
|
||||
guest_agent_msi=no
|
||||
fi
|
||||
|
||||
if test "$guest_agent_msi" != "no"; then
|
||||
if test "$guest_agent_with_vss" = "yes"; then
|
||||
QEMU_GA_MSI_WITH_VSS="-D InstallVss"
|
||||
fi
|
||||
|
||||
if test "$QEMU_GA_MANUFACTURER" = ""; then
|
||||
QEMU_GA_MANUFACTURER=QEMU
|
||||
fi
|
||||
|
||||
if test "$QEMU_GA_DISTRO" = ""; then
|
||||
QEMU_GA_DISTRO=Linux
|
||||
fi
|
||||
|
||||
if test "$QEMU_GA_VERSION" = ""; then
|
||||
QEMU_GA_VERSION=`cat $source_path/VERSION`
|
||||
fi
|
||||
|
||||
QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=`$pkg_config --variable=prefix glib-2.0`/bin"
|
||||
|
||||
case "$cpu" in
|
||||
x86_64)
|
||||
QEMU_GA_MSI_ARCH="-a x64 -D Arch=64"
|
||||
;;
|
||||
i386)
|
||||
QEMU_GA_MSI_ARCH="-D Arch=32"
|
||||
;;
|
||||
*)
|
||||
error_exit "CPU $cpu not supported for building installation package"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
##########################################
|
||||
# check if we have fdatasync
|
||||
|
||||
@@ -4396,12 +4345,12 @@ if test "$softmmu" = yes ; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Probe for guest agent support/options
|
||||
|
||||
if [ "$guest_agent" != "no" ]; then
|
||||
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then
|
||||
tools="qemu-ga\$(EXESUF) $tools"
|
||||
if [ "$mingw32" = "yes" -a "$guest_agent_with_vss" = "yes" ]; then
|
||||
tools="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb $tools"
|
||||
fi
|
||||
guest_agent=yes
|
||||
elif [ "$guest_agent" != yes ]; then
|
||||
guest_agent=no
|
||||
@@ -4410,6 +4359,63 @@ if [ "$guest_agent" != "no" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Guest agent Window MSI package
|
||||
|
||||
if test "$guest_agent" != yes; then
|
||||
if test "$guest_agent_msi" = yes; then
|
||||
error_exit "MSI guest agent package requires guest agent enabled"
|
||||
fi
|
||||
guest_agent_msi=no
|
||||
elif test "$mingw32" != "yes"; then
|
||||
if test "$guest_agent_msi" = "yes"; then
|
||||
error_exit "MSI guest agent package is available only for MinGW Windows cross-compilation"
|
||||
fi
|
||||
guest_agent_msi=no
|
||||
elif ! has wixl; then
|
||||
if test "$guest_agent_msi" = "yes"; then
|
||||
error_exit "MSI guest agent package requires wixl tool installed ( usually from msitools package )"
|
||||
fi
|
||||
guest_agent_msi=no
|
||||
else
|
||||
# we support qemu-ga, mingw32, and wixl: default to MSI enabled if it wasn't
|
||||
# disabled explicitly
|
||||
if test "$guest_agent_msi" != "no"; then
|
||||
guest_agent_msi=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$guest_agent_msi" = "yes"; then
|
||||
if test "$guest_agent_with_vss" = "yes"; then
|
||||
QEMU_GA_MSI_WITH_VSS="-D InstallVss"
|
||||
fi
|
||||
|
||||
if test "$QEMU_GA_MANUFACTURER" = ""; then
|
||||
QEMU_GA_MANUFACTURER=QEMU
|
||||
fi
|
||||
|
||||
if test "$QEMU_GA_DISTRO" = ""; then
|
||||
QEMU_GA_DISTRO=Linux
|
||||
fi
|
||||
|
||||
if test "$QEMU_GA_VERSION" = ""; then
|
||||
QEMU_GA_VERSION=`cat $source_path/VERSION`
|
||||
fi
|
||||
|
||||
QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=`$pkg_config --variable=prefix glib-2.0`/bin"
|
||||
|
||||
case "$cpu" in
|
||||
x86_64)
|
||||
QEMU_GA_MSI_ARCH="-a x64 -D Arch=64"
|
||||
;;
|
||||
i386)
|
||||
QEMU_GA_MSI_ARCH="-D Arch=32"
|
||||
;;
|
||||
*)
|
||||
error_exit "CPU $cpu not supported for building installation package"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Mac OS X ships with a broken assembler
|
||||
roms=
|
||||
if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
|
||||
@@ -4577,6 +4583,7 @@ echo "libnfs support $libnfs"
|
||||
echo "build guest agent $guest_agent"
|
||||
echo "QGA VSS support $guest_agent_with_vss"
|
||||
echo "QGA w32 disk info $guest_agent_ntddscsi"
|
||||
echo "QGA MSI support $guest_agent_msi"
|
||||
echo "seccomp support $seccomp"
|
||||
echo "coroutine backend $coroutine"
|
||||
echo "coroutine pool $coroutine_pool"
|
||||
@@ -4651,12 +4658,13 @@ if test "$mingw32" = "yes" ; then
|
||||
echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
|
||||
if test "$guest_agent_with_vss" = "yes" ; then
|
||||
echo "CONFIG_QGA_VSS=y" >> $config_host_mak
|
||||
echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak
|
||||
echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak
|
||||
fi
|
||||
if test "$guest_agent_ntddscsi" = "yes" ; then
|
||||
echo "CONFIG_QGA_NTDDDISK=y" >> $config_host_mak
|
||||
fi
|
||||
if test "$guest_agent_msi" != "no"; then
|
||||
if test "$guest_agent_msi" = "yes"; then
|
||||
echo "QEMU_GA_MSI_ENABLED=yes" >> $config_host_mak
|
||||
echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
|
||||
echo "QEMU_GA_MSI_WITH_VSS=${QEMU_GA_MSI_WITH_VSS}" >> $config_host_mak
|
||||
|
||||
@@ -412,6 +412,7 @@ snapshots.
|
||||
* vm_snapshots:: VM snapshots
|
||||
* qemu_img_invocation:: qemu-img Invocation
|
||||
* qemu_nbd_invocation:: qemu-nbd Invocation
|
||||
* qemu_ga_invocation:: qemu-ga Invocation
|
||||
* disk_images_formats:: Disk image file formats
|
||||
* host_drives:: Using host drives
|
||||
* disk_images_fat_images:: Virtual FAT disk images
|
||||
@@ -505,6 +506,11 @@ state is not saved or restored properly (in particular USB).
|
||||
|
||||
@include qemu-nbd.texi
|
||||
|
||||
@node qemu_ga_invocation
|
||||
@subsection @code{qemu-ga} Invocation
|
||||
|
||||
@include qemu-ga.texi
|
||||
|
||||
@node disk_images_formats
|
||||
@subsection Disk image file formats
|
||||
|
||||
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
@example
|
||||
@c man begin SYNOPSIS
|
||||
usage: qemu-ga [OPTIONS]
|
||||
@c man end
|
||||
@end example
|
||||
|
||||
@c man begin DESCRIPTION
|
||||
|
||||
The QEMU Guest Agent is a daemon intended to be run within virtual
|
||||
machines. It allows the hypervisor host to perform various operations
|
||||
in the guest, such as:
|
||||
|
||||
@itemize
|
||||
@item
|
||||
get information from the guest
|
||||
@item
|
||||
set the guest's system time
|
||||
@item
|
||||
read/write a file
|
||||
@item
|
||||
sync and freeze the filesystems
|
||||
@item
|
||||
suspend the guest
|
||||
@item
|
||||
reconfigure guest local processors
|
||||
@item
|
||||
set user's password
|
||||
@item
|
||||
...
|
||||
@end itemize
|
||||
|
||||
qemu-ga will read a system configuration file on startup (located at
|
||||
q@file{/etc/qemu/qemu-ga.conf} by default), then parse remaining
|
||||
configuration options on the command line. For the same key, the last
|
||||
option wins, but the lists accumulate (see below for configuration
|
||||
file format).
|
||||
|
||||
@c man end
|
||||
|
||||
@c man begin OPTIONS
|
||||
@table @option
|
||||
@item -m, --method=@var{method}
|
||||
Transport method: one of @samp{unix-listen}, @samp{virtio-serial}, or
|
||||
@samp{isa-serial} (@samp{virtio-serial} is the default).
|
||||
|
||||
@item -p, --path=@var{path}
|
||||
Device/socket path (the default for virtio-serial is
|
||||
@samp{/dev/virtio-ports/org.qemu.guest_agent.0},
|
||||
the default for isa-serial is @samp{/dev/ttyS0})
|
||||
|
||||
@item -l, --logfile=@var{path}
|
||||
Set log file path (default is stderr).
|
||||
|
||||
@item -f, --pidfile=@var{path}
|
||||
Specify pid file (default is @samp{/var/run/qemu-ga.pid}).
|
||||
|
||||
@item -F, --fsfreeze-hook=@var{path}
|
||||
Enable fsfreeze hook. Accepts an optional argument that specifies
|
||||
script to run on freeze/thaw. Script will be called with
|
||||
'freeze'/'thaw' arguments accordingly (default is
|
||||
@samp{/etc/qemu/fsfreeze-hook}). If using -F with an argument, do
|
||||
not follow -F with a space (for example:
|
||||
@samp{-F/var/run/fsfreezehook.sh}).
|
||||
|
||||
@item -t, --statedir=@var{path}
|
||||
Specify the directory to store state information (absolute paths only,
|
||||
default is @samp{/var/run}).
|
||||
|
||||
@item -v, --verbose
|
||||
Log extra debugging information.
|
||||
|
||||
@item -V, --version
|
||||
Print version information and exit.
|
||||
|
||||
@item -d, --daemon
|
||||
Daemonize after startup (detach from terminal).
|
||||
|
||||
@item -b, --blacklist=@var{list}
|
||||
Comma-separated list of RPCs to disable (no spaces, @samp{?} to list
|
||||
available RPCs).
|
||||
|
||||
@item -D, --dump-conf
|
||||
Dump the configuration in a format compatible with @file{qemu-ga.conf}
|
||||
and exit.
|
||||
|
||||
@item -h, --help
|
||||
Display this help and exit.
|
||||
@end table
|
||||
|
||||
@c man end
|
||||
|
||||
@c man begin FILES
|
||||
|
||||
The syntax of the @file{qemu-ga.conf} configuration file follows the
|
||||
Desktop Entry Specification, here is a quick summary: it consists of
|
||||
groups of key-value pairs, interspersed with comments.
|
||||
|
||||
@example
|
||||
# qemu-ga configuration sample
|
||||
[general]
|
||||
daemonize = 0
|
||||
pidfile = /var/run/qemu-ga.pid
|
||||
verbose = 0
|
||||
method = virtio-serial
|
||||
path = /dev/virtio-ports/org.qemu.guest_agent.0
|
||||
statedir = /var/run
|
||||
@end example
|
||||
|
||||
The list of keys follows the command line options:
|
||||
@table @option
|
||||
@item daemon= boolean
|
||||
@item method= string
|
||||
@item path= string
|
||||
@item logfile= string
|
||||
@item pidfile= string
|
||||
@item fsfreeze-hook= string
|
||||
@item statedir= string
|
||||
@item verbose= boolean
|
||||
@item blacklist= string list
|
||||
@end table
|
||||
|
||||
@c man end
|
||||
|
||||
@ignore
|
||||
|
||||
@setfilename qemu-ga
|
||||
@settitle QEMU Guest Agent
|
||||
|
||||
@c man begin AUTHOR
|
||||
Michael Roth <mdroth@linux.vnet.ibm.com>
|
||||
@c man end
|
||||
|
||||
@c man begin SEEALSO
|
||||
qemu(1)
|
||||
@c man end
|
||||
|
||||
@end ignore
|
||||
@@ -2454,7 +2454,7 @@ GList *ga_command_blacklist_init(GList *blacklist)
|
||||
char **p = (char **)list;
|
||||
|
||||
while (*p) {
|
||||
blacklist = g_list_append(blacklist, *p++);
|
||||
blacklist = g_list_append(blacklist, g_strdup(*p++));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2468,13 +2468,13 @@ GList *ga_command_blacklist_init(GList *blacklist)
|
||||
char **p = (char **)list;
|
||||
|
||||
while (*p) {
|
||||
blacklist = g_list_append(blacklist, *p++);
|
||||
blacklist = g_list_append(blacklist, g_strdup(*p++));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_FSTRIM)
|
||||
blacklist = g_list_append(blacklist, (char *)"guest-fstrim");
|
||||
blacklist = g_list_append(blacklist, g_strdup("guest-fstrim"));
|
||||
#endif
|
||||
|
||||
return blacklist;
|
||||
|
||||
+77
-4
@@ -26,6 +26,8 @@
|
||||
#include <setupapi.h>
|
||||
#include <initguid.h>
|
||||
#endif
|
||||
#include <lm.h>
|
||||
|
||||
#include "qga/guest-agent-core.h"
|
||||
#include "qga/vss-win32.h"
|
||||
#include "qga-qmp-commands.h"
|
||||
@@ -1192,12 +1194,84 @@ int64_t qmp_guest_set_vcpus(GuestLogicalProcessorList *vcpus, Error **errp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
get_net_error_message(gint error)
|
||||
{
|
||||
HMODULE module = NULL;
|
||||
gchar *retval = NULL;
|
||||
wchar_t *msg = NULL;
|
||||
int flags, nchars;
|
||||
|
||||
flags = FORMAT_MESSAGE_ALLOCATE_BUFFER
|
||||
|FORMAT_MESSAGE_IGNORE_INSERTS
|
||||
|FORMAT_MESSAGE_FROM_SYSTEM;
|
||||
|
||||
if (error >= NERR_BASE && error <= MAX_NERR) {
|
||||
module = LoadLibraryExW(L"netmsg.dll", NULL, LOAD_LIBRARY_AS_DATAFILE);
|
||||
|
||||
if (module != NULL) {
|
||||
flags |= FORMAT_MESSAGE_FROM_HMODULE;
|
||||
}
|
||||
}
|
||||
|
||||
FormatMessageW(flags, module, error, 0, (LPWSTR)&msg, 0, NULL);
|
||||
|
||||
if (msg != NULL) {
|
||||
nchars = wcslen(msg);
|
||||
|
||||
if (nchars > 2 && msg[nchars-1] == '\n' && msg[nchars-2] == '\r') {
|
||||
msg[nchars-2] = '\0';
|
||||
}
|
||||
|
||||
retval = g_utf16_to_utf8(msg, -1, NULL, NULL, NULL);
|
||||
|
||||
LocalFree(msg);
|
||||
}
|
||||
|
||||
if (module != NULL) {
|
||||
FreeLibrary(module);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void qmp_guest_set_user_password(const char *username,
|
||||
const char *password,
|
||||
bool crypted,
|
||||
Error **errp)
|
||||
{
|
||||
error_setg(errp, QERR_UNSUPPORTED);
|
||||
NET_API_STATUS nas;
|
||||
char *rawpasswddata = NULL;
|
||||
size_t rawpasswdlen;
|
||||
wchar_t *user, *wpass;
|
||||
USER_INFO_1003 pi1003 = { 0, };
|
||||
|
||||
if (crypted) {
|
||||
error_setg(errp, QERR_UNSUPPORTED);
|
||||
return;
|
||||
}
|
||||
|
||||
rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
|
||||
rawpasswddata = g_renew(char, rawpasswddata, rawpasswdlen + 1);
|
||||
rawpasswddata[rawpasswdlen] = '\0';
|
||||
|
||||
user = g_utf8_to_utf16(username, -1, NULL, NULL, NULL);
|
||||
wpass = g_utf8_to_utf16(rawpasswddata, -1, NULL, NULL, NULL);
|
||||
|
||||
pi1003.usri1003_password = wpass;
|
||||
nas = NetUserSetInfo(NULL, user,
|
||||
1003, (LPBYTE)&pi1003,
|
||||
NULL);
|
||||
|
||||
if (nas != NERR_Success) {
|
||||
gchar *msg = get_net_error_message(nas);
|
||||
error_setg(errp, "failed to set password: %s", msg);
|
||||
g_free(msg);
|
||||
}
|
||||
|
||||
g_free(user);
|
||||
g_free(wpass);
|
||||
g_free(rawpasswddata);
|
||||
}
|
||||
|
||||
GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp)
|
||||
@@ -1225,7 +1299,6 @@ GList *ga_command_blacklist_init(GList *blacklist)
|
||||
const char *list_unsupported[] = {
|
||||
"guest-suspend-hybrid",
|
||||
"guest-get-vcpus", "guest-set-vcpus",
|
||||
"guest-set-user-password",
|
||||
"guest-get-memory-blocks", "guest-set-memory-blocks",
|
||||
"guest-get-memory-block-size",
|
||||
"guest-fsfreeze-freeze-list",
|
||||
@@ -1233,7 +1306,7 @@ GList *ga_command_blacklist_init(GList *blacklist)
|
||||
char **p = (char **)list_unsupported;
|
||||
|
||||
while (*p) {
|
||||
blacklist = g_list_append(blacklist, *p++);
|
||||
blacklist = g_list_append(blacklist, g_strdup(*p++));
|
||||
}
|
||||
|
||||
if (!vss_init(true)) {
|
||||
@@ -1244,7 +1317,7 @@ GList *ga_command_blacklist_init(GList *blacklist)
|
||||
p = (char **)list;
|
||||
|
||||
while (*p) {
|
||||
blacklist = g_list_append(blacklist, *p++);
|
||||
blacklist = g_list_append(blacklist, g_strdup(*p++));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+50
-28
@@ -42,7 +42,7 @@
|
||||
<Product
|
||||
Name="QEMU guest agent"
|
||||
Id="*"
|
||||
UpgradeCode="{EB6B8302-C06E-4bec-ADAC-932C68A3A98D}"
|
||||
UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}"
|
||||
Manufacturer="$(env.QEMU_GA_MANUFACTURER)"
|
||||
Version="$(env.QEMU_GA_VERSION)"
|
||||
Language="1033">
|
||||
@@ -58,29 +58,15 @@
|
||||
/>
|
||||
<Media Id="1" Cabinet="qemu_ga.$(env.QEMU_GA_VERSION).cab" EmbedCab="yes" />
|
||||
<Property Id="WHSLogo">1</Property>
|
||||
<Property Id="PREVIOUSVERSIONSINSTALLED" />
|
||||
<Upgrade Id="{EB6B8302-C06E-4bec-ADAC-932C68A3A98D}">
|
||||
<UpgradeVersion
|
||||
Minimum="1.0.0.0" Maximum="$(env.QEMU_GA_VERSION)"
|
||||
Property="PREVIOUSVERSIONSINSTALLED"
|
||||
IncludeMinimum="yes" IncludeMaximum="no" />
|
||||
</Upgrade>
|
||||
<MajorUpgrade
|
||||
DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed."
|
||||
/>
|
||||
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="$(var.GaProgramFilesFolder)" Name="QEMU Guest Agent">
|
||||
<Directory Id="qemu_ga_directory" Name="Qemu-ga">
|
||||
<Component Id="qemu_ga" Guid="{908B7199-DE2A-4dc6-A8D0-27A5AE444FEA}">
|
||||
<File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="../../qemu-ga.exe" KeyPath="yes" DiskId="1"/>
|
||||
<?ifdef var.InstallVss ?>
|
||||
<File Id="qga_vss.dll" Name="qga-vss.dll" Source="../vss-win32/qga-vss.dll" KeyPath="no" DiskId="1"/>
|
||||
<File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="../vss-win32/qga-vss.tlb" KeyPath="no" DiskId="1"/>
|
||||
<?endif?>
|
||||
<File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="no" DiskId="1"/>
|
||||
<File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="no" DiskId="1"/>
|
||||
<File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="no" DiskId="1"/>
|
||||
<File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="no" DiskId="1"/>
|
||||
<File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="no" DiskId="1"/>
|
||||
<File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="no" DiskId="1"/>
|
||||
<Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}">
|
||||
<File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="$(env.BUILD_DIR)/qemu-ga.exe" KeyPath="yes" DiskId="1"/>
|
||||
<ServiceInstall
|
||||
Id="ServiceInstaller"
|
||||
Type="ownProcess"
|
||||
@@ -97,8 +83,33 @@
|
||||
</ServiceInstall>
|
||||
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="QEMU-GA" Wait="no" />
|
||||
</Component>
|
||||
|
||||
<Component Id="registry_entries" Guid="d075d109-51ca-11e3-9f8b-000c29858960">
|
||||
<?ifdef var.InstallVss?>
|
||||
<Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}">
|
||||
<File Id="qga_vss.dll" Name="qga-vss.dll" Source="$(env.BUILD_DIR)/qga/vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/>
|
||||
</Component>
|
||||
<Component Id="qga_vss_tlb" Guid="{D8D584B1-59C2-4FB7-A91F-636FF7BFA66E}">
|
||||
<File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="$(env.BUILD_DIR)/qga/vss-win32/qga-vss.tlb" KeyPath="yes" DiskId="1"/>
|
||||
</Component>
|
||||
<?endif?>
|
||||
<Component Id="iconv" Guid="{35EE3558-D34B-4F0A-B8BD-430FF0775246}">
|
||||
<File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="yes" DiskId="1"/>
|
||||
</Component>
|
||||
<Component Id="libgcc_arch_lib" Guid="{ADD4D07D-4515-4AB6-AF3E-C904961B4BB0}">
|
||||
<File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="yes" DiskId="1"/>
|
||||
</Component>
|
||||
<Component Id="libglib" Guid="{D31BFD83-2773-4B65-B45A-E0D2ADA58679}">
|
||||
<File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="yes" DiskId="1"/>
|
||||
</Component>
|
||||
<Component Id="libintl" Guid="{A641BC2D-A907-4A94-9149-F30ED430878F}">
|
||||
<File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="yes" DiskId="1"/>
|
||||
</Component>
|
||||
<Component Id="libssp" Guid="{7880087B-02B4-4EF6-A5D3-D18F8E3D90E1}">
|
||||
<File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="yes" DiskId="1"/>
|
||||
</Component>
|
||||
<Component Id="libwinpthread" Guid="{6C117C78-0F47-4B07-8F34-6BEE11643829}">
|
||||
<File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="yes" DiskId="1"/>
|
||||
</Component>
|
||||
<Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}">
|
||||
<RegistryKey Root="HKLM"
|
||||
Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA">
|
||||
<RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" />
|
||||
@@ -110,10 +121,11 @@
|
||||
</Directory>
|
||||
|
||||
<Property Id="cmd" Value="cmd.exe"/>
|
||||
<Property Id="REINSTALLMODE" Value="amus"/>
|
||||
|
||||
<?ifdef var.InstallVss ?>
|
||||
<?ifdef var.InstallVss?>
|
||||
<CustomAction Id="RegisterCom"
|
||||
ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-install'
|
||||
ExeCommand='/c "[qemu_ga_directory]qemu-ga.exe" -s vss-install'
|
||||
Execute="deferred"
|
||||
Property="cmd"
|
||||
Impersonate="no"
|
||||
@@ -126,19 +138,29 @@
|
||||
Property="cmd"
|
||||
Impersonate="no"
|
||||
Return="check"
|
||||
></CustomAction>
|
||||
>
|
||||
</CustomAction>
|
||||
<?endif?>
|
||||
|
||||
<Feature Id="QEMUFeature" Title="QEMU Guest Agent" Level="1">
|
||||
<ComponentRef Id="qemu_ga" />
|
||||
<?ifdef var.InstallVss?>
|
||||
<ComponentRef Id="qga_vss_dll" />
|
||||
<ComponentRef Id="qga_vss_tlb" />
|
||||
<?endif?>
|
||||
<ComponentRef Id="iconv" />
|
||||
<ComponentRef Id="libgcc_arch_lib" />
|
||||
<ComponentRef Id="libglib" />
|
||||
<ComponentRef Id="libintl" />
|
||||
<ComponentRef Id="libssp" />
|
||||
<ComponentRef Id="libwinpthread" />
|
||||
<ComponentRef Id="registry_entries" />
|
||||
</Feature>
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<RemoveExistingProducts Before="InstallInitialize" />
|
||||
<?ifdef var.InstallVss ?>
|
||||
<Custom Action="RegisterCom" After="InstallServices">NOT Installed</Custom>
|
||||
<?ifdef var.InstallVss?>
|
||||
<Custom Action="UnRegisterCom" After="StopServices">Installed</Custom>
|
||||
<Custom Action="RegisterCom" After="InstallServices">NOT REMOVE</Custom>
|
||||
<?endif?>
|
||||
</InstallExecuteSequence>
|
||||
</Product>
|
||||
|
||||
+333
-138
File diff suppressed because it is too large
Load Diff
@@ -793,7 +793,7 @@
|
||||
# scheme. Refer to the documentation of the guest operating system
|
||||
# in question to determine what is supported.
|
||||
#
|
||||
# Note all guest operating systems will support use of the
|
||||
# Not all guest operating systems will support use of the
|
||||
# @crypted flag, as they may require the clear-text password
|
||||
#
|
||||
# The @password parameter must always be base64 encoded before
|
||||
|
||||
Reference in New Issue
Block a user