Skip to contentSkip to conversation

Misc patches for 2016-10-31

GIT PULL Applied Paolo Bonzini 4 participants 8 messages Nov 2, 2016 – Nov 9, 2016

lore
Share & tools
lore
#0 lore raw

The following changes since commit 39542105bbb19c690219d2f22844d8dfbd9bba05:

Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (2016-11-01 12:48:07 +0000)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 7d175d29c9430fcba7a98f2c71925137b7870da4:

main-loop: Suppress I/O thread warning under qtest (2016-11-02 09:28:57 +0100)

----------------------------------------------------------------
* NBD bugfix (Changlong)
* NBD write zeroes support (Eric)
* Memory backend fixes (Haozhong)
* Atomics fix (Alex)
* New AVX512 features (Luwei)
* "make check" logging fix (Paolo)
* Chardev refactoring fallout (Paolo)
* Small checkpatch improvements (Paolo, Jeff)

----------------------------------------------------------------
Alex Bennée (1):
exec.c: ensure all AddressSpaceDispatch updates under RCU

Changlong Xie (1):
nbd: Use CoQueue for free_sema instead of CoMutex

Christian Borntraeger (1):
vl: exit qemu on guest panic if -no-shutdown is not set

Eric Blake (16):
nbd: Add qemu-nbd -D for human-readable description
nbd: Treat flags vs. command type as separate fields
nbd: Rename NBDRequest to NBDRequestData
nbd: Rename NbdClientSession to NBDClientSession
nbd: Rename struct nbd_request and nbd_reply
nbd: Share common reply-sending code in server
nbd: Send message along with server NBD_REP_ERR errors
nbd: Share common option-sending code in client
nbd: Let server know when client gives up negotiation
nbd: Let client skip portions of server reply
nbd: Less allocation during NBD_OPT_LIST
nbd: Support shorter handshake
nbd: Refactor conversion to errno to silence checkpatch
nbd: Improve server handling of shutdown requests
nbd: Implement NBD_CMD_WRITE_ZEROES on server
nbd: Implement NBD_CMD_WRITE_ZEROES on client

Haozhong Zhang (2):
exec.c: do not truncate non-empty memory backend file exec.c: check memory backend file size with 'size' option

Jeff Cody (1):
checkpatch: allow spaces before parenthesis for 'coroutine_fn'

Luwei Kang (1):

      x86: add AVX512_4VNNIW and AVX512_4FMAPS features

Max Reitz (1):
main-loop: Suppress I/O thread warning under qtest

Paolo Bonzini (5):
checkpatch: tweak "struct should normally be const" warning
qemu-error: remove dependency of stubs on monitor
tests: send error_report to test log
qemu-char: do not forward events through the mux until QEMU has started
slirp: fix CharDriver breakage

Pranith Kumar (1):
docs/rcu.txt: Fix minor typo

 block/nbd-client.c          | 104 +++++----
 block/nbd-client.h          |  12 +-
 block/nbd.c                 |   8 +-
 docs/rcu.txt                |   2 +-
 exec.c                      |  33 ++-
 include/block/nbd.h         |  73 +++++--
 include/glib-compat.h       |  13 ++
 include/qemu/error-report.h |   1 +
 include/qemu/osdep.h        |   3 +
 main-loop.c                 |   2 +-
 monitor.c                   |  21 ++
 nbd/client.c                | 498 ++++++++++++++++++++++++--------------------
 nbd/nbd-internal.h          |  12 +-
 nbd/server.c                | 292 ++++++++++++++++++--------
 net/slirp.c                 |   3 +-
 qapi-schema.json            |   4 +-
 qemu-char.c                 |   8 +-
 qemu-nbd.c                  |  12 +-
 qemu-nbd.texi               |   5 +-
 scripts/checkpatch.pl       |   6 +-
 stubs/Makefile.objs         |   2 +-
 stubs/error-printf.c        |  19 ++
 stubs/mon-printf.c          |  11 -
 target-i386/cpu.c           |  19 +-
 target-i386/cpu.h           |   4 +
 util/qemu-error.c           |  26 +--
 vl.c                        |   5 +
 27 files changed, 763 insertions(+), 435 deletions(-)
 create mode 100644 stubs/error-printf.c
 delete mode 100644 stubs/mon-printf.c
Signature · 1 line
2.7.4
#1 lore raw

[Qemu-devel] [PULL 07/30] exec.c: check memory backend file size with 'size' option

From: Haozhong Zhang <[email protected]>

If the memory backend file is not large enough to hold the required 'size', Qemu will report error and exit.

Message-Id: <[email protected]>

Message-Id: <[email protected]>

---
 exec.c | 7 +++++++
 1 file changed, 7 insertions(+)
exec.c +7 -0
index f471e73..f3c2770 100644
@@ -1321,6 +1321,13 @@ static void *file_ram_alloc(RAMBlock *block,
         goto error;
     }
 
+    if (file_size > 0 && file_size < memory) {
+        error_setg(errp, "backing store %s size 0x%" PRIx64
+                   " does not match 'size' option 0x" RAM_ADDR_FMT,
+                   path, file_size, memory);
+        goto error;
+    }
+
     memory = ROUND_UP(memory, block->page_size);
 
     /*
Signature · 1 line
2.7.4
#2 lore raw
In reply to Paolo Bonzini
Quoted 95 lines · Paolo Bonzini

The following changes since commit 39542105bbb19c690219d2f22844d8dfbd9bba05:

Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (2016-11-01 12:48:07 +0000)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 7d175d29c9430fcba7a98f2c71925137b7870da4:

main-loop: Suppress I/O thread warning under qtest (2016-11-02 09:28:57 +0100)

----------------------------------------------------------------
* NBD bugfix (Changlong)
* NBD write zeroes support (Eric)
* Memory backend fixes (Haozhong)
* Atomics fix (Alex)
* New AVX512 features (Luwei)
* "make check" logging fix (Paolo)
* Chardev refactoring fallout (Paolo)
* Small checkpatch improvements (Paolo, Jeff)

----------------------------------------------------------------
Alex Bennée (1):
exec.c: ensure all AddressSpaceDispatch updates under RCU

Changlong Xie (1):
nbd: Use CoQueue for free_sema instead of CoMutex

Christian Borntraeger (1):
vl: exit qemu on guest panic if -no-shutdown is not set

Eric Blake (16):
nbd: Add qemu-nbd -D for human-readable description
nbd: Treat flags vs. command type as separate fields
nbd: Rename NBDRequest to NBDRequestData
nbd: Rename NbdClientSession to NBDClientSession
nbd: Rename struct nbd_request and nbd_reply
nbd: Share common reply-sending code in server
nbd: Send message along with server NBD_REP_ERR errors
nbd: Share common option-sending code in client
nbd: Let server know when client gives up negotiation
nbd: Let client skip portions of server reply
nbd: Less allocation during NBD_OPT_LIST
nbd: Support shorter handshake
nbd: Refactor conversion to errno to silence checkpatch
nbd: Improve server handling of shutdown requests
nbd: Implement NBD_CMD_WRITE_ZEROES on server
nbd: Implement NBD_CMD_WRITE_ZEROES on client

Haozhong Zhang (2):
exec.c: do not truncate non-empty memory backend file exec.c: check memory backend file size with 'size' option

Jeff Cody (1):
checkpatch: allow spaces before parenthesis for 'coroutine_fn'

Luwei Kang (1):

      x86: add AVX512_4VNNIW and AVX512_4FMAPS features

Max Reitz (1):
main-loop: Suppress I/O thread warning under qtest

Paolo Bonzini (5):
checkpatch: tweak "struct should normally be const" warning
qemu-error: remove dependency of stubs on monitor
tests: send error_report to test log
qemu-char: do not forward events through the mux until QEMU has started
slirp: fix CharDriver breakage

Pranith Kumar (1):
docs/rcu.txt: Fix minor typo

 block/nbd-client.c          | 104 +++++----
 block/nbd-client.h          |  12 +-
 block/nbd.c                 |   8 +-
 docs/rcu.txt                |   2 +-
 exec.c                      |  33 ++-
 include/block/nbd.h         |  73 +++++--
 include/glib-compat.h       |  13 ++
 include/qemu/error-report.h |   1 +
 include/qemu/osdep.h        |   3 +
 main-loop.c                 |   2 +-
 monitor.c                   |  21 ++
 nbd/client.c                | 498 ++++++++++++++++++++++++--------------------
 nbd/nbd-internal.h          |  12 +-
 nbd/server.c                | 292 ++++++++++++++++++--------
 net/slirp.c                 |   3 +-
 qapi-schema.json            |   4 +-
 qemu-char.c                 |   8 +-
 qemu-nbd.c                  |  12 +-
 qemu-nbd.texi               |   5 +-
 scripts/checkpatch.pl       |   6 +-
 stubs/Makefile.objs         |   2 +-
 stubs/error-printf.c        |  19 ++
Quoted 12 lines
 stubs/mon-printf.c          |  11 -
 target-i386/cpu.c           |  19 +-
 target-i386/cpu.h           |   4 +
 util/qemu-error.c           |  26 +--
 vl.c                        |   5 +
 27 files changed, 763 insertions(+), 435 deletions(-)
 create mode 100644 stubs/error-printf.c
 delete mode 100644 stubs/mon-printf.c
Signature · 1 line
2.7.4

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Will be in qemu.git pending Travis-CI build tests.

Stefan

#3 lore raw
In reply to Paolo Bonzini
Quoted 32 lines · Paolo Bonzini

The following changes since commit 39542105bbb19c690219d2f22844d8dfbd9bba05:

Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (2016-11-01 12:48:07 +0000)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 7d175d29c9430fcba7a98f2c71925137b7870da4:

main-loop: Suppress I/O thread warning under qtest (2016-11-02 09:28:57 +0100)

----------------------------------------------------------------
* NBD bugfix (Changlong)
* NBD write zeroes support (Eric)
* Memory backend fixes (Haozhong)
* Atomics fix (Alex)
* New AVX512 features (Luwei)
* "make check" logging fix (Paolo)
* Chardev refactoring fallout (Paolo)
* Small checkpatch improvements (Paolo, Jeff)

----------------------------------------------------------------
Alex Bennée (1):
exec.c: ensure all AddressSpaceDispatch updates under RCU

Changlong Xie (1):
nbd: Use CoQueue for free_sema instead of CoMutex

Christian Borntraeger (1):
vl: exit qemu on guest panic if -no-shutdown is not set

Quoted 11 lines

Eric Blake (16):
nbd: Add qemu-nbd -D for human-readable description
nbd: Treat flags vs. command type as separate fields
nbd: Rename NBDRequest to NBDRequestData
nbd: Rename NbdClientSession to NBDClientSession
nbd: Rename struct nbd_request and nbd_reply
nbd: Share common reply-sending code in server
nbd: Send message along with server NBD_REP_ERR errors
nbd: Share common option-sending code in client
nbd: Let server know when client gives up negotiation
nbd: Let client skip portions of server reply

This patch (7d3123e1775) breaks iotest 083 (it hangs somewhere).

Max

#4 lore raw
Quoted 12 lines · Max Reitz
Quoted 11 lines

Eric Blake (16):
nbd: Add qemu-nbd -D for human-readable description
nbd: Treat flags vs. command type as separate fields
nbd: Rename NBDRequest to NBDRequestData
nbd: Rename NbdClientSession to NBDClientSession
nbd: Rename struct nbd_request and nbd_reply
nbd: Share common reply-sending code in server
nbd: Send message along with server NBD_REP_ERR errors
nbd: Share common option-sending code in client
nbd: Let server know when client gives up negotiation
nbd: Let client skip portions of server reply

Quoted 1 line

This patch (7d3123e1775) breaks iotest 083 (it hangs somewhere).

Bummer. I'll investigate and submit the correction patch. (I guess my usual './check -raw' and './check -qcow2' is insufficient since 83 is skipped for those cases; but I just confirmed the './check -nbd 83' hang)

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#5 lore raw
Quoted 14 lines · Eric Blake
Quoted 12 lines · Max Reitz
Quoted 11 lines

Eric Blake (16):
nbd: Add qemu-nbd -D for human-readable description
nbd: Treat flags vs. command type as separate fields
nbd: Rename NBDRequest to NBDRequestData
nbd: Rename NbdClientSession to NBDClientSession
nbd: Rename struct nbd_request and nbd_reply
nbd: Share common reply-sending code in server
nbd: Send message along with server NBD_REP_ERR errors
nbd: Share common option-sending code in client
nbd: Let server know when client gives up negotiation
nbd: Let client skip portions of server reply

Quoted 5 lines
Quoted 1 line

This patch (7d3123e1775) breaks iotest 083 (it hangs somewhere).

Bummer. I'll investigate and submit the correction patch. (I guess my usual './check -raw' and './check -qcow2' is insufficient since 83 is skipped for those cases; but I just confirmed the './check -nbd 83' hang)

Not only does it hang, but hitting ^C to kill it leaves the terminal in a weird state, where I had to use 'stty sane' to get my cursor back.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#6 lore raw
In reply to Max Reitz
Quoted 3 lines · Max Reitz
Quoted 1 line

nbd: Let client skip portions of server reply

This patch (7d3123e1775) breaks iotest 083 (it hangs somewhere).

Adding this breaks the infinite loop:

nbd/client.c +1 -0
index 5d94e34..23ad4f1 100644
@@ -87,10 +87,11 @@ static ssize_t drop_sync(QIOChannel *ioc, size_t size)
     while (size > 0) {
         ret = read_sync(ioc, buffer, MIN(65536, size));
         if (ret < 0) {
             goto cleanup;
         }
+        assert(ret);
         assert(ret <= size);
         size -= ret;
     }
     ret = dropped;
 

but then fails the assertion, which means read_sync() is returning 0 in our particular test (which sort of makes sense: the test is purposefully truncating the server stream at various points to see how the client reacts). I'm trying to figure out if always treating early EOF as a read error would be sufficient to make things work the way we want in the client.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#7 lore raw
Quoted 7 lines

but then fails the assertion, which means read_sync() is returning 0 in our particular test (which sort of makes sense: the test is purposefully truncating the server stream at various points to see how the client reacts). I'm trying to figure out if always treating early EOF as a read error would be sufficient to make things work the way we want in the client.

Yeah, early EOF should become ESHUTDOWN, ECONNRESET or similar.

Paolo