aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-11-13 12:32:30 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-11-13 12:32:30 +0000
commit6ff144698935e8bdbc96d255cf49b1a7d54174ac (patch)
tree7d0cb6bb540bb4d38c553099b7f4d50937f8b3a7
parent186ac05f749c69e98030f037aa930ff2bc4ad7fb (diff)
parent61baac2fdb7ad3891fb00bbd3c9e8b8ca87f0f62 (diff)
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>
-rw-r--r--qga/commands-win32.c5
-rw-r--r--qga/guest-agent-core.h5
2 files changed, 9 insertions, 1 deletions
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index ef1d7d48d2..62e1b51dfe 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -797,7 +797,7 @@ static GuestDiskAddressList *build_guest_disk_info(char *guid, Error **errp)
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 @@ static GuestDiskAddressList *build_guest_disk_info(char *guid, Error **errp)
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 6f4d214cb9..60eae16f27 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 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp);
#ifndef _WIN32
void reopen_fd_to_null(int fd);
#endif
+
+#endif /* GUEST_AGENT_CORE_H */