Commit 68a7b972 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging



Pull request trivial branch 2019-05-03

# gpg: Signature made Fri 03 May 2019 12:26:34 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-pull-request:
  sockets: avoid string truncation warnings when copying UNIX path
  hw/sparc/leon3: Allow load of uImage firmwares
  Makefile: Let the 'clean' rule remove qemu-ga.exe on Windows hosts
  net: Print output of "-net nic, model=help" to stdout instead of stderr
  Header cleanups
  Update configure
  configure: fix pam test warning
  qom: use object_new_with_type in object_new_with_propv
  doc: fix the configuration path
  CODING_STYLE: indent example code as all others
  CODING_STYLE: specify the indent rule for multiline code
  hw/net/pcnet: Use qemu_log_mask(GUEST_ERROR) instead of printf

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents c56247e5 2d2023c3
Loading
Loading
Loading
Loading
+43 −4
Original line number Diff line number Diff line
@@ -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.
+7 −4
Original line number Diff line number Diff line
@@ -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
@@ -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 \
+2 −3
Original line number Diff line number Diff line
@@ -2937,9 +2937,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
@@ -7882,7 +7882,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 \
+3 −1
Original line number Diff line number Diff line
@@ -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;
        }
+4 −0
Original line number Diff line number Diff line
@@ -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);
Loading