Skip to content

Commits

Permalink
block
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on Sep 12, 2018

  1. block/rbd: add deprecation documentation for filename keyvalue pairs

    Signed-off-by: Jeff Cody <jcody@redhat.com>
    Message-id: 647f5b5ab7efd8bf567a504c832b1d2d6f719b23.1536704901.git.jcody@redhat.com
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    codyprime committed Sep 12, 2018
    Copy the full SHA
    8af2eb7 View commit details
    Browse the repository at this point in the history
  2. block/rbd: add iotest for rbd legacy keyvalue filename parsing

    This is a small test that will check for the ability to parse
    both legacy and modern options for rbd.
    
    The way the test is set up is for failure to occur, but without
    having to wait to timeout on a non-existent rbd server.  The error
    messages in the success path show that the arguments were parsed.
    
    The failure behavior prior to the patch series that has this test, is
    qemu-img complaining about mandatory options (e.g. 'pool') not being
    provided.
    
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    Message-id: f830580e339b974a83ed4870d11adcdc17f49a47.1536704901.git.jcody@redhat.com
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    codyprime committed Sep 12, 2018
    Copy the full SHA
    4ea3b5e View commit details
    Browse the repository at this point in the history
  3. block/rbd: Attempt to parse legacy filenames

    When we converted rbd to get rid of the older key/value-centric
    encoding format, we broke compatibility with image files with backing
    file strings encoded in the old format.
    
    This leaves a bit of an ugly conundrum, and a hacky solution.
    
    If the initial attempt to parse the "proper" options fails, it assumes
    that we may have an older key/value encoded filename.  Fall back to
    attempting to parse the filename, and extract the required options from
    it.  If that fails, pass along the original error message.
    
    We do not support mixed modern usage alongside legacy keyvalue pair
    usage.
    
    A deprecation warning has been added, although care should be taken
    when actually deprecating since the impact is not limited to
    commandline or qapi usage, but also opening existing images.
    
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    Message-id: 15b332e5432ad069441f7275a46080f465d789a0.1536704901.git.jcody@redhat.com
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    codyprime committed Sep 12, 2018
    Copy the full SHA
    8665431 View commit details
    Browse the repository at this point in the history
  4. block/rbd: pull out qemu_rbd_convert_options

    Code movement to pull the conversion from Qdict to BlockdevOptionsRbd
    into a helper function.
    
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: John Snow <jsnow@redhat.com>
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    Message-id: 5b49a980f2cde6610ab1df41bb0277d00b5db893.1536704901.git.jcody@redhat.com
    Signed-off-by: Jeff Cody <jcody@redhat.com>
    codyprime committed Sep 12, 2018
    Copy the full SHA
    862e999 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2018

  1. Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-08-…

    …27-v2' into staging
    
    Error reporting patches for 2018-08-27
    
    # gpg: Signature made Mon 27 Aug 2018 14:18:15 BST
    # gpg:                using RSA key 3870B400EB918653
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-error-2018-08-27-v2:
      intel-iommu: replace more vtd_err_* traces
      intel-iommu: start to use error_report_once
      qemu-error: introduce {error|warn}_report_once
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Aug 27, 2018
    Copy the full SHA
    19b599f View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'remotes/juanquintela/tags/check/2018082…

    …7' into staging
    
    check/next for 20180827
    
    # gpg: Signature made Mon 27 Aug 2018 10:58:51 BST
    # gpg:                using RSA key F487EF185872D723
    # gpg: Good signature from "Juan Quintela <quintela@redhat.com>"
    # gpg:                 aka "Juan Quintela <quintela@trasno.org>"
    # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723
    
    * remotes/juanquintela/tags/check/20180827:
      check: Move wdt_ib700 test to common
      check: Move endianess test to common
      check: Move VMXNET3 test to common
      check: Only test boot-serial when sga is compiled in
      check: Only test ivshm when it is compiled in
      x86_64-softmmu: Configuration is identical to i386-softmmu
      check: Only test usb-xhci-nec when it is compiled in
      check: Only test isa-testdev when it is compiled in
      configure: We don't want to clean configuration files
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Aug 27, 2018
    Copy the full SHA
    e1e3889 View commit details
    Browse the repository at this point in the history
  3. intel-iommu: replace more vtd_err_* traces

    Replace all the trace_vtd_err_*() hooks with the new error_report_once()
    since they are similar to trace_vtd_err() - dumping the first error
    would be mostly enough, then we have them on by default too.
    
    Signed-off-by: Peter Xu <peterx@redhat.com>
    Message-Id: <20180815095328.32414-4-peterx@redhat.com>
    [Use "%x" instead of "%" PRIx16 to print uint16_t, whitespace tidied up]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    xzpeter authored and Markus Armbruster committed Aug 27, 2018
    Copy the full SHA
    4e4abd1 View commit details
    Browse the repository at this point in the history
  4. intel-iommu: start to use error_report_once

    Replace existing trace_vtd_err() with error_report_once() then stderr
    will capture something if any of the error happens, meanwhile we don't
    suffer from any DDOS.  Then remove the trace point.  Since at it,
    provide more information where proper (now we can pass parameters into
    the report function).
    
    Signed-off-by: Peter Xu <peterx@redhat.com>
    Message-Id: <20180815095328.32414-3-peterx@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    [Two format strings fixed, whitespace tidied up]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    xzpeter authored and Markus Armbruster committed Aug 27, 2018
    Copy the full SHA
    1376211 View commit details
    Browse the repository at this point in the history
  5. Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180827-v4-pull…

    …-request' into staging
    
    ui: misc fixes which piled up during 3.0 release freeze
    
    # gpg: Signature made Mon 27 Aug 2018 09:53:07 BST
    # gpg:                using RSA key 4CB6D8EED3E87138
    # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
    # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
    # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
    # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
    
    * remotes/kraxel/tags/ui-20180827-v4-pull-request:
      util: promote qemu_egl_rendernode_open() to libqemuutil
      dmabuf: add y0_top, pass it to spice
      ui/vnc: Remove useless parenthesis around DIV_ROUND_UP macro
      ui/sdl2: Fix broken -full-screen CLI option
      spice-display: fix qemu_spice_cursor_refresh_bh locking
      spice-display: access ptr_x/ptr_y under Mutex
      vnc: remove support for deprecated tls, x509, x509verify options
      doc: switch to modern syntax for VNC TLS setup
      sdl2: redraw correctly when scanout_mode enabled.
      ui: use enum to string helpers
      vnc: fix memleak of the "vnc-worker-output" name
      ui/sdl2: Remove the obsolete SDL_INIT_NOPARACHUTE flag
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Aug 27, 2018
    Copy the full SHA
    025573b View commit details
    Browse the repository at this point in the history
  6. check: Move wdt_ib700 test to common

    It is protected by CONFIG_WDT_IB700.
    
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    ee1f6c8 View commit details
    Browse the repository at this point in the history
  7. check: Move endianess test to common

    It is already protected by CONFIG_ISA_TESTDEV in all architectures.
    
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    669cc71 View commit details
    Browse the repository at this point in the history
  8. check: Move VMXNET3 test to common

    We protect it with CONFIG_VMXNET3_PCI now, so no need to also put it
    on i386.
    
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    7a06677 View commit details
    Browse the repository at this point in the history
  9. check: Only test boot-serial when sga is compiled in

    This is only for x86* architecture.
    
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    dff1ba0 View commit details
    Browse the repository at this point in the history
  10. check: Only test ivshm when it is compiled in

    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    1336e60 View commit details
    Browse the repository at this point in the history
  11. x86_64-softmmu: Configuration is identical to i386-softmmu

    If we ever changed that, just make the things that are different
    explicit.
    
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    fa212a2 View commit details
    Browse the repository at this point in the history
  12. check: Only test usb-xhci-nec when it is compiled in

    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    c9b688b View commit details
    Browse the repository at this point in the history
  13. check: Only test isa-testdev when it is compiled in

    Once there, untangle endianness-test and boot-serial-test.
    
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    
    ---
    
    boot-serial-test don't depend on isa-testdev.  Thanks Thomas.
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    4637963 View commit details
    Browse the repository at this point in the history
  14. configure: We don't want to clean configuration files

    If you don't want to compile everything, you configure
    config-devices.mak.  And then make clean remove it, and make will
    create a default one without your configuration.  Fix it by not
    removing it on clean target.  Remove it instead on distclean.
    
    Signed-off-by: Juan Quintela <quintela@redhat.com>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    
    ---
    
    Remove it instead on distclean.
    juanquintela committed Aug 27, 2018
    Copy the full SHA
    e92af6e View commit details
    Browse the repository at this point in the history
  15. util: promote qemu_egl_rendernode_open() to libqemuutil

    vhost-user-gpu will share the same code to open a DRM node.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20180713130916.4153-20-marcandre.lureau@redhat.com>
    
    [ kraxel: buildfix: util/drm.o must be CONFIG_OPENGL not CONFIG_LINUX ]
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    elmarco authored and kraxel committed Aug 27, 2018
    Copy the full SHA
    b1d3803 View commit details
    Browse the repository at this point in the history
  16. qemu-error: introduce {error|warn}_report_once

    There are many error_report()s that can be used in frequently called
    functions, especially on IO paths.  That can be unideal in that
    malicious guest can try to trigger the error tons of time which might
    use up the log space on the host (e.g., libvirt can capture the stderr
    of QEMU and put it persistently onto disk).  In VT-d emulation code, we
    have trace_vtd_error() tracer.  AFAIU all those places can be replaced
    by something like error_report() but trace points are mostly used to
    avoid the DDOS attack that mentioned above.  However using trace points
    mean that errors are not dumped if trace not enabled.
    
    It's not a big deal in most modern server managements since we have
    things like logrotate to maintain the logs and make sure the quota is
    expected.  However it'll still be nice that we just provide another way
    to restrict message generations.  In most cases, this kind of
    error_report()s will only provide valid information on the first message
    sent, and all the rest of similar messages will be mostly talking about
    the same thing.  This patch introduces *_report_once() helpers to allow
    a message to be dumped only once during one QEMU process's life cycle.
    It will make sure: (1) it's on by deffault, so we can even get something
    without turning the trace on and reproducing, and (2) it won't be
    affected by DDOS attack.
    
    To implement it, I stole the printk_once() macro from Linux.
    
    CC: Eric Blake <eblake@redhat.com>
    CC: Markus Armbruster <armbru@redhat.com>
    Signed-off-by: Peter Xu <peterx@redhat.com>
    Message-Id: <20180815095328.32414-2-peterx@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    [Whitespace adjusted, comments improved]
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    xzpeter authored and Markus Armbruster committed Aug 27, 2018
    Copy the full SHA
    bc6a69d View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2018

  1. Merge remote-tracking branch 'remotes/otubo/tags/pull-seccomp-2018082…

    …3' into staging
    
    pull-seccomp-20180823
    
    # gpg: Signature made Thu 23 Aug 2018 15:46:13 BST
    # gpg:                using RSA key DF32E7C0F0FFF9A2
    # gpg: Good signature from "Eduardo Otubo (Senior Software Engineer) <otubo@redhat.com>"
    # Primary key fingerprint: D67E 1B50 9374 86B4 0723  DBAB DF32 E7C0 F0FF F9A2
    
    * remotes/otubo/tags/pull-seccomp-20180823:
      seccomp: set the seccomp filter to all threads
      configure: require libseccomp 2.2.0
      seccomp: prefer SCMP_ACT_KILL_PROCESS if available
      seccomp: use SIGSYS signal instead of killing the thread
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Aug 25, 2018
    Copy the full SHA
    235c82a View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'remotes/awilliam/tags/vfio-fixes-201808…

    …23.1' into staging
    
    VFIO fixes 2018-08-23
    
     - Fix coverity reported issue with use of realpath (Alex Williamson)
    
     - Cleanup file descriptor in error path (Alex Williamson)
    
     - Fix postcopy use of new balloon inhibitor (Alex Williamson)
    
    # gpg: Signature made Thu 23 Aug 2018 17:46:41 BST
    # gpg:                using RSA key 239B9B6E3BB08B22
    # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
    # gpg:                 aka "Alex Williamson <alex@shazbot.org>"
    # gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
    # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"
    # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22
    
    * remotes/awilliam/tags/vfio-fixes-20180823.1:
      postcopy: Synchronize usage of the balloon inhibitor
      vfio/pci: Fix failure to close file descriptor on error
      vfio/pci: Handle subsystem realpath() returning NULL
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Aug 25, 2018
    Copy the full SHA
    17182bb View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'remotes/armbru/tags/pull-qobject-2018-0…

    …8-24' into staging
    
    QObject patches for 2018-08-24
    
    # gpg: Signature made Fri 24 Aug 2018 20:28:53 BST
    # gpg:                using RSA key 3870B400EB918653
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
    # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
    
    * remotes/armbru/tags/pull-qobject-2018-08-24: (58 commits)
      json: Update references to RFC 7159 to RFC 8259
      json: Support %% in JSON strings when interpolating
      json: Improve safety of qobject_from_jsonf_nofail() & friends
      json: Keep interpolation state in JSONParserContext
      tests/drive_del-test: Fix harmless JSON interpolation bug
      json: Clean up headers
      qobject: Drop superfluous includes of qemu-common.h
      json: Make JSONToken opaque outside json-parser.c
      json: Unbox tokens queue in JSONMessageParser
      json: Streamline json_message_process_token()
      json: Enforce token count and size limits more tightly
      qjson: Have qobject_from_json() & friends reject empty and blank
      json: Assert json_parser_parse() consumes all tokens on success
      json: Fix streamer not to ignore trailing unterminated structures
      json: Fix latent parser aborts at end of input
      qjson: Fix qobject_from_json() & friends for multiple values
      json: Improve names of lexer states related to numbers
      json: Replace %I64d, %I64u by %PRId64, %PRIu64
      json: Leave rejecting invalid interpolation to parser
      json: Pass lexical errors and limit violations to callback
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Aug 25, 2018
    Copy the full SHA
    cc9821f View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2018

  1. Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-aug-2…

    …018' into staging
    
    MIPS queue August 2018 v6
    
    # gpg: Signature made Fri 24 Aug 2018 16:52:27 BST
    # gpg:                using RSA key D4972A8967F75A65
    # gpg: Good signature from "Aleksandar Markovic <amarkovic@wavecomp.com>"
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: 8526 FBF1 5DA3 811F 4A01  DD75 D497 2A89 67F7 5A65
    
    * remotes/amarkovic/tags/mips-queue-aug-2018: (45 commits)
      target/mips: Add definition of nanoMIPS I7200 CPU
      mips_malta: Fix semihosting argument passing for nanoMIPS bare metal
      mips_malta: Add setting up GT64120 BARs to the nanoMIPS bootloader
      mips_malta: Add basic nanoMIPS boot code for Malta board
      elf: Don't check FCR31_NAN2008 bit for nanoMIPS
      elf: On elf loading, treat both EM_MIPS and EM_NANOMIPS as legal for MIPS
      elf: Relax MIPS' elf_check_arch() to accept EM_NANOMIPS too
      elf: Add EM_NANOMIPS value as a valid one for e_machine field
      target/mips: Fix ERET/ERETNC behavior related to ADEL exception
      target/mips: Add updating BadInstr and BadInstrX for nanoMIPS
      target/mips: Add availability control via bit NMS
      target/mips: Add emulation of DSP ASE for nanoMIPS - part 6
      target/mips: Add emulation of DSP ASE for nanoMIPS - part 5
      target/mips: Add emulation of DSP ASE for nanoMIPS - part 4
      target/mips: Add emulation of DSP ASE for nanoMIPS - part 3
      target/mips: Add emulation of DSP ASE for nanoMIPS - part 2
      target/mips: Add emulation of DSP ASE for nanoMIPS - part 1
      target/mips: Implement MT ASE support for nanoMIPS
      target/mips: Fix pre-nanoMIPS MT ASE instructions availability control
      target/mips: Add emulation of nanoMIPS 32-bit branch instructions
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Aug 24, 2018
    Copy the full SHA
    e2e6fa6 View commit details
    Browse the repository at this point in the history
  2. json: Update references to RFC 7159 to RFC 8259

    RFC 8259 (December 2017) obsoletes RFC 7159 (March 2014).
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20180823164025.12553-59-armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    37aded9 View commit details
    Browse the repository at this point in the history
  3. json: Support %% in JSON strings when interpolating

    The previous commit makes JSON strings containing '%' awkward to
    express in templates: you'd have to mask the '%' with an Unicode
    escape \u0025.  No template currently contains such JSON strings.
    Support the printf conversion specification %% in JSON strings as a
    convenience anyway, because it's trivially easy to do.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-58-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    8bca461 View commit details
    Browse the repository at this point in the history
  4. json: Improve safety of qobject_from_jsonf_nofail() & friends

    The JSON parser optionally supports interpolation.  This is used to
    build QObjects by parsing string templates.  The templates are C
    literals, so parse errors (such as invalid interpolation
    specifications) are actually programming errors.  Consequently, the
    functions providing parsing with interpolation
    (qobject_from_jsonf_nofail(), qobject_from_vjsonf_nofail(),
    qdict_from_jsonf_nofail(), qdict_from_vjsonf_nofail()) pass
    &error_abort to the parser.
    
    However, there's another, more dangerous kind of programming error:
    since we use va_arg() to get the value to interpolate, behavior is
    undefined when the variable argument isn't consistent with the
    interpolation specification.
    
    The same problem exists with printf()-like functions, and the solution
    is to have the compiler check consistency.  This is what
    GCC_FMT_ATTR() is about.
    
    To enable this type checking for interpolation as well, we carefully
    chose our interpolation specifications to match printf conversion
    specifications, and decorate functions parsing templates with
    GCC_FMT_ATTR().
    
    Note that this only protects against undefined behavior due to type
    errors.  It can't protect against use of invalid interpolation
    specifications that happen to be valid printf conversion
    specifications.
    
    However, there's still a gaping hole in the type checking: GCC
    recognizes '%' as start of printf conversion specification anywhere in
    the template, but the parser recognizes it only outside JSON strings.
    For instance, if someone were to pass a "{ '%s': %d }" template, GCC
    would require a char * and an int argument, but the parser would
    va_arg() only an int argument, resulting in undefined behavior.
    
    Avoid undefined behavior by catching the programming error at run
    time: have the parser recognize and reject '%' in JSON strings.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-57-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    16a4859 View commit details
    Browse the repository at this point in the history
  5. json: Keep interpolation state in JSONParserContext

    The recursive descent parser passes along a pointer to
    JSONParserContext.  It additionally passes a pointer to interpolation
    state (a va_alist *) as needed to reach its consumer
    parse_interpolation().
    
    Stuffing the latter pointer into JSONParserContext saves us the
    trouble of passing it along, so do that.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-56-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    ada74c3 View commit details
    Browse the repository at this point in the history
  6. tests/drive_del-test: Fix harmless JSON interpolation bug

    test_after_failed_device_add() does this:
    
        response = qmp("{'execute': 'device_add',"
                       " 'arguments': {"
                       "   'driver': 'virtio-blk-%s',"
                       "   'drive': 'drive0'"
                       "}}", qvirtio_get_dev_type());
    
    Wrong.  An interpolation specification must be a JSON token, it
    doesn't work within JSON string tokens.  The code above doesn't use
    the value of qvirtio_get_dev_type(), and sends arguments
    
        {"driver": "virtio-blk-%s", "drive": "drive0"}}
    
    The command fails because there is no driver named "virtio-blk-%".
    Harmless, since the test wants the command to fail.  Screwed up in
    commit 2f84a92.
    
    Fix the obvious way.  The command now fails because the drive is
    empty, like it did before commit 2f84a92.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-55-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    83273e8 View commit details
    Browse the repository at this point in the history
  7. json: Clean up headers

    The JSON parser has three public headers, json-lexer.h, json-parser.h,
    json-streamer.h.  They all contain stuff that is of no interest
    outside qobject/json-*.c.
    
    Collect the public interface in include/qapi/qmp/json-parser.h, and
    everything else in qobject/json-parser-int.h.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-54-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    86cdf9e View commit details
    Browse the repository at this point in the history
  8. qobject: Drop superfluous includes of qemu-common.h

    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-53-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    812ce33 View commit details
    Browse the repository at this point in the history
  9. json: Make JSONToken opaque outside json-parser.c

    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-52-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    abe7c20 View commit details
    Browse the repository at this point in the history
  10. json: Unbox tokens queue in JSONMessageParser

    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-51-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    a2731e0 View commit details
    Browse the repository at this point in the history
  11. json: Streamline json_message_process_token()

    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-50-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    8d3265b View commit details
    Browse the repository at this point in the history
  12. json: Enforce token count and size limits more tightly

    Token count and size limits exist to guard against excessive heap
    usage.  We check them only after we created the token on the heap.
    That's assigning a cowboy to the barn to lasso the horse after it has
    bolted.  Close the barn door instead: check before we create the
    token.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20180823164025.12553-49-armbru@redhat.com>
    Markus Armbruster committed Aug 24, 2018
    Copy the full SHA
    da09cfb View commit details
    Browse the repository at this point in the history
Older