qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0
@ 2018-11-13  3:00 Michael Roth
  2018-11-13  3:00 ` [Qemu-devel] [PULL for-3.1 1/2] qga-win: fix leaks of build_guest_disk_info() Michael Roth
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Roth @ 2018-11-13  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

The following changes since commit 160e5c22e55b3f775c2003dfc626fa872ee4a7a1:

  Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (2018-11-09 10:54:10 +0000)

are available in the Git repository at:

  git://github.com/mdroth/qemu.git tags/qga-pull-2018-11-12-tag

for you to fetch changes up to 61baac2fdb7ad3891fb00bbd3c9e8b8ca87f0f62:

  qga: Add multiple include guard to guest-agent-core.h (2018-11-09 07:55:13 -0600)

----------------------------------------------------------------
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

----------------------------------------------------------------
Marc-André Lureau (1):
      qga-win: fix leaks of build_guest_disk_info()

Peter Maydell (1):
      qga: Add multiple include guard to guest-agent-core.h

 qga/commands-win32.c   | 5 ++++-
 qga/guest-agent-core.h | 5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL for-3.1 1/2] qga-win: fix leaks of build_guest_disk_info()
  2018-11-13  3:00 [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0 Michael Roth
@ 2018-11-13  3:00 ` Michael Roth
  2018-11-13  3:00 ` [Qemu-devel] [PULL for-3.1 2/2] qga: Add multiple include guard to guest-agent-core.h Michael Roth
  2018-11-13 13:36 ` [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Roth @ 2018-11-13  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Introduced in commit b1ba8890e63ce9432c41c5c3fc229f54c87c9c99, vol_h
handle should be closed, and "out" cleanup should be done after
DeviceIoControl() fails.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands-win32.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL for-3.1 2/2] qga: Add multiple include guard to guest-agent-core.h
  2018-11-13  3:00 [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0 Michael Roth
  2018-11-13  3:00 ` [Qemu-devel] [PULL for-3.1 1/2] qga-win: fix leaks of build_guest_disk_info() Michael Roth
@ 2018-11-13  3:00 ` Michael Roth
  2018-11-13 13:36 ` [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Roth @ 2018-11-13  3:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

From: Peter Maydell <peter.maydell@linaro.org>

The guest-agent-core.h header was missing the usual guards
against multiple inclusion; add them.

(Spotted by lgtm.com's static analyzer.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/guest-agent-core.h | 5 +++++
 1 file changed, 5 insertions(+)

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 */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0
  2018-11-13  3:00 [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0 Michael Roth
  2018-11-13  3:00 ` [Qemu-devel] [PULL for-3.1 1/2] qga-win: fix leaks of build_guest_disk_info() Michael Roth
  2018-11-13  3:00 ` [Qemu-devel] [PULL for-3.1 2/2] qga: Add multiple include guard to guest-agent-core.h Michael Roth
@ 2018-11-13 13:36 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2018-11-13 13:36 UTC (permalink / raw)
  To: Michael Roth; +Cc: QEMU Developers

On 13 November 2018 at 03:00, Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
> The following changes since commit 160e5c22e55b3f775c2003dfc626fa872ee4a7a1:
>
>   Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (2018-11-09 10:54:10 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/mdroth/qemu.git tags/qga-pull-2018-11-12-tag
>
> for you to fetch changes up to 61baac2fdb7ad3891fb00bbd3c9e8b8ca87f0f62:
>
>   qga: Add multiple include guard to guest-agent-core.h (2018-11-09 07:55:13 -0600)
>
> ----------------------------------------------------------------
> 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
>
> ----------------------------------------------------------------
> Marc-André Lureau (1):
>       qga-win: fix leaks of build_guest_disk_info()
>
> Peter Maydell (1):
>       qga: Add multiple include guard to guest-agent-core.h

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-13 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-13  3:00 [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0 Michael Roth
2018-11-13  3:00 ` [Qemu-devel] [PULL for-3.1 1/2] qga-win: fix leaks of build_guest_disk_info() Michael Roth
2018-11-13  3:00 ` [Qemu-devel] [PULL for-3.1 2/2] qga: Add multiple include guard to guest-agent-core.h Michael Roth
2018-11-13 13:36 ` [Qemu-devel] [PULL for-3.1 0/2] qemu-ga patch queue for 3.1.0 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).