Trivial branch patches
Subsystems (2)
The following changes since commit 8482ff2eb3bb95020eb2f370a9b3ea26511e41df:
Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging (2019-05-02 12:04:51 +0100)
are available in the Git repository at:
git://github.com/vivier/qemu.git tags/trivial-branch-pull-request
for you to fetch changes up to 2d2023c3b99edb33ad4bb9791f70456ea1a1c049:
sockets: avoid string truncation warnings when copying UNIX path (2019-05-03 13:03:04 +0200)
----------------------------------------------------------------
Pull request trivial branch 2019-05-03
----------------------------------------------------------------
Aruna Jayasena (1):
Header cleanups
Daniel P. Berrangé (1):
sockets: avoid string truncation warnings when copying UNIX path
Dr. David Alan Gilbert (1):
configure: fix pam test warning
Marc-André Lureau (1):
doc: fix the configuration path
Philippe Mathieu-Daudé (3):
hw/net/pcnet: Use qemu_log_mask(GUEST_ERROR) instead of printf
Makefile: Let the 'clean' rule remove qemu-ga.exe on Windows hosts hw/sparc/leon3: Allow load of uImage firmwares
Stefan Weil (1):
Update configure
Thomas Huth (1):
net: Print output of "-net nic, model=help" to stdout instead of
stderr
Wei Yang (3):
CODING_STYLE: specify the indent rule for multiline code
CODING_STYLE: indent example code as all others
qom: use object_new_with_type in object_new_with_propv
qemu-ga.texi | 4 ++-- configure | 5 ++--- Makefile | 11 +++++---- include/exec/cpu-common.h | 3 --- hw/net/pcnet.c | 4 +++- hw/sparc/leon3.c | 4 ++++ net/net.c | 7 +++--- qom/object.c | 2 +- util/qemu-sockets.c | 12 ++++++---- CODING_STYLE | 47 +++++++++++++++++++++++++++++++++++---- 10 files changed, 74 insertions(+), 25 deletions(-)
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 01/12] hw/net/pcnet: Use qemu_log_mask(GUEST_ERROR) instead of printf
From: Philippe Mathieu-Daudé <[email protected]>
Avoid to clutter stdout until explicitly requested (with -d guest_errors):
$ qemu-system-mips -M malta -m 512 -kernel vmlinux-3.2.0-4-4kc-malta Bad SWSTYLE=0x04
Message-Id: <[email protected]>
--- hw/net/pcnet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/net/pcnet.c +3 -1
@@ -36,6 +36,7 @@*/ #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/qdev.h" #include "net/net.h" #include "net/eth.h"
@@ -1501,7 +1502,8 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val) val |=0x0300 ;break ;default : -printf ("Bad SWSTYLE=0x%02x\n" , val &0xff ); +qemu_log_mask (LOG_GUEST_ERROR ,"pcnet: Bad SWSTYLE=0x%02x\n" , + val &0xff ); val =0x0200 ;break ; }
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 06/12] configure: fix pam test warning
In reply to Laurent VivierFrom: "Dr. David Alan Gilbert" <[email protected]>
The pam test generates a warning on Fedora 29 with -O3 compilation because the headers declare that the pam_conversation pointer to pam_start must be non-NULL. Change it to use the same 0 initialised structure as we actually use in qauthz.
Message-Id: <[email protected]>
--- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
@@ -2940,9 +2940,9 @@ if test "$auth_pam" != "no"; then int main(void) { const char *service_name = "qemu"; const char *user = "frank"; - const struct pam_conv *pam_conv = NULL; + const struct pam_conv pam_conv = { 0 }; pam_handle_t *pamh = NULL; - pam_start(service_name, user, pam_conv, &pamh); + pam_start(service_name, user, &pam_conv, &pamh); return 0; } EOF
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 02/12] CODING_STYLE: specify the indent rule for multiline code
In reply to Laurent VivierFrom: Wei Yang <[email protected]>
We didn't specify the indent rule for multiline code here, which may mislead users. And in current code, the code use various styles.
Add this rule in CODING_STYLE to make sure this is clear to every one.
Message-Id: <[email protected]>
--- CODING_STYLE | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
CODING_STYLE +39 -0
@@ -29,6 +29,45 @@ Spaces of course are superior to tabs because: Do not leave whitespace dangling off the ends of lines. +1.1 Multiline Indent + +There are several places where indent is necessary: + + - if/else + - while/for + - function definition & call + +When breaking up a long line to fit within line width, we need a proper indent +for the following lines. + +In case of if/else, while/for, align the secondary lines just after the +opening parenthesis of the first. + +For example: + + if (a == 1 && + b == 2) { + + while (a == 1 && + b == 2) { + +In case of function, there are several variants: + + * 4 spaces indent from the beginning + * align the secondary lines just after the opening parenthesis of the + first + +For example: + + do_something(x, y, + z); + + do_something(x, y, + z); + + do_something(x, do_another(y, + z)); + 2. Line width Lines should be 80 characters; try not to make them longer.
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 07/12] Update configure
In reply to Laurent VivierFrom: Stefan Weil <[email protected]>
The last *.aml file was removed in commit 13b1881aacc7e5018773bd545bbaf8d5476699ee.
Message-Id: <[email protected]>
--- configure | 1 - 1 file changed, 1 deletion(-)
configure +0 -1
@@ -7880,7 +7880,6 @@ LINKS="$LINKS python" for bios_file in \ $source_path/pc-bios/*.bin \ $source_path/pc-bios/*.lid \ - $source_path/pc-bios/*.aml \ $source_path/pc-bios/*.rom \ $source_path/pc-bios/*.dtb \ $source_path/pc-bios/*.img \
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 03/12] CODING_STYLE: indent example code as all others
In reply to Laurent VivierFrom: Wei Yang <[email protected]>
All the example code are indented with four spaces except this one.
Fix this by adding four spaces here.
Message-Id: <[email protected]>
--- CODING_STYLE | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
CODING_STYLE +4 -4
@@ -147,10 +147,10 @@ block to a separate function altogether. When comparing a variable for (in)equality with a constant, list the constant on the right, as in: -if (a == 1) { - /* Reads like: "If a equals 1" */ - do_something(); -} + if (a == 1) { + /* Reads like: "If a equals 1" */ + do_something(); + } Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read. Besides, good compilers already warn users when '==' is mis-typed as '=',
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 08/12] Header cleanups
In reply to Laurent VivierFrom: Aruna Jayasena <[email protected]>
Removed unwanted includes from cpu-common.h
This task was under https://wiki.qemu.org/Contribute/BiteSizedTasks
Message-Id: <[email protected]>
--- include/exec/cpu-common.h | 3 --- 1 file changed, 3 deletions(-)
include/exec/cpu-common.h +0 -3
@@ -7,9 +7,6 @@#include "exec/hwaddr.h" #endif -#include "qemu/bswap.h" -#include "qemu/queue.h" -/* The CPU list lock nests outside page_(un)lock or mmap_(un)lock */ void qemu_init_cpu_list (void );void cpu_list_lock (void );
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 09/12] net: Print output of "-net nic, model=help" to stdout instead of stderr
In reply to Laurent VivierFrom: Thomas Huth <[email protected]>
We are printing all other help output to stdout already (e.g. "-help", "-cpu help" and "-machine help" output). So the "-net nic,model=help" output should go to stdout instead of stderr, too. And while we're at it, also print the NICs line by line, like we do it e.g. with the "-cpu help" or "-M help" output, too.
Message-Id: <[email protected]>
--- net/net.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/net.c +4 -3
@@ -837,9 +837,10 @@ int qemu_show_nic_models(const char *arg, const char *const *models)return 0 ; } -fprintf (stderr,"qemu: Supported NIC models: " ); -for (i =0 ; models[i]; i++) -fprintf (stderr,"%s%c" , models[i], models[i+1 ] ?',' :'\n' ); +printf ("Supported NIC models:\n" ); +for (i =0 ; models[i]; i++) { +printf ("%s\n" , models[i]); + }return 1 ; }
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 04/12] doc: fix the configuration path
In reply to Laurent VivierFrom: Marc-André Lureau <[email protected]>
Use a CONFDIR variable to show the configured sysconf path in the generated documentations (html, man pages etc).
Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1644985
Message-Id: <[email protected]>
--- qemu-ga.texi | 4 ++-- Makefile | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-)
qemu-ga.texi +2 -2
@@ -30,7 +30,7 @@ set user's password @end itemize qemu-ga will read a system configuration file on startup (located at -@file{/etc/qemu/qemu-ga.conf} by default), then parse remaining +@file{@value{CONFDIR}/qemu-ga.conf} by default), then parse remaining configuration options on the command line. For the same key, the last option wins, but the lists accumulate (see below for configuration file format).
@@ -58,7 +58,7 @@ file format). Enable fsfreeze hook. Accepts an optional argument that specifies script to run on freeze/thaw. Script will be called with 'freeze'/'thaw' arguments accordingly (default is - @samp{/etc/qemu/fsfreeze-hook}). If using -F with an argument, do + @samp{@value{CONFDIR}/fsfreeze-hook}). If using -F with an argument, do not follow -F with a space (for example: @samp{-F/var/run/fsfreezehook.sh}).
Makefile +6 -3
@@ -899,11 +899,14 @@ ui/shader.o: $(SRC_PATH)/ui/shader.c \ MAKEINFO=makeinfo MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D) MAKEINFOFLAGS=--no-split --number-sections $(MAKEINFOINCLUDES) -TEXI2PODFLAGS=$(MAKEINFOINCLUDES) "-DVERSION=$(VERSION)" +TEXI2PODFLAGS=$(MAKEINFOINCLUDES) -DVERSION="$(VERSION)" -DCONFDIR="$(qemu_confdir)" TEXI2PDFFLAGS=$(if $(V),,--quiet) -I $(SRC_PATH) $(MAKEINFOINCLUDES) -docs/version.texi: $(SRC_PATH)/VERSION - $(call quiet-command,echo "@set VERSION $(VERSION)" > $@,"GEN","$@") +docs/version.texi: $(SRC_PATH)/VERSION config-host.mak + $(call quiet-command,(\ + echo "@set VERSION $(VERSION)" && \ + echo "@set CONFDIR $(qemu_confdir)" \ + )> $@,"GEN","$@") %.html: %.texi docs/version.texi $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 05/12] qom: use object_new_with_type in object_new_with_propv
In reply to Laurent VivierFrom: Wei Yang <[email protected]>
Function object_new_with_propv already get the Type of the object, so we could leverage object_new_with_type here.
Message-Id: <[email protected]>
--- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +1 -1
@@ -679,7 +679,7 @@ Object *object_new_with_propv(const char *typename,error_setg (errp,"object type '%s' is abstract" , typename);return NULL ; } - obj =object_new (typename); + obj =object_new_with_type (klass->type);if (object_set_propv (obj, &local_err, vargs) <0 ) { goto error;
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 10/12] Makefile: Let the 'clean' rule remove qemu-ga.exe on Windows hosts
In reply to Laurent VivierFrom: Philippe Mathieu-Daudé <[email protected]>
Commit 48ff7a625b36 added the QEMU Guest Agent tool with the optional ".exe" suffix for Windows hosts, but forgot to use this suffix in the 'clean' rule. Calling this rule let a dangling executable in the build directory.
Correct this by using the proper optional suffix.
Message-Id: <[email protected]>
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -639,7 +639,7 @@ clean: ! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \ -exec rm {} + rm -f $(edk2-decompressed) - rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~ + rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga$(EXESUF) TAGS cscope.* *.pod *~ */*~ rm -f fsdev/*.pod scsi/*.pod rm -f qemu-img-cmds.h rm -f ui/shader/*-vert.h ui/shader/*-frag.h
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 12/12] sockets: avoid string truncation warnings when copying UNIX path
In reply to Laurent VivierFrom: Daniel P. Berrangé <[email protected]>
In file included from /usr/include/string.h:494,
from include/qemu/osdep.h:101,
from util/qemu-sockets.c:18:
In function ‘strncpy’,
inlined from ‘unix_connect_saddr.isra.0’ at util/qemu-sockets.c:925:5:
/usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 108 equals destination size [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘strncpy’,
inlined from ‘unix_listen_saddr.isra.0’ at util/qemu-sockets.c:880:5:
/usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 108 equals destination size [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~We are already validating the UNIX socket path length earlier in the functions. If we save this string length when we first check it, then we can simply use memcpy instead of strcpy later, avoiding the gcc truncation warnings.
Message-Id: <[email protected]>
--- util/qemu-sockets.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
util/qemu-sockets.c +8 -4
@@ -830,6 +830,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,int sock, fd;char *pathbuf =NULL ;const char *path; +size_t pathlen; sock =qemu_socket (PF_UNIX ,SOCK_STREAM ,0 );if (sock <0 ) {
@@ -845,7 +846,8 @@ static int unix_listen_saddr(UnixSocketAddress *saddr, path = pathbuf =g_strdup_printf ("%s/qemu-socket-XXXXXX" , tmpdir); } -if (strlen (path) >sizeof (un.sun_path)) { + pathlen =strlen (path); +if (pathlen >sizeof (un.sun_path)) {error_setg (errp,"UNIX socket path '%s' is too long" , path);error_append_hint (errp,"Path must be less than %zu bytes\n" ,sizeof (un.sun_path));
@@ -877,7 +879,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,memset (&un,0 ,sizeof (un)); un.sun_family =AF_UNIX ; -strncpy (un.sun_path, path,sizeof (un.sun_path)); +memcpy (un.sun_path, path, pathlen);if (bind (sock, (struct sockaddr *) &un,sizeof (un)) <0 ) {error_setg_errno (errp, errno,"Failed to bind socket to %s" , path);
@@ -901,6 +903,7 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp) {struct sockaddr_un un;int sock, rc; +size_t pathlen;if (saddr->path ==NULL ) {error_setg (errp,"unix connect: no path specified" );
@@ -913,7 +916,8 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)return -1 ; } -if (strlen (saddr->path) >sizeof (un.sun_path)) { + pathlen =strlen (saddr->path); +if (pathlen >sizeof (un.sun_path)) {error_setg (errp,"UNIX socket path '%s' is too long" , saddr->path);error_append_hint (errp,"Path must be less than %zu bytes\n" ,sizeof (un.sun_path));
@@ -922,7 +926,7 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)memset (&un,0 ,sizeof (un)); un.sun_family =AF_UNIX ; -strncpy (un.sun_path, saddr->path,sizeof (un.sun_path)); +memcpy (un.sun_path, saddr->path, pathlen);/* connect to peer */ do {
Signature · 1 line
2.20.1
[Qemu-devel] [PULL v2 11/12] hw/sparc/leon3: Allow load of uImage firmwares
In reply to Laurent VivierFrom: Philippe Mathieu-Daudé <[email protected]>
Currently the Leon3 machine doesn't allow to load legacy u-boot images:
$ qemu-system-sparc -M leon3_generic -d in_asm \
-kernel HelenOS-0.6.0-sparc32-leon3.bin
qemu-system-sparc: could not load kernel 'HelenOS-0.6.0-sparc32-leon3.bin' $ file HelenOS-0.6.0-sparc32-leon3.bin
HelenOS-0.6.0-sparc32-leon3.bin: u-boot legacy uImage, HelenOS-0.6.0,\
Linux/ARM, OS Kernel Image (Not compressed), 2424229 bytes,\
Sun Dec 21 19:18:09 2014,\
Load Address: 0x40000000, Entry Point: 0x40000000,\
Header CRC: 0x8BCFA236, Data CRC: 0x37AD87DFSince QEMU can load uImages, add the necessary code, so the Leon3 machine can load these images:
$ qemu-system-sparc -M leon3_generic -d in_asm \
-kernel HelenOS-0.6.0-sparc32-leon3.bin
----------------
IN:
0x40000000: b 0x400007a8
0x40000004: nop
----------------
IN:
0x400007a8: save %sp, -136, %sp
0x400007ac: call 0x40000020
0x400007b0: sethi %hi(0x4000b800), %i1
...Tested with the following firmware:
http://www.helenos.org/releases/HelenOS-0.6.0-sparc32-leon3.bin
Message-Id: <[email protected]>
--- hw/sparc/leon3.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/sparc/leon3.c +4 -0
@@ -193,6 +193,10 @@ static void leon3_generic_hw_init(MachineState *machine) kernel_size =load_elf (kernel_filename,NULL ,NULL ,NULL , &entry,NULL ,NULL ,1 /* big endian */ ,EM_SPARC ,0 ,0 ); +if (kernel_size <0 ) { + kernel_size =load_uimage (kernel_filename,NULL , &entry, +NULL ,NULL ,NULL ); + }if (kernel_size <0 ) {error_report ("could not load kernel '%s'" , kernel_filename);exit (1 );
Signature · 1 line
2.20.1
Ping ?
Quoted 58 lines · Laurent Vivier
The following changes since commit
8482ff2eb3bb95020eb2f370a9b3ea26511e41df:Merge remote-tracking branch 'remotes/jnsnow/tags/bitmaps-pull-request' into staging (2019-05-02 12:04:51 +0100)are available in the Git repository at:
git://github.com/vivier/qemu.gittags/trivial-branch-pull-requestfor you to fetch changes up to
2d2023c3b99edb33ad4bb9791f70456ea1a1c049:sockets: avoid string truncation warnings when copying UNIX path (2019-05-03 13:03:04 +0200)
----------------------------------------------------------------
Pull request trivial branch 2019-05-03----------------------------------------------------------------
Aruna Jayasena (1):
Header cleanupsDaniel P. Berrangé (1):
sockets: avoid string truncation warnings when copying UNIX pathDr. David Alan Gilbert (1):
configure: fix pam test warningMarc-André Lureau (1):
doc: fix the configuration pathPhilippe Mathieu-Daudé (3):
hw/net/pcnet: Useqemu_log_mask(GUEST_ERROR)instead of printf
Makefile: Let the 'clean' rule remove qemu-ga.exe on Windows hosts hw/sparc/leon3: Allow load of uImage firmwaresStefan Weil (1):
Update configureThomas Huth (1):
net: Print output of "-net nic, model=help" to stdout instead of
stderrWei Yang (3):
CODING_STYLE: specify the indent rule for multiline code
CODING_STYLE: indent example code as all others
qom: useobject_new_with_typeinobject_new_with_propvqemu-ga.texi | 4 ++-- configure | 5 ++--- Makefile | 11 +++++---- include/exec/cpu-common.h | 3 --- hw/net/pcnet.c | 4 +++- hw/sparc/leon3.c | 4 ++++ net/net.c | 7 +++--- qom/object.c | 2 +- util/qemu-sockets.c | 12 ++++++---- CODING_STYLE | 47 +++++++++++++++++++++++++++++++++++---- 10 files changed, 74 insertions(+), 25 deletions(-)
Quoted 2 lines · Laurent Vivier
Ping ?
This is in my queue to process, but there are still a bunch of other pullreqs in the queue too; I am working through them.
thanks
-- PMM
Quoted 7 lines · Peter Maydell
Quoted 2 lines · Laurent Vivier
Ping ?
This is in my queue to process, but there are still a bunch of other pullreqs in the queue too; I am working through them.
Wait, I'm confused now. Looking back through my emails you said "Forget this series, the send has been aborted for an unknown reason.". So should I be applying something ?
thanks
-- PMM
Quoted 4 lines · Peter Maydell
Quoted 3 lines · Peter Maydell
Quoted 1 line · Laurent Vivier
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Ping ?
This is in my queue to process, but there are still a bunch of other pullreqs in the queue too; I am working through them.
Wait, I'm confused now. Looking back through my emails you said "Forget this series, the send has been aborted for an unknown reason.". So should I be applying something ?
Yes, it's why I pinged.
I sent the v2 three times because the sent was aborted for an known reason two times. The third is the good one.
You must apply this series.
I can send a v3 if your prefer.
Thanks,
Laurent
Peter Maydell
AppliedQuoted 15 lines · Laurent Vivier
Quoted 4 lines · Peter Maydell
Quoted 3 lines · Peter Maydell
Quoted 1 line · Laurent Vivier
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Ping ?
This is in my queue to process, but there are still a bunch of other pullreqs in the queue too; I am working through them.
Wait, I'm confused now. Looking back through my emails you said "Forget this series, the send has been aborted for an unknown reason.". So should I be applying something ?
Quoted 6 lines
Yes, it's why I pinged.
I sent the v2 three times because the sent was aborted for an known reason two times. The third is the good one.
You must apply this series.
Applied, thanks.
-- PMM