* [Qemu-devel] [PULL 01/22] qemu-doc: Move the qemu-ga description into a separate chapter
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 02/22] qemu-doc: Add hyperlinks to further license information Michael Tokarev
` (21 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev
From: Thomas Huth <thuth@redhat.com>
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.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-doc.texi | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/qemu-doc.texi b/qemu-doc.texi
index de0cc30790..3f4ed0aa9a 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 02/22] qemu-doc: Add hyperlinks to further license information
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 01/22] qemu-doc: Move the qemu-ga description into a separate chapter Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 03/22] docs qemu-doc: Avoid ide-drive, it's deprecated Michael Tokarev
` (20 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev
From: Thomas Huth <thuth@redhat.com>
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.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-doc.texi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/qemu-doc.texi b/qemu-doc.texi
index 3f4ed0aa9a..965ba5929e 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 03/22] docs qemu-doc: Avoid ide-drive, it's deprecated
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 01/22] qemu-doc: Move the qemu-ga description into a separate chapter Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 02/22] qemu-doc: Add hyperlinks to further license information Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 04/22] docs/qdev-device-use.txt: update section Default Devices Michael Tokarev
` (19 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Markus Armbruster, qemu-trivial, Michael Tokarev
From: Markus Armbruster <armbru@redhat.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
docs/bootindex.txt | 2 +-
docs/qdev-device-use.txt | 4 ++--
qemu-options.hx | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/bootindex.txt b/docs/bootindex.txt
index b9a8ba122f..6937862ba0 100644
--- a/docs/bootindex.txt
+++ b/docs/bootindex.txt
@@ -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
diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt
index 4274fe9f25..95a0c3ae55 100644
--- a/docs/qdev-device-use.txt
+++ b/docs/qdev-device-use.txt
@@ -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
diff --git a/qemu-options.hx b/qemu-options.hx
index a6c9b9e763..10995dc932 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 04/22] docs/qdev-device-use.txt: update section Default Devices
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (2 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 03/22] docs qemu-doc: Avoid ide-drive, it's deprecated Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 05/22] tests/libqtest: Print error instead of aborting when env variable is missing Michael Tokarev
` (18 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Markus Armbruster, qemu-trivial, Michael Tokarev
From: Markus Armbruster <armbru@redhat.com>
Resynchronize the table of default device suppressions with vl.c's
default_list[].
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
docs/qdev-device-use.txt | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt
index 95a0c3ae55..1f297b5e9c 100644
--- a/docs/qdev-device-use.txt
+++ b/docs/qdev-device-use.txt
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 05/22] tests/libqtest: Print error instead of aborting when env variable is missing
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (3 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 04/22] docs/qdev-device-use.txt: update section Default Devices Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 06/22] configure: Detect native NetBSD curses(3) Michael Tokarev
` (17 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev
From: Thomas Huth <thuth@redhat.com>
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.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
tests/libqtest.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 84ecbd2bd8..4a5492a603 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -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));
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 06/22] configure: Detect native NetBSD curses(3)
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (4 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 05/22] tests/libqtest: Print error instead of aborting when env variable is missing Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 07/22] altera_timer: fix incorrect memset Michael Tokarev
` (16 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Kamil Rytarowski, qemu-trivial, Michael Tokarev
From: Kamil Rytarowski <n54@gmx.com>
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.
Signed-off-by: Kamil Rytarowski <n54@gmx.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/configure b/configure
index 21944eaa05..fbb6a93c99 100755
--- a/configure
+++ b/configure
@@ -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=:
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 07/22] altera_timer: fix incorrect memset
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (5 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 06/22] configure: Detect native NetBSD curses(3) Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 08/22] trivial: Remove unneeded ifndef in memory.h Michael Tokarev
` (15 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, qemu-trivial, Michael Tokarev
From: Paolo Bonzini <pbonzini@redhat.com>
Use sizeof instead of ARRAY_SIZE, fixing -Wmemset-elt-size with recent
GCC versions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/timer/altera_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/timer/altera_timer.c b/hw/timer/altera_timer.c
index 6d4862661d..c9a0fc5dca 100644
--- a/hw/timer/altera_timer.c
+++ b/hw/timer/altera_timer.c
@@ -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[] = {
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 08/22] trivial: Remove unneeded ifndef in memory.h
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (6 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 07/22] altera_timer: fix incorrect memset Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 09/22] block: Correct documentation for BLOCK_WRITE_THRESHOLD Michael Tokarev
` (14 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Juan Quintela, qemu-trivial, Michael Tokarev
From: Juan Quintela <quintela@redhat.com>
All the file is surounded already by #ifndef CONFIG_USER_ONLY.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/exec/memory.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index bfdc685f24..80e605a96a 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -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"
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 09/22] block: Correct documentation for BLOCK_WRITE_THRESHOLD
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (7 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 08/22] trivial: Remove unneeded ifndef in memory.h Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 10/22] target/arm: add data cache invalidation cp15 instruction to cortex-r5 Michael Tokarev
` (13 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Eric Blake, qemu-trivial, Michael Tokarev
From: Eric Blake <eblake@redhat.com>
Use the correct command name.
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qapi/block-core.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index ea0b3e8b13..309b1df214 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -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.
#
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 10/22] target/arm: add data cache invalidation cp15 instruction to cortex-r5
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (8 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 09/22] block: Correct documentation for BLOCK_WRITE_THRESHOLD Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 11/22] hw/xtensa: sim: use g_string/g_new Michael Tokarev
` (12 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Luc MICHEL, qemu-trivial, Michael Tokarev
From: Luc MICHEL <luc.michel@git.antfield.fr>
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.
Signed-off-by: Luc MICHEL <luc.michel@git.antfield.fr>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
target/arm/cpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index e748097860..04a3fea03f 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -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
};
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 11/22] hw/xtensa: sim: use g_string/g_new
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (9 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 10/22] target/arm: add data cache invalidation cp15 instruction to cortex-r5 Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 12/22] hw/sparc: use ARRAY_SIZE() macro Michael Tokarev
` (11 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Max Filippov, qemu-trivial, Michael Tokarev
From: Max Filippov <jcmvbkbc@gmail.com>
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.
Suggested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/xtensa/sim.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index d2d1d3a6fd..b27e28d802 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -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)
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 12/22] hw/sparc: use ARRAY_SIZE() macro
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (10 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 11/22] hw/xtensa: sim: use g_string/g_new Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 13/22] register: display register prefix (name) since it is available Michael Tokarev
` (10 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/sparc64/sun4u.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 18b8f8bcba..69f565db25 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -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) {
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 13/22] register: display register prefix (name) since it is available
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (11 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 12/22] hw/sparc: use ARRAY_SIZE() macro Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 14/22] hw/mips: add missing include Michael Tokarev
` (9 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/core/register.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/core/register.c b/hw/core/register.c
index da38ef3a54..900294b9c4 100644
--- a/hw/core/register.c
+++ b/hw/core/register.c
@@ -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;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 14/22] hw/mips: add missing include
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (12 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 13/22] register: display register prefix (name) since it is available Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 15/22] qapi: Fix some QMP documentation regressions Michael Tokarev
` (8 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/hw/mips/mips.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h
index e0065ce808..16412dc150 100644
--- a/include/hw/mips/mips.h
+++ b/include/hw/mips/mips.h
@@ -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);
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 15/22] qapi: Fix some QMP documentation regressions
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (13 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 14/22] hw/mips: add missing include Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 16/22] scsi/lsi53c895a: Remove unused lsi_mem_*() return value Michael Tokarev
` (7 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Eric Blake, qemu-trivial, Michael Tokarev
From: Eric Blake <eblake@redhat.com>
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').
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qapi/block-core.json | 28 ++++++++++++++--------------
qapi/block.json | 2 +-
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 309b1df214..88a7471a23 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -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",
diff --git a/qapi/block.json b/qapi/block.json
index 6a2fdc73f7..414b61bde7 100644
--- a/qapi/block.json
+++ b/qapi/block.json
@@ -180,7 +180,7 @@
#
# Example:
#
-# -> { "execute": "eject", "arguments": { "device": "ide1-0-1" } }
+# -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
# <- { "return": {} }
##
{ 'command': 'eject',
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 16/22] scsi/lsi53c895a: Remove unused lsi_mem_*() return value
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (14 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 15/22] qapi: Fix some QMP documentation regressions Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 17/22] qemu-ga: remove useless allocation Michael Tokarev
` (6 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Mao Zhongyi, qemu-trivial, Michael Tokarev
From: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
lsi_mem_read/write() always return 0 about which their
callers actually don't care. Change the function type
to void.
Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/scsi/lsi53c895a.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 595c26017a..3e56ab267c 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -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);
}
}
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 17/22] qemu-ga: remove useless allocation
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (15 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 16/22] scsi/lsi53c895a: Remove unused lsi_mem_*() return value Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 18/22] help: Add newline to end of thread option help text Michael Tokarev
` (5 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, qemu-trivial, Michael Tokarev
From: Marc-André Lureau <marcandre.lureau@redhat.com>
There is no need to duplicate a fixed string.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qga/commands-posix.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 284ecc6d7e..d8e412275e 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -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 =
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 18/22] help: Add newline to end of thread option help text
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (16 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 17/22] qemu-ga: remove useless allocation Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 19/22] ide-test: check return of fwrite Michael Tokarev
` (4 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Suraj Jitindar Singh, qemu-trivial, Michael Tokarev
From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
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
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-options.hx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 10995dc932..30c4f9850f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 19/22] ide-test: check return of fwrite
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (17 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 18/22] help: Add newline to end of thread option help text Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 20/22] dump: fix memory_mapping_filter leak Michael Tokarev
` (3 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: John Snow, qemu-trivial, Michael Tokarev
From: John Snow <jsnow@redhat.com>
To quiet patchew, add an assert for fwrite's return value.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
tests/ide-test.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/ide-test.c b/tests/ide-test.c
index 139ebc0ec6..bfd79ddbdc 100644
--- a/tests/ide-test.c
+++ b/tests/ide-test.c
@@ -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);
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 20/22] dump: fix memory_mapping_filter leak
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (18 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 19/22] ide-test: check return of fwrite Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 21/22] ivshmem-server: ivshmem-client: Build when eventfd() is available Michael Tokarev
` (2 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, qemu-trivial, Michael Tokarev
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Spotted by ASAN.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
memory_mapping.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/memory_mapping.c b/memory_mapping.c
index 6a39d71da2..a5d38552a6 100644
--- a/memory_mapping.c
+++ b/memory_mapping.c
@@ -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;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 21/22] ivshmem-server: ivshmem-client: Build when eventfd() is available
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (19 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 20/22] dump: fix memory_mapping_filter leak Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-04 15:45 ` [Qemu-devel] [PULL 22/22] hw/core: nmi.c can be compiled as common-obj nowadays Michael Tokarev
2017-06-05 12:05 ` [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Peter Maydell
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Kamil Rytarowski, qemu-trivial, Michael Tokarev
From: Kamil Rytarowski <n54@gmx.com>
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.
Signed-off-by: Kamil Rytarowski <n54@gmx.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 2 ++
contrib/ivshmem-client/Makefile.objs | 2 +-
contrib/ivshmem-server/Makefile.objs | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index fbb6a93c99..965727bca8 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/contrib/ivshmem-client/Makefile.objs b/contrib/ivshmem-client/Makefile.objs
index bfab2d20dd..13d864082d 100644
--- a/contrib/ivshmem-client/Makefile.objs
+++ b/contrib/ivshmem-client/Makefile.objs
@@ -1 +1 @@
-ivshmem-client-obj-y = ivshmem-client.o main.o
+ivshmem-client-obj-$(CONFIG_IVSHMEM) = ivshmem-client.o main.o
diff --git a/contrib/ivshmem-server/Makefile.objs b/contrib/ivshmem-server/Makefile.objs
index c060dd3698..d9469fd777 100644
--- a/contrib/ivshmem-server/Makefile.objs
+++ b/contrib/ivshmem-server/Makefile.objs
@@ -1 +1 @@
-ivshmem-server-obj-y = ivshmem-server.o main.o
+ivshmem-server-obj-$(CONFIG_IVSHMEM) = ivshmem-server.o main.o
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [Qemu-devel] [PULL 22/22] hw/core: nmi.c can be compiled as common-obj nowadays
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (20 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 21/22] ivshmem-server: ivshmem-client: Build when eventfd() is available Michael Tokarev
@ 2017-06-04 15:45 ` Michael Tokarev
2017-06-05 12:05 ` [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Peter Maydell
22 siblings, 0 replies; 24+ messages in thread
From: Michael Tokarev @ 2017-06-04 15:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev
From: Thomas Huth <thuth@redhat.com>
The target-specific code in nmi.c has been removed with this commit:
commit f7e981f29548fe4af7812f5920304fe607e5bf0d
nmi: remove x86 specific nmi handling
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/core/Makefile.objs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs
index 91450b2eab..f8d7a4aaed 100644
--- a/hw/core/Makefile.objs
+++ b/hw/core/Makefile.objs
@@ -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
--
2.11.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04
2017-06-04 15:45 [Qemu-devel] [PULL 00/22] Trivial patches for 2017-06-04 Michael Tokarev
` (21 preceding siblings ...)
2017-06-04 15:45 ` [Qemu-devel] [PULL 22/22] hw/core: nmi.c can be compiled as common-obj nowadays Michael Tokarev
@ 2017-06-05 12:05 ` Peter Maydell
22 siblings, 0 replies; 24+ messages in thread
From: Peter Maydell @ 2017-06-05 12:05 UTC (permalink / raw)
To: Michael Tokarev; +Cc: QEMU Developers, QEMU Trivial
On 4 June 2017 at 16:45, Michael Tokarev <mjt@tls.msk.ru> wrote:
> 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
>
> ----------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 24+ messages in thread