Skip to contentSkip to conversation

Trivial patches for 2017-06-04

GIT PULL Michael Tokarev 2 participants 24 messages Jun 4, 2017 – Jun 5, 2017

lore
Share & tools
lore
#0 lore raw

Trivial patches for 04 Jun 2017. Please consider applying.

/mjt

The following changes since commit c6e84fbd447a51e1161d74d71566a5f67b47eac5:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2017-06-02 17:46:22 +0100)

are available in the git repository at:

git://git.corpit.ru/qemu.git tags/trivial-patches-fetch

for you to fetch changes up to 070ccceda3b23f85d048bbcf3c0040252a9a793a:

hw/core: nmi.c can be compiled as common-obj nowadays (2017-06-04 18:43:09 +0300)

----------------------------------------------------------------
trivial patches for 2017-06-04

----------------------------------------------------------------
Eric Blake (2):
block: Correct documentation for BLOCK_WRITE_THRESHOLD
qapi: Fix some QMP documentation regressions

John Snow (1):
ide-test: check return of fwrite

Juan Quintela (1):
trivial: Remove unneeded ifndef in memory.h

Kamil Rytarowski (2):
configure: Detect native NetBSD curses(3)
ivshmem-server: ivshmem-client: Build when eventfd() is available

Luc MICHEL (1):
target/arm: add data cache invalidation cp15 instruction to cortex-r5

Mao Zhongyi (1):
scsi/lsi53c895a: Remove unused lsi_mem_*() return value

Marc-André Lureau (2):
qemu-ga: remove useless allocation
dump: fix memory_mapping_filter leak

Markus Armbruster (2):
docs qemu-doc: Avoid ide-drive, it's deprecated docs/qdev-device-use.txt: update section Default Devices

Max Filippov (1):
hw/xtensa: sim: use g_string/g_new

Paolo Bonzini (1):
altera_timer: fix incorrect memset

Philippe Mathieu-Daudé (3):
hw/sparc: use ARRAY_SIZE() macro
register: display register prefix (name) since it is available hw/mips: add missing include

Suraj Jitindar Singh (1):
help: Add newline to end of thread option help text

Thomas Huth (4):
qemu-doc: Move the qemu-ga description into a separate chapter
qemu-doc: Add hyperlinks to further license information tests/libqtest: Print error instead of aborting when env variable is missing hw/core: nmi.c can be compiled as common-obj nowadays

 configure                            |  5 +++--
 contrib/ivshmem-client/Makefile.objs |  2 +-
 contrib/ivshmem-server/Makefile.objs |  2 +-
 docs/bootindex.txt                   |  2 +-
 docs/qdev-device-use.txt             | 13 +++++++------
 hw/core/Makefile.objs                |  2 +-
 hw/core/register.c                   |  8 ++++----
 hw/scsi/lsi53c895a.c                 | 10 ++++------
 hw/sparc64/sun4u.c                   |  2 +-
 hw/timer/altera_timer.c              |  2 +-
 hw/xtensa/sim.c                      | 10 +++++-----
 include/exec/memory.h                |  2 --
 include/hw/mips/mips.h               |  1 +
 memory_mapping.c                     |  1 +
 qapi/block-core.json                 | 30 +++++++++++++++---------------
 qapi/block.json                      |  2 +-
 qemu-doc.texi                        | 21 +++++++++++----------
 qemu-options.hx                      |  4 ++--
 qga/commands-posix.c                 |  4 +---
 target/arm/cpu.c                     |  2 ++
 tests/ide-test.c                     |  8 ++++++--
 tests/libqtest.c                     |  5 ++++-
 22 files changed, 73 insertions(+), 65 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 02/22] qemu-doc: Add hyperlinks to further license information

From: Thomas Huth <[email protected]>

Add a link to the GPLv2 and a link to the LICENSE file in the QEMU repository to fix the two TODO items in this appendix.

---
 qemu-doc.texi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
qemu-doc.texi +4 -4
index 3f4ed0aa9a..965ba5929e 100644
@@ -3021,10 +3021,10 @@ Run the emulation in single step mode.
 
 QEMU is a trademark of Fabrice Bellard.
 
-QEMU is released under the GNU General Public License (TODO: add link).
-Parts of QEMU have specific licenses, see file LICENSE.
-
-TODO (refer to file LICENSE, include it, include the GPL?)
+QEMU is released under the
+@url{https://www.gnu.org/licenses/gpl-2.0.txt,GNU General Public License},
+version 2. Parts of QEMU have specific licenses, see file
+@url{http://git.qemu.org/?p=qemu.git;a=blob_plain;f=LICENSE,LICENSE}.
 
 @node Index
 @appendix Index
Signature · 1 line
2.11.0
#2 lore raw

[Qemu-devel] [PULL 08/22] trivial: Remove unneeded ifndef in memory.h

In reply to Michael Tokarev

From: Juan Quintela <[email protected]>

All the file is surounded already by #ifndef CONFIG_USER_ONLY.

---
 include/exec/memory.h | 2 --
 1 file changed, 2 deletions(-)
include/exec/memory.h +0 -2
index bfdc685f24..80e605a96a 100644
@@ -17,9 +17,7 @@
 #ifndef CONFIG_USER_ONLY
 
 #include "exec/cpu-common.h"
-#ifndef CONFIG_USER_ONLY
 #include "exec/hwaddr.h"
-#endif
 #include "exec/memattrs.h"
 #include "exec/ramlist.h"
 #include "qemu/queue.h"
Signature · 1 line
2.11.0
#3 lore raw

[Qemu-devel] [PULL 05/22] tests/libqtest: Print error instead of aborting when env variable is missing

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

When you currently try to run a test directly from the command line without setting the QTEST_QEMU_BINARY environment variable first, you are presented with an unhelpful assertion message like this:

ERROR:tests/libqtest.c:163:qtest_init_without_qmp_handshake:
assertion failed: (qemu_binary != NULL)
Aborted (core dumped)

Let's replace the assert() with a more user friendly error message instead.

---
 tests/libqtest.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/libqtest.c +4 -1
index 84ecbd2bd8..4a5492a603 100644
@@ -160,7 +160,10 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args)
     const char *qemu_binary;
 
     qemu_binary = getenv("QTEST_QEMU_BINARY");
-    g_assert(qemu_binary != NULL);
+    if (!qemu_binary) {
+        fprintf(stderr, "Environment variable QTEST_QEMU_BINARY required\n");
+        exit(1);
+    }
 
     s = g_malloc(sizeof(*s));
 
Signature · 1 line
2.11.0
#4 lore raw

[Qemu-devel] [PULL 10/22] target/arm: add data cache invalidation cp15 instruction to cortex-r5

In reply to Michael Tokarev

From: Luc MICHEL <[email protected]>

The cp15, CRn=15, opc1=0, CRm=5, opc2=0 instruction invalidates all the data cache on the cortex-r5. Implementing it as a NOP.

---
 target/arm/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
target/arm/cpu.c +2 -0
index e748097860..04a3fea03f 100644
@@ -1082,6 +1082,8 @@ static const ARMCPRegInfo cortexr5_cp_reginfo[] = {
       .access = PL1_RW, .type = ARM_CP_CONST },
     { .name = "BTCM", .cp = 15, .opc1 = 0, .crn = 9, .crm = 1, .opc2 = 1,
       .access = PL1_RW, .type = ARM_CP_CONST },
+    { .name = "DCACHE_INVAL", .cp = 15, .opc1 = 0, .crn = 15, .crm = 5,
+      .opc2 = 0, .access = PL1_W, .type = ARM_CP_NOP },
     REGINFO_SENTINEL
 };
 
Signature · 1 line
2.11.0
#5 lore raw

[Qemu-devel] [PULL 07/22] altera_timer: fix incorrect memset

In reply to Michael Tokarev

From: Paolo Bonzini <[email protected]>

Use sizeof instead of ARRAY_SIZE, fixing -Wmemset-elt-size with recent GCC versions.

---
 hw/timer/altera_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/timer/altera_timer.c +1 -1
index 6d4862661d..c9a0fc5dca 100644
@@ -204,7 +204,7 @@ static void altera_timer_reset(DeviceState *dev)
 
     ptimer_stop(t->ptimer);
     ptimer_set_limit(t->ptimer, 0xffffffff, 1);
-    memset(t->regs, 0, ARRAY_SIZE(t->regs));
+    memset(t->regs, 0, sizeof(t->regs));
 }
 
 static Property altera_timer_properties[] = {
Signature · 1 line
2.11.0
#6 lore raw

[Qemu-devel] [PULL 22/22] hw/core: nmi.c can be compiled as common-obj nowadays

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

The target-specific code in nmi.c has been removed with this commit:

	commit f7e981f29548fe4af7812f5920304fe607e5bf0d
	nmi: remove x86 specific nmi handling
---
 hw/core/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/core/Makefile.objs +1 -1
index 91450b2eab..f8d7a4aaed 100644
@@ -5,7 +5,7 @@ common-obj-y += fw-path-provider.o
 # irq.o needed for qdev GPIO handling:
 common-obj-y += irq.o
 common-obj-y += hotplug.o
-obj-y += nmi.o
+common-obj-y += nmi.o
 
 common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
 common-obj-$(CONFIG_XILINX_AXI) += stream.o
Signature · 1 line
2.11.0
#7 lore raw

[Qemu-devel] [PULL 14/22] hw/mips: add missing include

In reply to Michael Tokarev

From: Philippe Mathieu-Daudé <[email protected]>

---
 include/hw/mips/mips.h | 1 +
 1 file changed, 1 insertion(+)
include/hw/mips/mips.h +1 -0
index e0065ce808..16412dc150 100644
@@ -6,6 +6,7 @@
 #define INITRD_PAGE_MASK (~((1 << 16) - 1))
 
 #include "exec/memory.h"
+#include "hw/irq.h"
 
 /* gt64xxx.c */
 PCIBus *gt64120_register(qemu_irq *pic);
Signature · 1 line
2.11.0
#8 lore raw

[Qemu-devel] [PULL 01/22] qemu-doc: Move the qemu-ga description into a separate chapter

In reply to Michael Tokarev

From: Thomas Huth <[email protected]>

The qemu-ga description is currently a subsection of the Disk Images chapter - which does not make much sense since the qemu-ga is not directly related to disk images. So let's move this information into a separate chapter instead.

---
 qemu-doc.texi | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
qemu-doc.texi +7 -6
index de0cc30790..3f4ed0aa9a 100644
@@ -34,6 +34,7 @@
 * Introduction::
 * QEMU PC System emulator::
 * QEMU System emulator for non PC targets::
+* QEMU Guest Agent::
 * QEMU User space emulator::
 * Implementation notes::
 * License::
@@ -396,7 +397,6 @@ snapshots.
 * vm_snapshots::              VM snapshots
 * qemu_img_invocation::       qemu-img Invocation
 * qemu_nbd_invocation::       qemu-nbd Invocation
-* qemu_ga_invocation::        qemu-ga Invocation
 * disk_images_formats::       Disk image file formats
 * host_drives::               Using host drives
 * disk_images_fat_images::    Virtual FAT disk images
@@ -490,11 +490,6 @@ state is not saved or restored properly (in particular USB).
 
 @include qemu-nbd.texi
 
-@node qemu_ga_invocation
-@subsection @code{qemu-ga} Invocation
-
-@include qemu-ga.texi
-
 @node disk_images_formats
 @subsection Disk image file formats
 
@@ -2685,6 +2680,12 @@ Note that this allows guest direct access to the host filesystem,
 so should only be used with trusted guest OS.
 
 @end table
+
+@node QEMU Guest Agent
+@chapter QEMU Guest Agent invocation
+
+@include qemu-ga.texi
+
 @node QEMU User space emulator
 @chapter QEMU User space emulator
 
Signature · 1 line
2.11.0
#9 lore raw

[Qemu-devel] [PULL 19/22] ide-test: check return of fwrite

In reply to Michael Tokarev

From: John Snow <[email protected]>

To quiet patchew, add an assert for fwrite's return value.

---
 tests/ide-test.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tests/ide-test.c +6 -2
index 139ebc0ec6..bfd79ddbdc 100644
@@ -796,11 +796,13 @@ static void cdrom_pio_impl(int nblocks)
     int i, j;
     uint8_t data;
     uint16_t limit;
+    size_t ret;
 
     /* Prepopulate the CDROM with an interesting pattern */
     generate_pattern(pattern, patt_len, ATAPI_BLOCK_SIZE);
     fh = fopen(tmp_path, "w+");
-    fwrite(pattern, ATAPI_BLOCK_SIZE, patt_blocks, fh);
+    ret = fwrite(pattern, ATAPI_BLOCK_SIZE, patt_blocks, fh);
+    g_assert_cmpint(ret, ==, patt_blocks);
     fclose(fh);
 
     ide_test_start("-drive if=none,file=%s,media=cdrom,format=raw,id=sr0,index=0 "
@@ -880,6 +882,7 @@ static void test_cdrom_pio_large(void)
 static void test_cdrom_dma(void)
 {
     static const size_t len = ATAPI_BLOCK_SIZE;
+    size_t ret;
     char *pattern = g_malloc(ATAPI_BLOCK_SIZE * 16);
     char *rx = g_malloc0(len);
     uintptr_t guest_buf;
@@ -896,7 +899,8 @@ static void test_cdrom_dma(void)
 
     generate_pattern(pattern, ATAPI_BLOCK_SIZE * 16, ATAPI_BLOCK_SIZE);
     fh = fopen(tmp_path, "w+");
-    fwrite(pattern, ATAPI_BLOCK_SIZE, 16, fh);
+    ret = fwrite(pattern, ATAPI_BLOCK_SIZE, 16, fh);
+    g_assert_cmpint(ret, ==, 16);
     fclose(fh);
 
     send_dma_request(CMD_PACKET, 0, 1, prdt, 1, send_scsi_cdb_read10);
Signature · 1 line
2.11.0
#10 lore raw

[Qemu-devel] [PULL 17/22] qemu-ga: remove useless allocation

In reply to Michael Tokarev

From: Marc-André Lureau <[email protected]>

There is no need to duplicate a fixed string.

---
 qga/commands-posix.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
qga/commands-posix.c +1 -3
index 284ecc6d7e..d8e412275e 100644
@@ -2197,12 +2197,10 @@ static void transfer_memory_block(GuestMemoryBlock *mem_blk, bool sys2memblk,
         }
     } else {
         if (mem_blk->online != (strncmp(status, "online", 6) == 0)) {
-            char *new_state = mem_blk->online ? g_strdup("online") :
-                                                g_strdup("offline");
+            const char *new_state = mem_blk->online ? "online" : "offline";
 
             ga_write_sysfs_file(dirfd, "state", new_state, strlen(new_state),
                                 &local_err);
-            g_free(new_state);
             if (local_err) {
                 error_free(local_err);
                 result->response =
Signature · 1 line
2.11.0
#11 lore raw

[Qemu-devel] [PULL 11/22] hw/xtensa: sim: use g_string/g_new

In reply to Michael Tokarev

From: Max Filippov <[email protected]>

Replace malloc/free/sprintf with g_string/g_string_printf/g_string_free. Replace g_malloc with g_new when allocating the MemoryRegion to get more type safety.

---
 hw/xtensa/sim.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
hw/xtensa/sim.c +5 -5
index d2d1d3a6fd..b27e28d802 100644
@@ -41,21 +41,21 @@ static void xtensa_create_memory_regions(const XtensaMemory *memory,
                                          const char *name)
 {
     unsigned i;
-    char *num_name = malloc(strlen(name) + sizeof(i) * 3 + 1);
+    GString *num_name = g_string_new(NULL);
 
     for (i = 0; i < memory->num; ++i) {
         MemoryRegion *m;
 
-        sprintf(num_name, "%s%u", name, i);
-        m = g_malloc(sizeof(*m));
-        memory_region_init_ram(m, NULL, num_name,
+        g_string_printf(num_name, "%s%u", name, i);
+        m = g_new(MemoryRegion, 1);
+        memory_region_init_ram(m, NULL, num_name->str,
                                memory->location[i].size,
                                &error_fatal);
         vmstate_register_ram_global(m);
         memory_region_add_subregion(get_system_memory(),
                                     memory->location[i].addr, m);
     }
-    free(num_name);
+    g_string_free(num_name, true);
 }
 
 static uint64_t translate_phys_addr(void *opaque, uint64_t addr)
Signature · 1 line
2.11.0
#12 lore raw

[Qemu-devel] [PULL 03/22] docs qemu-doc: Avoid ide-drive, it's deprecated

In reply to Michael Tokarev

From: Markus Armbruster <[email protected]>

---
 docs/bootindex.txt       | 2 +-
 docs/qdev-device-use.txt | 4 ++--
 qemu-options.hx          | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
docs/bootindex.txt +1 -1
index b9a8ba122f..6937862ba0 100644
@@ -13,7 +13,7 @@ Let's assume we have a QEMU machine with two NICs (virtio, e1000) and two
 disks (IDE, virtio):
 
 qemu -drive file=disk1.img,if=none,id=disk1
-     -device ide-drive,drive=disk1,bootindex=4
+     -device ide-hd,drive=disk1,bootindex=4
      -drive file=disk2.img,if=none,id=disk2
      -device virtio-blk-pci,drive=disk2,bootindex=3
      -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0,bootindex=2
docs/qdev-device-use.txt +2 -2
index 4274fe9f25..95a0c3ae55 100644
@@ -31,8 +31,8 @@ A QEMU block device (drive) has a host and a guest part.
 
 In the general case, the guest device is connected to a controller
 device.  For instance, the IDE controller provides two IDE buses, each
-of which can have up to two ide-drive devices, and each ide-drive
-device is a guest part, and is connected to a host part.
+of which can have up to two devices, and each device is a guest part,
+and is connected to a host part.
 
 Except we sometimes lump controller, bus(es) and drive device(s) all
 together into a single device.  For instance, the ISA floppy
qemu-options.hx +1 -1
index a6c9b9e763..10995dc932 100644
@@ -262,7 +262,7 @@ STEXI
 Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:
 
 @example
-qemu-system-i386 -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk
+qemu-system-i386 -global ide-hd.physical_block_size=4096 disk-image.img
 @end example
 
 In particular, you can use this to set driver properties for devices which are 
Signature · 1 line
2.11.0
#13 lore raw

[Qemu-devel] [PULL 20/22] dump: fix memory_mapping_filter leak

In reply to Michael Tokarev

From: Marc-André Lureau <[email protected]>

Spotted by ASAN.

---
 memory_mapping.c | 1 +
 1 file changed, 1 insertion(+)
memory_mapping.c +1 -0
index 6a39d71da2..a5d38552a6 100644
@@ -337,6 +337,7 @@ void memory_mapping_filter(MemoryMappingList *list, int64_t begin,
         if (cur->phys_addr >= begin + length ||
             cur->phys_addr + cur->length <= begin) {
             QTAILQ_REMOVE(&list->head, cur, next);
+            g_free(cur);
             list->num--;
             continue;
         }
Signature · 1 line
2.11.0
#14 lore raw

[Qemu-devel] [PULL 04/22] docs/qdev-device-use.txt: update section Default Devices

In reply to Michael Tokarev

From: Markus Armbruster <[email protected]>

Resynchronize the table of default device suppressions with vl.c's default_list[].

---
 docs/qdev-device-use.txt | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
docs/qdev-device-use.txt +5 -4
index 95a0c3ae55..1f297b5e9c 100644
@@ -399,12 +399,13 @@ type.
 some DEVNAMEs:
 
     default device      suppressing DEVNAMEs
-    CD-ROM              ide-cd, ide-drive, scsi-cd
-    isa-fdc's driveA    isa-fdc
+    CD-ROM              ide-cd, ide-drive, ide-hd, scsi-cd, scsi-hd
+    isa-fdc's driveA    floppy, isa-fdc
     parallel            isa-parallel
     serial              isa-serial
-    VGA                 VGA, cirrus-vga, vmware-svga
-    virtioconsole       virtio-serial-pci, virtio-serial-s390, virtio-serial
+    VGA                 VGA, cirrus-vga, isa-vga, isa-cirrus-vga,
+                        vmware-svga, qxl-vga, virtio-vga
+    virtioconsole       virtio-serial-pci, virtio-serial
 
 The default NIC is connected to a default part created along with it.
 It is *not* suppressed by configuring a NIC with -device (you may call
Signature · 1 line
2.11.0
#15 lore raw

[Qemu-devel] [PULL 13/22] register: display register prefix (name) since it is available

In reply to Michael Tokarev

From: Philippe Mathieu-Daudé <[email protected]>

---
 hw/core/register.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/core/register.c +4 -4
index da38ef3a54..900294b9c4 100644
@@ -195,8 +195,8 @@ void register_write_memory(void *opaque, hwaddr addr,
     }
 
     if (!reg) {
-        qemu_log_mask(LOG_GUEST_ERROR, "Write to unimplemented register at " \
-                      "address: %#" PRIx64 "\n", addr);
+        qemu_log_mask(LOG_GUEST_ERROR, "%s: write to unimplemented register " \
+                      "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
         return;
     }
 
@@ -224,8 +224,8 @@ uint64_t register_read_memory(void *opaque, hwaddr addr,
     }
 
     if (!reg) {
-        qemu_log_mask(LOG_GUEST_ERROR, "Read to unimplemented register at " \
-                      "address: %#" PRIx64 "\n", addr);
+        qemu_log_mask(LOG_GUEST_ERROR, "%s:  read to unimplemented register " \
+                      "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
         return 0;
     }
 
Signature · 1 line
2.11.0
#16 lore raw

[Qemu-devel] [PULL 15/22] qapi: Fix some QMP documentation regressions

In reply to Michael Tokarev

From: Eric Blake <[email protected]>

In the process of getting rid of docs/qmp-commands.txt, we managed to regress on some of the text that changed after the point where the move was first branched and when the move actually occurred. For example, commit 3282eca for blockdev-snapshot re-added the extra "options" layer which had been cleaned up in commit 0153d2f.

This clears up all regressions identified over the range 02b351d..bd6092e:
https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg05127.html
as well as a cleanup to x-blockdev-remove-medium to prefer 'id' over 'device' (matching the cleanup for 'eject').

---
 qapi/block-core.json | 28 ++++++++++++++--------------
 qapi/block.json      |  2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)
qapi/block-core.json +14 -14
index 309b1df214..88a7471a23 100644
@@ -1206,11 +1206,11 @@
 # Example:
 #
 # -> { "execute": "blockdev-add",
-#      "arguments": { "options": { "driver": "qcow2",
-#                                  "node-name": "node1534",
-#                                  "file": { "driver": "file",
-#                                            "filename": "hd1.qcow2" },
-#                                  "backing": "" } } }
+#      "arguments": { "driver": "qcow2",
+#                     "node-name": "node1534",
+#                     "file": { "driver": "file",
+#                               "filename": "hd1.qcow2" },
+#                     "backing": "" } }
 #
 # <- { "return": {} }
 #
@@ -3214,7 +3214,7 @@
 # <- { "return": {} }
 #
 # -> { "execute": "x-blockdev-remove-medium",
-#      "arguments": { "device": "ide0-1-0" } }
+#      "arguments": { "id": "ide0-1-0" } }
 #
 # <- { "return": {} }
 #
@@ -3245,10 +3245,10 @@
 #
 # -> { "execute": "blockdev-add",
 #      "arguments": {
-#          "options": { "node-name": "node0",
-#                       "driver": "raw",
-#                       "file": { "driver": "file",
-#                                 "filename": "fedora.iso" } } } }
+#          "node-name": "node0",
+#          "driver": "raw",
+#          "file": { "driver": "file",
+#                    "filename": "fedora.iso" } } }
 # <- { "return": {} }
 #
 # -> { "execute": "x-blockdev-insert-medium",
@@ -3701,10 +3701,10 @@
 # 1. Add a new node to a quorum
 # -> { "execute": "blockdev-add",
 #      "arguments": {
-#          "options": { "driver": "raw",
-#                       "node-name": "new_node",
-#                        "file": { "driver": "file",
-#                                  "filename": "test.raw" } } } }
+#          "driver": "raw",
+#          "node-name": "new_node",
+#          "file": { "driver": "file",
+#                    "filename": "test.raw" } } }
 # <- { "return": {} }
 # -> { "execute": "x-blockdev-change",
 #      "arguments": { "parent": "disk1",
qapi/block.json +1 -1
index 6a2fdc73f7..414b61bde7 100644
@@ -180,7 +180,7 @@
 #
 # Example:
 #
-# -> { "execute": "eject", "arguments": { "device": "ide1-0-1" } }
+# -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
 # <- { "return": {} }
 ##
 { 'command': 'eject',
Signature · 1 line
2.11.0
#17 lore raw

[Qemu-devel] [PULL 18/22] help: Add newline to end of thread option help text

In reply to Michael Tokarev

From: Suraj Jitindar Singh <[email protected]>

The help text for the thread sub option of the accel option is missing a newline at the end. This is annoying as it makes it hard to see the help text for the next option.

Add the new line so that the following option help text (-smp) is displayed on a new line rather on the same line and directly after the thread help.

Before patch:

-accel [accel=]accelerator[,thread=single|multi]
select accelerator (kvm, xen, hax or tcg; use 'help' for a list)
thread=single|multi (enable multi-threaded TCG)-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets] set the number of CPUs to 'n' [default=1]
maxcpus= maximum number of total cpus, including
offline CPUs for hotplug, etc
cores= number of CPU cores on one socket
threads= number of threads on one CPU core
sockets= number of discrete sockets in the system

After patch:

-accel [accel=]accelerator[,thread=single|multi]
select accelerator (kvm, xen, hax or tcg; use 'help' for a list) thread=single|multi (enable multi-threaded TCG)
-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]
set the number of CPUs to 'n' [default=1]
maxcpus= maximum number of total cpus, including offline CPUs for hotplug, etc
cores= number of CPU cores on one socket
threads= number of threads on one CPU core
sockets= number of discrete sockets in the system

---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-options.hx +1 -1
index 10995dc932..30c4f9850f 100644
@@ -102,7 +102,7 @@ ETEXI
 DEF("accel", HAS_ARG, QEMU_OPTION_accel,
     "-accel [accel=]accelerator[,thread=single|multi]\n"
     "                select accelerator (kvm, xen, hax or tcg; use 'help' for a list)\n"
-    "                thread=single|multi (enable multi-threaded TCG)", QEMU_ARCH_ALL)
+    "                thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL)
 STEXI
 @item -accel @var{name}[,prop=@var{value}[,...]]
 @findex -accel
Signature · 1 line
2.11.0
#18 lore raw

[Qemu-devel] [PULL 12/22] hw/sparc: use ARRAY_SIZE() macro

In reply to Michael Tokarev

From: Philippe Mathieu-Daudé <[email protected]>

---
 hw/sparc64/sun4u.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/sparc64/sun4u.c +1 -1
index 18b8f8bcba..69f565db25 100644
@@ -214,7 +214,7 @@ static void isa_irq_handler(void *opaque, int n, int level)
     qemu_irq *irqs = opaque;
     int ivec;
 
-    assert(n < 16);
+    assert(n < ARRAY_SIZE(isa_irq_to_ivec));
     ivec = isa_irq_to_ivec[n];
     EBUS_DPRINTF("Set ISA IRQ %d level %d -> ivec 0x%x\n", n, level, ivec);
     if (ivec) {
Signature · 1 line
2.11.0
#19 lore raw

[Qemu-devel] [PULL 06/22] configure: Detect native NetBSD curses(3)

In reply to Michael Tokarev

From: Kamil Rytarowski <[email protected]>

NetBSD ships with traditional BSD curses with compatibility with ncurses. qemu works nicely with the basesystem version of curses(3) from NetBSD.

The only mismatch between curses(3) and ncurses is the lack of curses_version() in the NetBSD version. This function is used solely in the configure script, therefore eliminate it from the curses(3) detection.

With this change applied, configure detects correctly curses frontend.

---
 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
configure +1 -2
index 21944eaa05..fbb6a93c99 100755
@@ -3042,14 +3042,13 @@ if test "$curses" != "no" ; then
 #include <curses.h>
 #include <wchar.h>
 int main(void) {
-  const char *s = curses_version();
   wchar_t wch = L'w';
   setlocale(LC_ALL, "");
   resize_term(0, 0);
   addwstr(L"wide chars\n");
   addnwstr(&wch, 1);
   add_wch(WACS_DEGREE);
-  return s != 0;
+  return 0;
 }
 EOF
   IFS=:
Signature · 1 line
2.11.0
#20 lore raw

[Qemu-devel] [PULL 16/22] scsi/lsi53c895a: Remove unused lsi_mem_*() return value

In reply to Michael Tokarev

From: Mao Zhongyi <[email protected]>

lsi_mem_read/write() always return 0 about which their callers actually don't care. Change the function type to void.

---
 hw/scsi/lsi53c895a.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
hw/scsi/lsi53c895a.c +4 -6
index 595c26017a..3e56ab267c 100644
@@ -408,27 +408,25 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val);
 static void lsi_execute_script(LSIState *s);
 static void lsi_reselect(LSIState *s, lsi_request *p);
 
-static inline int lsi_mem_read(LSIState *s, dma_addr_t addr,
+static inline void lsi_mem_read(LSIState *s, dma_addr_t addr,
                                void *buf, dma_addr_t len)
 {
     if (s->dmode & LSI_DMODE_SIOM) {
         address_space_read(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED,
                            buf, len);
-        return 0;
     } else {
-        return pci_dma_read(PCI_DEVICE(s), addr, buf, len);
+        pci_dma_read(PCI_DEVICE(s), addr, buf, len);
     }
 }
 
-static inline int lsi_mem_write(LSIState *s, dma_addr_t addr,
+static inline void lsi_mem_write(LSIState *s, dma_addr_t addr,
                                 const void *buf, dma_addr_t len)
 {
     if (s->dmode & LSI_DMODE_DIOM) {
         address_space_write(&s->pci_io_as, addr, MEMTXATTRS_UNSPECIFIED,
                             buf, len);
-        return 0;
     } else {
-        return pci_dma_write(PCI_DEVICE(s), addr, buf, len);
+        pci_dma_write(PCI_DEVICE(s), addr, buf, len);
     }
 }
 
Signature · 1 line
2.11.0
#21 lore raw

[Qemu-devel] [PULL 21/22] ivshmem-server: ivshmem-client: Build when eventfd() is available

In reply to Michael Tokarev

From: Kamil Rytarowski <[email protected]>

Currently ivshmem requires eventfd() which is Linux specific. Do not and build it unconditionally on every Linux/BSD/Solaris.

This patch indirectly fixes build failure on NetBSD, where these tools additionally require -lrt for shm_open(3). In future there should be added support for NetBSD and the linking addressed appropriately.

---
 configure                            | 2 ++
 contrib/ivshmem-client/Makefile.objs | 2 +-
 contrib/ivshmem-server/Makefile.objs | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
configure +2 -0
index fbb6a93c99..965727bca8 100755
@@ -4910,6 +4910,8 @@ if test "$want_tools" = "yes" ; then
   tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
   if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
     tools="qemu-nbd\$(EXESUF) $tools"
+  fi
+  if [ "$eventfd" = "yes" ]; then
     tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
   fi
 fi
contrib/ivshmem-client/Makefile.objs +1 -1
index bfab2d20dd..13d864082d 100644
@@ -1 +1 @@
-ivshmem-client-obj-y = ivshmem-client.o main.o
+ivshmem-client-obj-$(CONFIG_IVSHMEM) = ivshmem-client.o main.o
contrib/ivshmem-server/Makefile.objs +1 -1
index c060dd3698..d9469fd777 100644
@@ -1 +1 @@
-ivshmem-server-obj-y = ivshmem-server.o main.o
+ivshmem-server-obj-$(CONFIG_IVSHMEM) = ivshmem-server.o main.o
Signature · 1 line
2.11.0
#22 lore raw

[Qemu-devel] [PULL 09/22] block: Correct documentation for BLOCK_WRITE_THRESHOLD

In reply to Michael Tokarev

From: Eric Blake <[email protected]>

Use the correct command name.

---
 qapi/block-core.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qapi/block-core.json +1 -1
index ea0b3e8b13..309b1df214 100644
@@ -3624,7 +3624,7 @@
 # means the device should be extended to avoid pausing for
 # disk exhaustion.
 # The event is one shot. Once triggered, it needs to be
-# re-registered with another block-set-threshold command.
+# re-registered with another block-set-write-threshold command.
 #
 # @node-name: graph node name on which the threshold was exceeded.
 #
Signature · 1 line
2.11.0
#23 lore raw
In reply to Michael Tokarev
Quoted 12 lines · Michael Tokarev

Trivial patches for 04 Jun 2017. Please consider applying.

/mjt

The following changes since commit c6e84fbd447a51e1161d74d71566a5f67b47eac5:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2017-06-02 17:46:22 +0100)

are available in the git repository at:

git://git.corpit.ru/qemu.git tags/trivial-patches-fetch

Quoted 8 lines

for you to fetch changes up to 070ccceda3b23f85d048bbcf3c0040252a9a793a:

hw/core: nmi.c can be compiled as common-obj nowadays (2017-06-04 18:43:09 +0300)

----------------------------------------------------------------
trivial patches for 2017-06-04

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

Hi. I'm afraid this doesn't build in the all-linux-static config (configure '--cc=ccache gcc' '--enable-debug' '--static' '--disable-system'):

$ make -C build/all-linux-static/ V=1
make: Entering directory
'/home/petmay01/linaro/qemu-for-merges/build/all-linux-static'
(cd /home/petmay01/linaro/qemu-for-merges; printf '#define
QEMU_PKGVERSION '; if test -n ""; then printf '""\n'; else if test -d
.git; then printf '" ('; git describe --match 'v*' 2>/dev/null | tr -d
'\n'; if ! git diff-index --quiet HEAD &>/dev/null; then printf --
'-dirty'; fi; printf ')"\n'; else printf '""\n'; fi; fi) >
qemu-version.h.tmp
if ! cmp -s qemu-version.h qemu-version.h.tmp; then mv
qemu-version.h.tmp qemu-version.h; else rm qemu-version.h.tmp; fi
c++ -I/usr/include/pixman-1  -Werror -pthread -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -D_GNU_SOURCE
-I/usr/include/ncursesw -m64 -mcx16 -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes
-fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels
-Wno-missing-include-dirs -Wempty-body -Wnested-externs
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
-Wold-style-declaration -Wold-style-definition -Wtype-limits
-fstack-protector-strong    -I/usr/include/libpng12
-I/usr/include/libusb-1.0
-I/home/petmay01/linaro/qemu-for-merges/tests -g  -Wl,--warn-common
-m64 -static -g  -o ivshmem-client   libqemuutil.a libqemustub.a   -lm
-lgthread-2.0 -pthread -lglib-2.0 -pthread -lpcre -pthread  -lz -lrt
-lz -lcap-ng -lvdeplug -lnettle  -lutil
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In
function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:473: recipe for target 'ivshmem-client' failed

Looks like the makefile is trying to build ivshmem-client even though it has no .o files in the link line. Similarly for ivshmem-server.

thanks
-- PMM