summaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
authorhyokeun <hyokeun.jeon@samsung.com>2016-09-06 14:09:22 +0900
committerhyokeun <hyokeun.jeon@samsung.com>2016-09-06 14:09:22 +0900
commitbd54c25035217800f3b1d39f6472d599cd602d5a (patch)
tree299417fe96f546225439ff92b27ac3e55909a970 /qga
parent186efde2677c31fb40d154a81a5f3731eab52414 (diff)
downloadqemu-bd54c25035217800f3b1d39f6472d599cd602d5a.tar.gz
qemu-bd54c25035217800f3b1d39f6472d599cd602d5a.tar.bz2
qemu-bd54c25035217800f3b1d39f6472d599cd602d5a.zip
Imported Upstream version 2.7.0upstream/2.7.0
Diffstat (limited to 'qga')
-rw-r--r--qga/channel-posix.c1
-rw-r--r--qga/channel-win32.c3
-rw-r--r--qga/channel.h1
-rw-r--r--qga/commands-posix.c17
-rw-r--r--qga/commands-win32.c14
-rw-r--r--qga/commands.c5
-rw-r--r--qga/guest-agent-command-state.c1
-rw-r--r--qga/main.c1
-rw-r--r--qga/service-win32.c1
-rw-r--r--qga/service-win32.h5
-rw-r--r--qga/vss-win32/install.cpp3
-rw-r--r--qga/vss-win32/provider.cpp4
-rw-r--r--qga/vss-win32/requester.cpp4
-rw-r--r--qga/vss-win32/vss-common.h6
14 files changed, 24 insertions, 42 deletions
diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 63458c663..bb65d8ba1 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include <termios.h>
#include "qapi/error.h"
#include "qemu/sockets.h"
diff --git a/qga/channel-win32.c b/qga/channel-win32.c
index bb5966124..21f9deedf 100644
--- a/qga/channel-win32.c
+++ b/qga/channel-win32.c
@@ -1,5 +1,4 @@
#include "qemu/osdep.h"
-#include <glib.h>
#include <windows.h>
#include <io.h>
#include "qga/guest-agent-core.h"
@@ -77,7 +76,7 @@ static gboolean ga_channel_prepare(GSource *source, gint *timeout_ms)
}
out:
- /* dont block forever, iterate the main loop every once and a while */
+ /* don't block forever, iterate the main loop every once in a while */
*timeout_ms = 500;
/* if there's data in the read buffer, or another event is pending,
* skip polling and issue user cb.
diff --git a/qga/channel.h b/qga/channel.h
index 3704ea9c8..ae8cf0f7e 100644
--- a/qga/channel.h
+++ b/qga/channel.h
@@ -12,7 +12,6 @@
#ifndef QGA_CHANNEL_H
#define QGA_CHANNEL_H
-#include <glib.h>
typedef struct GAChannel GAChannel;
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 2ae37255d..ea37c097c 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <dirent.h>
@@ -128,7 +127,6 @@ int64_t qmp_guest_get_time(Error **errp)
{
int ret;
qemu_timeval tq;
- int64_t time_ns;
ret = qemu_gettimeofday(&tq);
if (ret < 0) {
@@ -136,8 +134,7 @@ int64_t qmp_guest_get_time(Error **errp)
return -1;
}
- time_ns = tq.tv_sec * 1000000000LL + tq.tv_usec * 1000;
- return time_ns;
+ return tq.tv_sec * 1000000000LL + tq.tv_usec * 1000;
}
void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
@@ -1242,8 +1239,8 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints,
goto error;
}
- /* we try to cull filesytems we know won't work in advance, but other
- * filesytems may not implement fsfreeze for less obvious reasons.
+ /* we try to cull filesystems we know won't work in advance, but other
+ * filesystems may not implement fsfreeze for less obvious reasons.
* these will report EOPNOTSUPP. we simply ignore these when tallying
* the number of frozen filesystems.
*
@@ -1392,10 +1389,10 @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp)
continue;
}
- /* We try to cull filesytems we know won't work in advance, but other
- * filesytems may not implement fstrim for less obvious reasons. These
- * will report EOPNOTSUPP; while in some other cases ENOTTY will be
- * reported (e.g. CD-ROMs).
+ /* We try to cull filesystems we know won't work in advance, but other
+ * filesystems may not implement fstrim for less obvious reasons.
+ * These will report EOPNOTSUPP; while in some other cases ENOTTY
+ * will be reported (e.g. CD-ROMs).
* Any other error means an unexpected error.
*/
r.start = 0;
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index d76327f5a..9c9be1211 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -12,7 +12,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <wtypes.h>
#include <powrprof.h>
#include <winsock2.h>
@@ -248,9 +247,7 @@ out:
if (token) {
CloseHandle(token);
}
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
}
static void execute_async(DWORD WINAPI (*func)(LPVOID), LPVOID opaque,
@@ -883,9 +880,7 @@ static void check_suspend_mode(GuestSuspendMode mode, Error **errp)
}
out:
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
}
static DWORD WINAPI do_suspend(LPVOID opaque)
@@ -1155,7 +1150,6 @@ out:
int64_t qmp_guest_get_time(Error **errp)
{
SYSTEMTIME ts = {0};
- int64_t time_ns;
FILETIME tf;
GetSystemTime(&ts);
@@ -1169,10 +1163,8 @@ int64_t qmp_guest_get_time(Error **errp)
return -1;
}
- time_ns = ((((int64_t)tf.dwHighDateTime << 32) | tf.dwLowDateTime)
+ return ((((int64_t)tf.dwHighDateTime << 32) | tf.dwLowDateTime)
- W32_FT_OFFSET) * 100;
-
- return time_ns;
}
void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
diff --git a/qga/commands.c b/qga/commands.c
index b653a460b..50fd26a81 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qga/guest-agent-core.h"
#include "qga-qmp-commands.h"
#include "qapi/qmp/qerror.h"
@@ -182,8 +181,8 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, Error **err)
*/
#ifdef G_OS_WIN32
/* Additionally WIN32 does not provide any additional information
- * on whetherthe child exited or terminated via signal.
- * We use this simple range check to distingish application exit code
+ * on whether the child exited or terminated via signal.
+ * We use this simple range check to distinguish application exit code
* (usually value less then 256) and unhandled exception code with
* ntstatus (always value greater then 0xC0000005). */
if ((uint32_t)gei->status < 0xC0000000U) {
diff --git a/qga/guest-agent-command-state.c b/qga/guest-agent-command-state.c
index 20b9b2222..4de229cd7 100644
--- a/qga/guest-agent-command-state.c
+++ b/qga/guest-agent-command-state.c
@@ -10,7 +10,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include "qga/guest-agent-core.h"
struct GACommandState {
diff --git a/qga/main.c b/qga/main.c
index c55278210..4c3b2c772 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -11,7 +11,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <getopt.h>
#include <glib/gstdio.h>
#ifndef _WIN32
diff --git a/qga/service-win32.c b/qga/service-win32.c
index 72437587b..fd434e3f4 100644
--- a/qga/service-win32.c
+++ b/qga/service-win32.c
@@ -11,7 +11,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include <glib.h>
#include <windows.h>
#include "qga/service-win32.h"
diff --git a/qga/service-win32.h b/qga/service-win32.h
index 3b9e87024..89e99dfed 100644
--- a/qga/service-win32.h
+++ b/qga/service-win32.h
@@ -10,8 +10,9 @@
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/
-#ifndef QGA_SERVICE_H
-#define QGA_SERVICE_H
+
+#ifndef QGA_SERVICE_WIN32_H
+#define QGA_SERVICE_WIN32_H
#include <windows.h>
diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index cd9cdb4a2..f4160a3a8 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -13,8 +13,7 @@
#include "qemu/osdep.h"
#include "vss-common.h"
-#include "inc/win2003/vscoordint.h"
-
+#include <inc/win2003/vscoordint.h>
#include <comadmin.h>
#include <wbemidl.h>
#include <comdef.h>
diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
index d977393e3..ef9466909 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 <inc/win2003/vscoordint.h>
+#include <inc/win2003/vsprov.h>
#define VSS_TIMEOUT_MSEC (60*1000)
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 889052ded..0cd2f0ee7 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -13,8 +13,8 @@
#include "qemu/osdep.h"
#include "vss-common.h"
#include "requester.h"
-#include "inc/win2003/vswriter.h"
-#include "inc/win2003/vsbackup.h"
+#include <inc/win2003/vswriter.h>
+#include <inc/win2003/vsbackup.h>
/* Max wait time for frozen event (VSS can only hold writes for 10 seconds) */
#define VSS_TIMEOUT_FREEZE_MSEC 10000
diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h
index 91dae0c38..c81a8564b 100644
--- a/qga/vss-win32/vss-common.h
+++ b/qga/vss-win32/vss-common.h
@@ -10,8 +10,8 @@
* See the COPYING file in the top-level directory.
*/
-#ifndef VSS_WIN32_H
-#define VSS_WIN32_H
+#ifndef VSS_COMMON_H
+#define VSS_COMMON_H
#define __MIDL_user_allocate_free_DEFINED__
#include <windows.h>
@@ -50,7 +50,7 @@
* 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 <inc/win2003/vss.h>
/* Macros to convert char definitions to wchar */
#define _L(a) L##a