Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2018-11-12-tag' into staging
qemu-ga patch queue for 3.1.0
* add missing #include guards for guest-agent-core.h
* fix leaks introduced with recent win32 enablement of disk info in
guest-get-fsinfo
# gpg: Signature made Tue 13 Nov 2018 02:52:12 GMT
# gpg: using RSA key 3353C9CEF108B584
# 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>"
# Primary key fingerprint: CEAC C9E1 5534 EBAB B82D 3FA0 3353 C9CE F108 B584
* remotes/mdroth/tags/qga-pull-2018-11-12-tag:
qga: Add multiple include guard to guest-agent-core.h
qga-win: fix leaks of build_guest_disk_info()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index ef1d7d4..62e1b51 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -797,7 +797,7 @@
0, extents, size, NULL, NULL)) {
error_setg_win32(errp, GetLastError(),
"failed to get disk extents");
- return NULL;
+ goto out;
}
} else if (last_err == ERROR_INVALID_FUNCTION) {
/* Possibly CD-ROM or a shared drive. Try to pass the volume */
@@ -855,6 +855,9 @@
out:
+ if (vol_h != INVALID_HANDLE_VALUE) {
+ CloseHandle(vol_h);
+ }
qapi_free_GuestDiskAddress(disk);
g_free(extents);
g_free(name);
diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h
index 6f4d214..60eae16 100644
--- a/qga/guest-agent-core.h
+++ b/qga/guest-agent-core.h
@@ -10,6 +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 GUEST_AGENT_CORE_H
+#define GUEST_AGENT_CORE_H
+
#include "qapi/qmp/dispatch.h"
#include "qemu-common.h"
#include "qga-qapi-types.h"
@@ -46,3 +49,5 @@
#ifndef _WIN32
void reopen_fd_to_null(int fd);
#endif
+
+#endif /* GUEST_AGENT_CORE_H */