qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL for-6.0 0/8] Block patches
@ 2021-05-24 13:00 Stefan Hajnoczi
  2021-05-24 13:00 ` [PULL for-6.0 1/8] multi-process: Initialize variables declared with g_auto* Stefan Hajnoczi
  2021-05-24 13:15 ` [PULL for-6.0 0/8] Block patches Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2021-05-24 13:00 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Fam Zheng, John G Johnson, Vladimir Sementsov-Ogievskiy,
	Jagannathan Raman, qemu-block, Juan Quintela, Stefan Weil,
	Michael S. Tsirkin, Dr. David Alan Gilbert, Elena Ufimtseva,
	Max Reitz, John Snow, Stefan Hajnoczi, Kevin Wolf,
	Eduardo Habkost

The following changes since commit 6c769690ac845fa62642a5f93b4e4bd906adab95:

  Merge remote-tracking branch 'remotes/vsementsov/tags/pull-simplebench-2021-05-04' into staging (2021-05-21 12:02:34 +0100)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 0a6f0c76a030710780ce10d6347a70f098024d21:

  coroutine-sleep: introduce qemu_co_sleep (2021-05-21 18:22:33 +0100)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Paolo Bonzini (6):
  coroutine-sleep: use a stack-allocated timer
  coroutine-sleep: disallow NULL QemuCoSleepState** argument
  coroutine-sleep: allow qemu_co_sleep_wake that wakes nothing
  coroutine-sleep: move timer out of QemuCoSleepState
  coroutine-sleep: replace QemuCoSleepState pointer with struct in the
    API
  coroutine-sleep: introduce qemu_co_sleep

Philippe Mathieu-Daudé (1):
  bitops.h: Improve find_xxx_bit() documentation

Zenghui Yu (1):
  multi-process: Initialize variables declared with g_auto*

 include/qemu/bitops.h       | 15 ++++++--
 include/qemu/coroutine.h    | 27 ++++++++-----
 block/block-copy.c          | 10 ++---
 block/nbd.c                 | 14 +++----
 hw/remote/memory.c          |  5 +--
 hw/remote/proxy.c           |  3 +-
 util/qemu-coroutine-sleep.c | 75 +++++++++++++++++++------------------
 7 files changed, 79 insertions(+), 70 deletions(-)

-- 
2.31.1


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

* [PULL for-6.0 1/8] multi-process: Initialize variables declared with g_auto*
  2021-05-24 13:00 [PULL for-6.0 0/8] Block patches Stefan Hajnoczi
@ 2021-05-24 13:00 ` Stefan Hajnoczi
  2021-05-24 13:15 ` [PULL for-6.0 0/8] Block patches Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2021-05-24 13:00 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Fam Zheng, John G Johnson, Vladimir Sementsov-Ogievskiy,
	Jagannathan Raman, qemu-block, Juan Quintela, Stefan Weil,
	Michael S. Tsirkin, Dr. David Alan Gilbert, Elena Ufimtseva,
	Max Reitz, John Snow, Stefan Hajnoczi, Zenghui Yu, Kevin Wolf,
	Philippe Mathieu-Daudé, Miroslav Rezanina, Eduardo Habkost

From: Zenghui Yu <yuzenghui@huawei.com>

Quote docs/devel/style.rst (section "Automatic memory deallocation"):

* Variables declared with g_auto* MUST always be initialized,
  otherwise the cleanup function will use uninitialized stack memory

Initialize @name properly to get rid of the compilation error (using
gcc-7.3.0 on CentOS):

../hw/remote/proxy.c: In function 'pci_proxy_dev_realize':
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   g_free (*pp);
   ^~~~~~~~~~~~
../hw/remote/proxy.c:350:30: note: 'name' was declared here
             g_autofree char *name;
                              ^~~~

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Reviewed-by: Jagannathan Raman <jag.raman@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com>
Message-id: 20210312112143.1369-1-yuzenghui@huawei.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/remote/memory.c | 5 ++---
 hw/remote/proxy.c  | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/remote/memory.c b/hw/remote/memory.c
index 2d4174614a..472ed2a272 100644
--- a/hw/remote/memory.c
+++ b/hw/remote/memory.c
@@ -41,10 +41,9 @@ void remote_sysmem_reconfig(MPQemuMsg *msg, Error **errp)
 
     remote_sysmem_reset();
 
-    for (region = 0; region < msg->num_fds; region++) {
-        g_autofree char *name;
+    for (region = 0; region < msg->num_fds; region++, suffix++) {
+        g_autofree char *name = g_strdup_printf("remote-mem-%u", suffix);
         subregion = g_new(MemoryRegion, 1);
-        name = g_strdup_printf("remote-mem-%u", suffix++);
         memory_region_init_ram_from_fd(subregion, NULL,
                                        name, sysmem_info->sizes[region],
                                        true, msg->fds[region],
diff --git a/hw/remote/proxy.c b/hw/remote/proxy.c
index 4fa4be079d..6dda705fc2 100644
--- a/hw/remote/proxy.c
+++ b/hw/remote/proxy.c
@@ -347,13 +347,12 @@ static void probe_pci_info(PCIDevice *dev, Error **errp)
                    PCI_BASE_ADDRESS_SPACE_IO : PCI_BASE_ADDRESS_SPACE_MEMORY;
 
         if (size) {
-            g_autofree char *name;
+            g_autofree char *name = g_strdup_printf("bar-region-%d", i);
             pdev->region[i].dev = pdev;
             pdev->region[i].present = true;
             if (type == PCI_BASE_ADDRESS_SPACE_MEMORY) {
                 pdev->region[i].memory = true;
             }
-            name = g_strdup_printf("bar-region-%d", i);
             memory_region_init_io(&pdev->region[i].mr, OBJECT(pdev),
                                   &proxy_mr_ops, &pdev->region[i],
                                   name, size);
-- 
2.31.1


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

* Re: [PULL for-6.0 0/8] Block patches
  2021-05-24 13:00 [PULL for-6.0 0/8] Block patches Stefan Hajnoczi
  2021-05-24 13:00 ` [PULL for-6.0 1/8] multi-process: Initialize variables declared with g_auto* Stefan Hajnoczi
@ 2021-05-24 13:15 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2021-05-24 13:15 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Fam Zheng, John G Johnson, Vladimir Sementsov-Ogievskiy,
	Jagannathan Raman, Eduardo Habkost, qemu-block, Juan Quintela,
	Stefan Weil, Michael S. Tsirkin, Dr. David Alan Gilbert,
	Elena Ufimtseva, Max Reitz, John Snow, Kevin Wolf

[-- Attachment #1: Type: text/plain, Size: 91 bytes --]

Please ignore. I resent the pull request with the proper subject line
and CC list.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-05-24 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24 13:00 [PULL for-6.0 0/8] Block patches Stefan Hajnoczi
2021-05-24 13:00 ` [PULL for-6.0 1/8] multi-process: Initialize variables declared with g_auto* Stefan Hajnoczi
2021-05-24 13:15 ` [PULL for-6.0 0/8] Block patches Stefan Hajnoczi

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