Skip to contentSkip to conversation

QAPI and misc patches for 2.12-rc2

GIT PULL Eric Blake 1 participant 5 messages Apr 3, 2018 – Apr 4, 2018

lore
Share & tools
lore

Eric Blake

author
#0 lore raw

The following changes since commit 13b65ec54dbf524cb62331281a98b432f78d4e3a:

Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-04-02' into staging (2018-04-03 15:59:50 +0100)

are available in the Git repository at:

git://repo.or.cz/qemu/ericb.git tags/pull-qapi-2018-04-03

for you to fetch changes up to 1ecaef92a1d158bd875bf66091325d4721eb2762:

dump: Fix build with newer gcc (2018-04-03 13:47:08 -0500)

----------------------------------------------------------------
qapi and misc patches for 2018-04-03

- Peter Xu: monitor: bind dispatch bh to iohandler context
- Eric Blake: maint: Add .mailmap entries for patches claiming list authorship
- Eric Blake: dump: Fix build with newer gcc

----------------------------------------------------------------
Eric Blake (2):
maint: Add .mailmap entries for patches claiming list authorship
dump: Fix build with newer gcc

Peter Xu (1):
monitor: bind dispatch bh to iohandler context

 dump.c    |  4 ++--
 monitor.c |  2 +-
 .mailmap  | 18 ++++++++++++++----
 3 files changed, 17 insertions(+), 7 deletions(-)
Signature · 1 line
2.14.3
author
#1 lore raw

[Qemu-devel] [PULL 1/3] monitor: bind dispatch bh to iohandler context

From: Peter Xu <[email protected]>

Eric Auger reported the problem days ago that OOB broke ARM when running with libvirt:

http://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06231.html

This patch fixes the problem.

It's not really needed now since we have turned OOB off now, but it's still a bug fix, and it'll start to work when we turn OOB on for ARM.

The problem was that the monitor dispatcher bottom half was bound to qemu_aio_context, but that context seems to be for block only. For the rest of the QEMU world we should be using iohandler context. So assign the monitor dispatcher bottom half to that context.

Without this change, the QMP dispatcher might be run even before reaching the main loop in a block IO path, for example, in a stack like:

        #0  qmp_cont ()
        #1  0x00000000006bd210 in qmp_marshal_cont ()
        #2  0x0000000000ac05c4 in do_qmp_dispatch ()
        #3  0x0000000000ac07a0 in qmp_dispatch ()
        #4  0x0000000000472d60 in monitor_qmp_dispatch_one ()
        #5  0x000000000047302c in monitor_qmp_bh_dispatcher ()
        #6  0x0000000000acf374 in aio_bh_call ()
        #7  0x0000000000acf428 in aio_bh_poll ()
        #8  0x0000000000ad5110 in aio_poll ()
        #9  0x0000000000a08ab8 in blk_prw ()
        #10 0x0000000000a091c4 in blk_pread ()
        #11 0x0000000000734f94 in pflash_cfi01_realize ()
        #12 0x000000000075a3a4 in device_set_realized ()
        #13 0x00000000009a26cc in property_set_bool ()
        #14 0x00000000009a0a40 in object_property_set ()
        #15 0x00000000009a3a08 in object_property_set_qobject ()
        #16 0x00000000009a0c8c in object_property_set_bool ()
        #17 0x0000000000758f94 in qdev_init_nofail ()
        #18 0x000000000058e190 in create_one_flash ()
        #19 0x000000000058e2f4 in create_flash ()
        #20 0x00000000005902f0 in machvirt_init ()
        #21 0x00000000007635cc in machine_run_board_init ()
        #22 0x00000000006b135c in main ()

This can cause ARM to crash when used with both OOB capability enabled and libvirt as upper layer, since libvirt will start QEMU with "-S" and the first "cont" command will arrive very early if the context is not correct (which is what above stack shows). Then, the vcpu threads will start to run right after the qmp_cont() call, even when GICs have not been setup correctly yet (which is done in kvm_arm_machine_init_done()).

My sincere thanks to Eric Auger who offered great help during both debugging and verifying the problem. The ARM test was carried out by applying this patch upon QEMU 2.12.0-rc0 and problem is gone after the patch.

A quick test of mine shows that after this patch is applied we can pass all raw iotests even with OOB on by default.

CC Eric Blake <[email protected]>
CC Markus Armbruster <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC Fam Zheng <[email protected]>

Message-Id: <[email protected]>

---
 monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
monitor.c +1 -1
index 51f4cf480f8..39f8ee17ba7 100644
@@ -4467,7 +4467,7 @@ static void monitor_iothread_init(void)
      * have assumption to be run on main loop thread.  It would be
      * nice that one day we can remove this assumption in the future.
      */
-    mon_global.qmp_dispatcher_bh = aio_bh_new(qemu_get_aio_context(),
+    mon_global.qmp_dispatcher_bh = aio_bh_new(iohandler_get_aio_context(),
                                               monitor_qmp_bh_dispatcher,
                                               NULL);
 
Signature · 1 line
2.14.3
author
#2 lore raw

[Qemu-devel] [PULL 2/3] maint: Add .mailmap entries for patches claiming list authorship

In reply to Eric Blake

The list did not author any patches, but it does rewrite the 'From:' header of messages sent from any domain with restrictive SPF policies that would otherwise prevent the message from reaching all list recipients. If a maintainer is not careful to undo the list header rewrite, and the author did not include a manual 'From:' line in the body to fix the munged header, then 'git am' happily attributes the patch to the list. Add some mailmap entries to correct the few that have escaped our attention; while we also work on improving the tooling to catch the problem in the future before a merge is even made.

Also improve the comments occurring in the file, including line length improvements.

Message-Id: <[email protected]>

---
 .mailmap | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
.mailmap +14 -4
index cf689b9ec99..778a4d4e2c7 100644
@@ -1,6 +1,7 @@
-# This mailmap just translates the weird addresses from the original import into git
-# into proper addresses so that they are counted properly in git shortlog output.
-#
+# This mailmap fixes up author names/addresses.
+
+# The first section translates weird addresses from the original git import
+# into proper addresses so that they are counted properly by git shortlog.
 Andrzej Zaborowski <[email protected]> balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
 Anthony Liguori <[email protected]> aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
 Anthony Liguori <[email protected]> Anthony Liguori <[email protected]>
@@ -15,10 +16,19 @@ Paul Burton <[email protected]> <[email protected]>
 Paul Burton <[email protected]> <[email protected]>
 Thiemo Seufer <[email protected]> ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
 malc <[email protected]> malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
+
 # There is also a:
 #    (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162>
 # for the cvs2svn initialization commit e63c3dc74bf.
-#
+
+# Next, translate a few commits where mailman rewrote the From: line due
+# to strict SPF, although we prefer to avoid adding more entries like that.
+Ed Swierk <[email protected]> Ed Swierk via Qemu-devel <[email protected]>
+Ian McKellar <[email protected]> Ian McKellar via Qemu-devel <[email protected]>
+Julia Suvorova <[email protected]> Julia Suvorova via Qemu-devel <[email protected]>
+Justin Terry (VM) <[email protected]> Justin Terry (VM) via Qemu-devel <[email protected]>
+
+
 # Also list preferred name forms where people have changed their
 # git author config
 Daniel P. Berrangé <[email protected]>
Signature · 1 line
2.14.3
author
#3 lore raw

[Qemu-devel] [PULL 3/3] dump: Fix build with newer gcc

In reply to Eric Blake

gcc 8 on rawhide is picky enough to complain:

/home/dummy/qemu/dump.c: In function 'create_header32':
/home/dummy/qemu/dump.c:817:5: error: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Werror=stringop-truncation]

     strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But we already have SIG_LEN defined as the right length without needing to do a strlen(), and memcpy() is better than strncpy() when we know we do not want a trailing NUL byte.

Message-Id: <[email protected]>

---
 dump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
dump.c +2 -2
index 669f715274d..b54cd42b217 100644
@@ -814,7 +814,7 @@ static void create_header32(DumpState *s, Error **errp)
     size = sizeof(DiskDumpHeader32);
     dh = g_malloc0(size);
 
-    strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
+    memcpy(dh->signature, KDUMP_SIGNATURE, SIG_LEN);
     dh->header_version = cpu_to_dump32(s, 6);
     block_size = s->dump_info.page_size;
     dh->block_size = cpu_to_dump32(s, block_size);
@@ -926,7 +926,7 @@ static void create_header64(DumpState *s, Error **errp)
     size = sizeof(DiskDumpHeader64);
     dh = g_malloc0(size);
 
-    strncpy(dh->signature, KDUMP_SIGNATURE, strlen(KDUMP_SIGNATURE));
+    memcpy(dh->signature, KDUMP_SIGNATURE, SIG_LEN);
     dh->header_version = cpu_to_dump32(s, 6);
     block_size = s->dump_info.page_size;
     dh->block_size = cpu_to_dump32(s, block_size);
Signature · 1 line
2.14.3
author
#4 lore raw
In reply to Eric Blake
Quoted 11 lines · Eric Blake

The following changes since commit 13b65ec54dbf524cb62331281a98b432f78d4e3a:

Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-04-02' into staging (2018-04-03 15:59:50 +0100)

are available in the Git repository at:

git://repo.or.cz/qemu/ericb.git tags/pull-qapi-2018-04-03

for you to fetch changes up to 1ecaef92a1d158bd875bf66091325d4721eb2762:

dump: Fix build with newer gcc (2018-04-03 13:47:08 -0500)

v2 pull request sent to add one more patch

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org