Skip to content
Snippets Groups Projects
  1. Mar 08, 2021
    • Vladimir Sementsov-Ogievskiy's avatar
      blockjob: return status from block_job_set_speed() · 775d0c05
      Vladimir Sementsov-Ogievskiy authored
      
      Better to return status together with setting errp. It allows to avoid
      error propagation in the caller.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
      Message-Id: <20210202124956.63146-8-vsementsov@virtuozzo.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      775d0c05
    • Vladimir Sementsov-Ogievskiy's avatar
      block/mirror: drop extra error propagation in commit_active_start() · eb5becc1
      Vladimir Sementsov-Ogievskiy authored
      
      Let's check return value of mirror_start_job to check for failure
      instead of local_err.
      
      Rename ret to job, as ret is usually integer variable.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
      Message-Id: <20210202124956.63146-7-vsementsov@virtuozzo.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      eb5becc1
    • Vladimir Sementsov-Ogievskiy's avatar
      block: drop extra error propagation for bdrv_set_backing_hd · dc9c10a1
      Vladimir Sementsov-Ogievskiy authored
      
      bdrv_set_backing_hd now returns status, let's use it.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
      Message-Id: <20210202124956.63146-6-vsementsov@virtuozzo.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      dc9c10a1
    • Vladimir Sementsov-Ogievskiy's avatar
      blockdev: fix drive_backup_prepare() missed error · 5a11a1ca
      Vladimir Sementsov-Ogievskiy authored
      
      We leak local_err and don't report failure to the caller. It's
      definitely wrong, let's fix.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
      Message-Id: <20210202124956.63146-5-vsementsov@virtuozzo.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      5a11a1ca
    • Vladimir Sementsov-Ogievskiy's avatar
      block: check return value of bdrv_open_child and drop error propagation · bc520249
      Vladimir Sementsov-Ogievskiy authored
      
      This patch is generated by cocci script:
      
      @@
      symbol bdrv_open_child, errp, local_err;
      expression file;
      @@
      
        file = bdrv_open_child(...,
      -                        &local_err
      +                        errp
                              );
      - if (local_err)
      + if (!file)
        {
            ...
      -     error_propagate(errp, local_err);
            ...
        }
      
      with command
      
      spatch --sp-file x.cocci --macro-file scripts/cocci-macro-file.h \
      --in-place --no-show-diff --max-width 80 --use-gitgrep block
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Reviewed-by: default avatarAlberto Garcia <berto@igalia.com>
      Message-Id: <20210202124956.63146-4-vsementsov@virtuozzo.com>
      [eblake: fix qcow2_do_open() to use ERRP_GUARD, necessary as the only
      caller to pass allow_none=true]
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      bc520249
    • Eric Blake's avatar
      utils: Deprecate hex-with-suffix sizes · f174cd33
      Eric Blake authored
      
      Supporting '0x20M' looks odd, particularly since we have a 'B' suffix
      that is ambiguous for bytes, as well as a less-frequently-used 'E'
      suffix for extremely large exibytes.  In practice, people using hex
      inputs are specifying values in bytes (and would have written
      0x2000000, or possibly relied on default_suffix in the case of
      qemu_strtosz_MiB), and the use of scaling suffixes makes the most
      sense for inputs in decimal (where the user would write 32M).  But
      rather than outright dropping support for hex-with-suffix, let's
      follow our deprecation policy.  Sadly, since qemu_strtosz() does not
      have an Err** parameter, and plumbing that in would be a much larger
      task, we instead go with just directly emitting the deprecation
      warning to stderr.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20210211204438.1184395-4-eblake@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      f174cd33
    • Eric Blake's avatar
      utils: Improve qemu_strtosz() to have 64 bits of precision · cf923b78
      Eric Blake authored
      
      We have multiple clients of qemu_strtosz (qemu-io, the opts visitor,
      the keyval visitor), and it gets annoying that edge-case testing is
      impacted by implicit rounding to 53 bits of precision due to parsing
      with strtod().  As an example posted by Rich Jones:
       $ nbdkit memory $(( 2**63 - 2**30 )) --run \
         'build/qemu-io -f raw "$uri" -c "w -P 3 $(( 2**63 - 2**30 - 512 )) 512" '
       write failed: Input/output error
      
      because 9223372035781033472 got rounded to 0x7fffffffc0000000 which is
      out of bounds.
      
      It is also worth noting that our existing parser, by virtue of using
      strtod(), accepts decimal AND hex numbers, even though test-cutils
      previously lacked any coverage of the latter until the previous patch.
      We do have existing clients that expect a hex parse to work (for
      example, iotest 33 using qemu-io -c "write -P 0xa 0x200 0x400"), but
      strtod() parses "08" as 8 rather than as an invalid octal number, so
      we know there are no clients that depend on octal.  Our use of
      strtod() also means that "0x1.8k" would actually parse as 1536 (the
      fraction is 8/16), rather than 1843 (if the fraction were 8/10); but
      as this was not covered in the testsuite, I have no qualms forbidding
      hex fractions as invalid, so this patch declares that the use of
      fractions is only supported with decimal input, and enhances the
      testsuite to document that.
      
      Our previous use of strtod() meant that -1 parsed as a negative; now
      that we parse with strtoull(), negative values can wrap around modulo
      2^64, so we have to explicitly check whether the user passed in a '-';
      and make it consistent to also reject '-0'.  This has the minor effect
      of treating negative values as EINVAL (with no change to endptr)
      rather than ERANGE (with endptr advanced to what was parsed), visible
      in the updated iotest output.
      
      We also had no testsuite coverage of "1.1e0k", which happened to parse
      under strtod() but is unlikely to occur in practice; as long as we are
      making things more robust, it is easy enough to reject the use of
      exponents in a strtod parse.
      
      The fix is done by breaking the parse into an integer prefix (no loss
      in precision), rejecting negative values (since we can no longer rely
      on strtod() to do that), determining if a decimal or hexadecimal parse
      was intended (with the new restriction that a fractional hex parse is
      not allowed), and where appropriate, using a floating point fractional
      parse (where we also scan to reject use of exponents in the fraction).
      The bulk of the patch is then updates to the testsuite to match our
      new precision, as well as adding new cases we reject (whether they
      were rejected or inadvertently accepted before).
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20210211204438.1184395-3-eblake@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      cf923b78
    • Eric Blake's avatar
      utils: Enhance testsuite for do_strtosz() · 1657ba44
      Eric Blake authored
      
      Enhance our testsuite coverage of do_strtosz() to cover some things we
      know that existing users want to continue working (hex bytes), as well
      as some things that accidentally work but shouldn't (hex fractions) or
      accidentally fail but that users want to work (64-bit precision on
      byte values).  This includes fixing a typo in the comment regarding
      our parsing near 2^64.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20210211204438.1184395-2-eblake@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      1657ba44
    • Nir Soffer's avatar
      nbd: server: Report holes for raw images · 0da98568
      Nir Soffer authored
      When querying image extents for raw image, qemu-nbd reports holes as
      zero:
      
      $ qemu-nbd -t -r -f raw empty-6g.raw
      
      $ qemu-img map --output json nbd://localhost
      [{ "start": 0, "length": 6442450944, "depth": 0, "zero": true, "data": true, "offset": 0}]
      
      $ qemu-img map --output json empty-6g.raw
      [{ "start": 0, "length": 6442450944, "depth": 0, "zero": true, "data": false, "offset": 0}]
      
      Turns out that qemu-img map reports a hole based on BDRV_BLOCK_DATA, but
      nbd server reports a hole based on BDRV_BLOCK_ALLOCATED.
      
      The NBD protocol says:
      
          NBD_STATE_HOLE (bit 0): if set, the block represents a hole (and
          future writes to that area may cause fragmentation or encounter an
          NBD_ENOSPC error); if clear, the block is allocated or the server
          could not otherwise determine its status.
      
      qemu-img manual says:
      
          whether the sectors contain actual data or not (boolean field data;
          if false, the sectors are either unallocated or stored as
          optimized all-zero clusters);
      
      To me, data=false looks compatible with NBD_STATE_HOLE. From user point
      of view, getting same results from qemu-nbd and qemu-img is more
      important than being more correct about allocation status.
      
      Changing nbd server to report holes using BDRV_BLOCK_DATA makes qemu-nbd
      results compatible with qemu-img map:
      
      $ qemu-img map --output json nbd://localhost
      
      
      [{ "start": 0, "length": 6442450944, "depth": 0, "zero": true, "data": false, "offset": 0}]
      
      Signed-off-by: default avatarNir Soffer <nsoffer@redhat.com>
      Message-Id: <20210219160752.1826830-1-nsoffer@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      0da98568
    • Vladimir Sementsov-Ogievskiy's avatar
      MAINTAINERS: add Vladimir as co-maintainer of NBD · 3d9330ec
      Vladimir Sementsov-Ogievskiy authored
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20210304103503.21008-1-vsementsov@virtuozzo.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      3d9330ec
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging · 0436c55e
      Peter Maydell authored
      
      * fix tracing vs -daemonize (Daniel)
      * detect invalid CFI configuration (Daniele)
      * 32-bit PVH fix (David)
      * forward SCSI passthrough host-status to the SCSI HBA (Hannes)
      * detect ill-formed id in QMP object-add (Kevin)
      * miscellaneous bugfixes and cleanups (Keqian, Kostiantyn, myself, Peng Liang)
      * add nodelay option for chardev (myself)
      * deprecate -M kernel-irqchip=off on x86 (myself)
      * keep .d files (myself)
      * Fix -trace file (myself)
      
      # gpg: Signature made Sat 06 Mar 2021 10:43:12 GMT
      # gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
      # gpg:                issuer "pbonzini@redhat.com"
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini-gitlab/tags/for-upstream: (23 commits)
        meson: Stop if cfi is enabled with system slirp
        trace: skip qemu_set_log_filename if no "-D" option was passed
        trace: fix "-trace file=..."
        meson: adjust timeouts for some slower tests
        build-sys: invoke ninja with -d keepdepfile
        qemu-option: do not suggest using the delay option
        scsi: move host_status handling into SCSI drivers
        scsi: inline sg_io_sense_from_errno() into the callers.
        scsi-generic: do not snoop the output of failed commands
        scsi: Add mapping for generic SCSI_HOST status to sense codes
        scsi: Rename linux-specific SG_ERR codes to generic SCSI_HOST error codes
        qemu-config: add error propagation to qemu_config_parse
        x86/pvh: extract only 4 bytes of start address for 32 bit kernels
        elf_ops: correct loading of 32 bit PVH kernel
        lsilogic: Use PCIDevice::exit instead of DeviceState::unrealize
        accel: kvm: Add aligment assert for kvm_log_clear_one_slot
        accel: kvm: Fix memory waste under mismatch page size
        vl.c: do not execute trace_init_backends() before daemonizing
        qom: Check for wellformed id in user_creatable_add_type()
        chardev: add nodelay option
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      0436c55e
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210308' into staging · 138d2931
      Peter Maydell authored
      
      target-arm queue:
       * sbsa-ref: remove cortex-a53 from list of supported cpus
       * sbsa-ref: add 'max' to list of allowed cpus
       * target/arm: Add support for FEAT_SSBS, Speculative Store Bypass Safe
       * npcm7xx: add EMC model
       * xlnx-zynqmp: Remove obsolete 'has_rpu' property
       * target/arm: Speed up aarch64 TBL/TBX
       * virtio-mmio: improve virtio-mmio get_dev_path alog
       * target/arm: Use TCF0 and TFSRE0 for unprivileged tag checks
       * target/arm: Restrict v8M IDAU to TCG
       * target/arm/cpu: Update coding style to make checkpatch.pl happy
       * musicpal, tc6393xb, omap_lcdc, tcx: drop dead code for non-32-bit-RGB surfaces
       * Add new board: mps3-an524
      
      # gpg: Signature made Mon 08 Mar 2021 11:56:24 GMT
      # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
      # gpg:                issuer "peter.maydell@linaro.org"
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20210308: (49 commits)
        hw/arm/mps2: Update old infocenter.arm.com URLs
        docs/system/arm/mps2.rst: Document the new mps3-an524 board
        hw/arm/mps2-tz: Provide PL031 RTC on mps3-an524
        hw/arm/mps2-tz: Stub out USB controller for mps3-an524
        hw/arm/mps2-tz: Add new mps3-an524 board
        hw/arm/mps2-tz: Get armv7m_load_kernel() size argument from RAMInfo
        hw/arm/mps2-tz: Support ROMs as well as RAMs
        hw/arm/mps2-tz: Set MachineClass default_ram info from RAMInfo data
        hw/arm/mps2-tz: Make RAM arrangement board-specific
        hw/arm/mps2-tz: Allow boards to have different PPCInfo data
        hw/arm/mps2-tz: Size the uart-irq-orgate based on the number of UARTs
        hw/arm/mps2-tz: Move device IRQ info to data structures
        hw/arm/mps2-tz: Allow PPCPortInfo structures to specify device interrupts
        hw/arm/mps2-tz: Correct wrong interrupt numbers for DMA and SPI
        hw/misc/mps2-scc: Implement CFG_REG5 and CFG_REG6 for MPS3 AN524
        hw/arm/mps2-tz: Make number of IRQs board-specific
        hw/arm/mps2-tz: Condition IRQ splitting on number of CPUs, not board type
        hw/arm/mps2-tz: Make FPGAIO switch and LED config per-board
        hw/misc/mps2-fpgaio: Support SWITCH register
        hw/misc/mps2-fpgaio: Make number of LEDs configurable by board
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      138d2931
    • Peter Maydell's avatar
      hw/arm/mps2: Update old infocenter.arm.com URLs · 50b52b18
      Peter Maydell authored
      
      Update old infocenter.arm.com URLs to the equivalent developer.arm.com
      ones (the old URLs should redirect, but we might as well avoid the
      redirection notice, and the new URLs are pleasantly shorter).
      
      This commit covers the links to the MPS2 board TRM, the various
      Application Notes, the IoTKit and SSE-200 documents.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20210215115138.20465-25-peter.maydell@linaro.org
      50b52b18
    • Peter Maydell's avatar
      docs/system/arm/mps2.rst: Document the new mps3-an524 board · ced8bb04
      Peter Maydell authored
      
      Add brief documentation of the new mps3-an524 board.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20210215115138.20465-24-peter.maydell@linaro.org
      ced8bb04
    • Peter Maydell's avatar
      hw/arm/mps2-tz: Provide PL031 RTC on mps3-an524 · 41745d20
      Peter Maydell authored
      
      The AN524 has a PL031 RTC, which we have a model of; provide it
      rather than an unimplemented-device stub.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20210215115138.20465-23-peter.maydell@linaro.org
      41745d20
    • Peter Maydell's avatar
      hw/arm/mps2-tz: Stub out USB controller for mps3-an524 · a9597753
      Peter Maydell authored
      
      The AN524 has a USB controller (an ISP1763); we don't have a model of
      it but we should provide a stub "unimplemented-device" for it.  This
      is slightly complicated because the USB controller shares a PPC port
      with the ethernet controller.
      
      Implement a make_* function which provides creates a container
      MemoryRegion with both the ethernet controller and an
      unimplemented-device stub for the USB controller.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20210215115138.20465-22-peter.maydell@linaro.org
      a9597753
  2. Mar 06, 2021
Loading