Skip to content
Snippets Groups Projects
  1. Jan 14, 2019
    • Eric Blake's avatar
      nbd: Merge nbd_export_bitmap into nbd_export_new · 678ba275
      Eric Blake authored
      
      We only have one caller that wants to export a bitmap name,
      which it does right after creation of the export. But there is
      still a brief window of time where an NBD client could see the
      export but not the dirty bitmap, which a robust client would
      have to interpret as meaning the entire image should be treated
      as dirty.  Better is to eliminate the window entirely, by
      inlining nbd_export_bitmap() into nbd_export_new(), and refusing
      to create the bitmap in the first place if the requested bitmap
      can't be located.
      
      We also no longer need logic for setting a different bitmap
      name compared to the bitmap being exported.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20190111194720.15671-8-eblake@redhat.com>
      678ba275
    • Eric Blake's avatar
      nbd: Remove x-nbd-server-add-bitmap · 7dc570b3
      Eric Blake authored
      
      Now that nbd-server-add can do the same functionality (well, other
      than making the exported bitmap name different than the underlying
      bitamp - but we argued that was not essential, since it is just as
      easy to create a new non-persistent bitmap with the desired name),
      we no longer need the experimental separate command.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20190111194720.15671-7-eblake@redhat.com>
      7dc570b3
    • Eric Blake's avatar
      nbd: Allow bitmap export during QMP nbd-server-add · 5fcbeb06
      Eric Blake authored
      With the experimental x-nbd-server-add-bitmap command, there was
      a window of time where an NBD client could see the export but not
      the associated dirty bitmap, which can cause a client that planned
      on using the dirty bitmap to be forced to treat the entire image
      as dirty as a safety fallback.  Furthermore, if the QMP client
      successfully exports a disk but then fails to add the bitmap, it
      has to take on the burden of removing the export.  Since we don't
      allow changing the exposed dirty bitmap (whether to a different
      bitmap, or removing advertisement of the bitmap), it is nicer to
      make the bitmap tied to the export at the time the export is
      created, with automatic failure to export if the bitmap is not
      available.
      
      The experimental command included an optional 'bitmap-export-name'
      field for remapping the name exposed over NBD to be different from
      the bitmap name stored on disk.  However, my libvirt demo code
      for implementing differential backups on top of persistent bitmaps
      did not need to take advantage of that feature (it is instead
      possible to create a new temporary bitmap with the desired name,
      use block-dirty-bitmap-merge to merge one or more persistent
      bitmaps into the temporary, then associate the temporary with the
      NBD export, if control is needed over the exported bitmap name).
      Hence, I'm not copying that part of the experiment over to the
      stable addition. For more details on the libvirt demo, see
      https://www.redhat.com/archives/libvir-list/2018-October/msg01254.html,
      https://kvmforum2018.sched.com/event/FzuB/facilitating-incremental-backup-eric-blake-red-hat
      
      
      
      This patch focuses on the user interface, and reduces (but does
      not completely eliminate) the window where an NBD client can see
      the export but not the dirty bitmap, with less work to clean up
      after errors.  Later patches will add further cleanups now that
      this interface is declared stable via a single QMP command,
      including removing the race window.
      
      Update test 223 to use the new interface.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20190111194720.15671-6-eblake@redhat.com>
      5fcbeb06
    • Eric Blake's avatar
      nbd: Merge nbd_export_set_name into nbd_export_new · 3fa4c765
      Eric Blake authored
      
      The existing NBD code had a weird split where nbd_export_new()
      created an export but did not add it to the list of exported
      names until a later nbd_export_set_name() came along and grabbed
      a second reference on the object; later, the first call to
      nbd_export_close() drops the second reference while removing
      the export from the list.  This is in part because the QAPI
      NbdServerRemoveNode enum documents the possibility of adding a
      mode where we could do a soft disconnect: preventing new clients,
      but waiting for existing clients to gracefully quit, based on
      the mode used when calling nbd_export_close().
      
      But in spite of all that, note that we never change the name of
      an NBD export while it is exposed, which means it is easier to
      just inline the process of setting the name as part of creating
      the export.
      
      Inline the contents of nbd_export_set_name() and
      nbd_export_set_description() into the two points in an export
      lifecycle where they matter, then adjust both callers to pass
      the name up front.  Note that for creation, all callers pass a
      non-NULL name, (passing NULL at creation was for old style
      servers, but we removed support for that in commit 7f7dfe2a),
      so we can add an assert and do things unconditionally; but for
      cleanup, because of the dual nature of nbd_export_close(), we
      still have to be careful to avoid use-after-free.  Along the
      way, add a comment reminding ourselves of the potential of
      adding a middle mode disconnect.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20190111194720.15671-5-eblake@redhat.com>
      3fa4c765
    • Eric Blake's avatar
      nbd: Only require disabled bitmap for read-only exports · 702aa50d
      Eric Blake authored
      
      Our initial implementation of x-nbd-server-add-bitmap put
      in a restriction because of incremental backups: in that
      usage, we are exporting one qcow2 file (the temporary overlay
      target of a blockdev-backup sync:none job) and a dirty bitmap
      owned by a second qcow2 file (the source of the
      blockdev-backup, which is the backing file of the temporary).
      While both qcow2 files are still writable (the target in
      order to capture copy-on-write of old contents, and the
      source in order to track live guest writes in the meantime),
      the NBD client expects to see constant data, including the
      dirty bitmap.  An enabled bitmap in the source would be
      modified by guest writes, which is at odds with the NBD
      export being a read-only constant view, hence the initial
      code choice of enforcing a disabled bitmap (the intent is
      that the exposed bitmap was disabled in the same transaction
      that started the blockdev-backup job, although we don't want
      to track enough state to actually enforce that).
      
      However, consider the case of a bitmap contained in a read-only
      node (including when the bitmap is found in a backing layer of
      the active image).  Because the node can't be modified, the
      bitmap won't change due to writes, regardless of whether it is
      still enabled.  Forbidding the export unless the bitmap is
      disabled is awkward, paritcularly since we can't change the
      bitmap to be disabled (because the node is read-only).
      
      Alternatively, consider the case of live storage migration,
      where management directs the destination to create a writable
      NBD server, then performs a drive-mirror from the source to
      the target, prior to doing the rest of the live migration.
      Since storage migration can be time-consuming, it may be wise
      to let the destination include a dirty bitmap to track which
      portions it has already received, where even if the migration
      is interrupted and restarted, the source can query the
      destination block status in order to potentially minimize
      re-sending data that has not changed in the meantime on a
      second attempt. Such code has not been written, and might not
      be trivial (after all, a cluster being marked dirty in the
      bitmap does not necessarily guarantee it has the desired
      contents), but it makes sense that letting an active dirty
      bitmap be exposed and changing alongside writes may prove
      useful in the future.
      
      Solve both issues by gating the restriction against a
      disabled bitmap to only happen when the caller has requested
      a read-only export, and where the BDS that owns the bitmap
      (whether or not it is the BDS handed to nbd_export_new() or
      from its backing chain) is still writable.  We could drop
      the check altogether (if management apps are prepared to
      deal with a changing bitmap even on a read-only image), but
      for now keeping a check for the read-only case still stands
      a chance of preventing management errors.
      
      Update iotest 223 to show the looser behavior by leaving
      a bitmap enabled the whole run; note that we have to tear
      down and re-export a node when handling an error.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20190111194720.15671-4-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      702aa50d
    • Eric Blake's avatar
      nbd: Forbid nbd-server-stop when server is not running · 7801c3a7
      Eric Blake authored
      
      Since we already forbid other nbd-server commands when not
      in the right state, it is unlikely that any caller was relying
      on a second stop to behave as a silent no-op.  Update iotest
      223 to show the improved behavior.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20190111194720.15671-3-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      7801c3a7
    • Eric Blake's avatar
      nbd: Add some error case testing to iotests 223 · 2d2fd674
      Eric Blake authored
      
      Testing success paths is important, but it's also nice to highlight
      expected failure handling, to show that we don't crash, and so that
      upcoming tests that change behavior can demonstrate the resulting
      effects on error paths.
      
      Add the following errors:
      Attempting to export without a running server
      Attempting to start a second server
      Attempting to export a bad node name
      Attempting to export a name that is already exported
      Attempting to export an enabled bitmap
      Attempting to remove an already removed export
      Attempting to quit server a second time
      
      All of these properly complain except for a second server-stop,
      which will be fixed next.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20190111194720.15671-2-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      2d2fd674
    • Philippe Mathieu-Daudé's avatar
      qemu-nbd: Rename 'exp' variable clashing with math::exp() symbol · 9d976580
      Philippe Mathieu-Daudé authored
      
      The use of a variable named 'exp' prevents includes to import <math.h>.
      
      Rename it to avoid:
      
        qemu-nbd.c:64:19: error: ‘exp’ redeclared as different kind of symbol
         static NBDExport *exp;
                           ^~~
        In file included from /usr/include/features.h:428,
                         from /usr/include/bits/libc-header-start.h:33,
                         from /usr/include/stdint.h:26,
                         from /usr/lib/gcc/x86_64-redhat-linux/8/include/stdint.h:9,
                         from /source/qemu/include/qemu/osdep.h:80,
                         from /source/qemu/qemu-nbd.c:19:
        /usr/include/bits/mathcalls.h:95:1: note: previous declaration of ‘exp’ was here
          __MATHCALL_VEC (exp,, (_Mdouble_ __x));
          ^~~~~~~~~~~~~~
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20190111163519.11457-1-philmd@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      9d976580
    • John Snow's avatar
      iotests: add iotest 236 for testing bitmap merge · 14da540f
      John Snow authored
      
      New interface, new smoke test.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20181221093529.23855-12-jsnow@redhat.com>
      [eblake: fix last-minute change to echo text]
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      14da540f
    • John Snow's avatar
      iotests: implement pretty-print for log and qmp_log · 55cd64ea
      John Snow authored
      
      If iotests have lines exceeding >998 characters long, git doesn't
      want to send it plaintext to the list. We can solve this by allowing
      the iotests to use pretty printed QMP output that we can match against
      instead.
      
      As a bonus, it's much nicer for human eyes too.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-11-jsnow@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      55cd64ea
    • John Snow's avatar
      iotests: change qmp_log filters to expect QMP objects only · 08fcd611
      John Snow authored
      
      As laid out in the previous commit's message:
      
      ```
      Several places in iotests deal with serializing objects into JSON
      strings, but to add pretty-printing it seems desirable to localize
      all of those cases.
      
      log() seems like a good candidate for that centralized behavior.
      log() can already serialize json objects, but when it does so,
      it assumes filters=[] operates on QMP objects, not strings.
      
      qmp_log currently operates by dumping outgoing and incoming QMP
      objects into strings and filtering them assuming that filters=[]
      are string filters.
      ```
      
      Therefore:
      
      Change qmp_log to treat filters as if they're always qmp object filters,
      then change the logging call to rely on log()'s ability to serialize QMP
      objects, so we're not duplicating that effort.
      
      Add a qmp version of filter_testfiles and adjust the only caller using
      it for qmp_log to use the qmp version.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20181221093529.23855-10-jsnow@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      08fcd611
    • John Snow's avatar
      iotests: remove default filters from qmp_log · f8ca8609
      John Snow authored
      
      Several places in iotests deal with serializing objects into JSON
      strings, but to add pretty-printing it seems desirable to localize
      all of those cases.
      
      log() seems like a good candidate for that centralized behavior.
      log() can already serialize json objects, but when it does so,
      it assumes filters=[] operates on QMP objects, not strings.
      
      qmp_log currently operates by dumping outgoing and incoming QMP
      objects into strings and filtering them assuming that filters=[]
      are string filters.
      
      To have qmp_log use log's serialization, qmp_log will need to
      accept only qmp filters, not text filters.
      
      However, only a single caller of qmp_log actually requires any
      filters at all. I remove the default filter and add it explicitly
      to the caller in preparation for refactoring qmp_log to use rich
      filters instead.
      
      test 206 is amended to name the filter explicitly and the default
      is removed.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-9-jsnow@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      f8ca8609
    • John Snow's avatar
      iotests: add qmp recursive sorting function · 0706e87d
      John Snow authored
      
      Python before 3.6 does not sort dictionaries (including kwargs).
      Therefore, printing QMP objects involves sorting the keys to have
      a predictable ordering in the iotests output. This means that
      iotests output will sometimes show arguments in an order not
      specified by the test author.
      
      Presently, we accomplish this by using json.dumps' sort_keys argument,
      where we only serialize the arguments dictionary, but not the command.
      
      However, if we want to pretty-print QMP objects being sent to the
      QEMU process, we need to build the entire command before logging it.
      Ordinarily, this would then involve "arguments" being sorted above
      "execute", which would necessitate a rather ugly and harder-to-read
      change to many iotests outputs.
      
      To facilitate pretty-printing AND maintaining predictable output AND
      having "arguments" sort after "execute", add a custom sort function
      that takes a dictionary and recursively builds an OrderedDict that
      maintains the specific key order we wish to see in iotests output.
      
      The qmp_log function uses this to build a QMP object that keeps
      "execute" above "arguments", but sorts all keys and keys in any
      subdicts in "arguments" lexicographically to maintain consistent
      iotests output, with no incompatible changes to any current test.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-8-jsnow@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      0706e87d
    • John Snow's avatar
      iotests: add filter_generated_node_ids · fa1151f8
      John Snow authored
      
      To mimic the common filter of the same name, but for the python tests.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-7-jsnow@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      fa1151f8
    • John Snow's avatar
      iotests.py: don't abort if IMGKEYSECRET is undefined · 58ebcb65
      John Snow authored
      
      Instead of using os.environ[], use .get with a default of empty string
      to match the setup in check to allow us to import the iotests module
      (for debugging, say) without needing a crafted environment just to
      import the module.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-6-jsnow@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      58ebcb65
    • John Snow's avatar
      block: remove 'x' prefix from experimental bitmap APIs · 0e2b7f09
      John Snow authored
      
      The 'x' prefix was added because I was uncertain of the direction we'd
      take for the libvirt API. With the general approach solidified, I feel
      comfortable committing to this API for 4.0.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-5-jsnow@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      0e2b7f09
    • John Snow's avatar
      blockdev: n-ary bitmap merge · 360d4e4e
      John Snow authored
      
      Especially outside of transactions, it is helpful to provide
      all-or-nothing semantics for bitmap merges. This facilitates
      the coalescing of multiple bitmaps into a single target for
      the "checkpoint" interpretation when assembling bitmaps that
      represent arbitrary points in time from component bitmaps.
      
      This is an incompatible change from the preliminary version
      of the API.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-4-jsnow@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      360d4e4e
    • John Snow's avatar
      block/dirty-bitmap: remove assertion from restore · 07d5a8df
      John Snow authored
      
      When making a backup of a dirty bitmap (for transactions), we want to
      restore that backup whether or not the bitmap is enabled.
      
      It is perfectly valid to write into bitmaps that are disabled. It is
      only illegitimate for the guest to have done so.
      
      Remove this assertion.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20181221093529.23855-3-jsnow@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      07d5a8df
    • John Snow's avatar
      blockdev: abort transactions in reverse order · f4de0f8c
      John Snow authored
      
      Presently, we abort transactions in the same order they were processed in.
      Bitmap commands, though, attempt to restore backup data structures on abort.
      
      That's not valid, they need to be aborted in reverse chronological order.
      
      Replace the QSIMPLEQ data structure with a QTAILQ one, so we can iterate
      in reverse for the abort phase of the transaction.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20181221093529.23855-2-jsnow@redhat.com>
      [eblake: rebase]
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      f4de0f8c
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging · 7260438b
      Peter Maydell authored
      
      RISC-V Updates for 3.2, Part 2
      
      This patch set contains a handful of Michael's CSR-related cleanups,
      which should allow us to proceed with more outstanding bug fixes that
      depend on them.
      
      Additionally, there is a patch that turns on USB.  This works for me
      when the kernel has the appropriate drivers (which will soon be in
      defconfig) and I pass
      
          -device usb-ehci
          -drive id=my_usb_disk,file=usbdisk.img,if=none,format=raw
          -device usb-storage,drive=my_usb_disk
      
      to QEMU.
      
      # gpg: Signature made Fri 11 Jan 2019 18:05:02 GMT
      # gpg:                using RSA key EF4CA1502CCBAB41
      # gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>"
      # gpg:                 aka "Palmer Dabbelt <palmer@sifive.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: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41
      
      * remotes/palmer/tags/riscv-for-master-3.2-part2:
        default-configs: Enable USB support for RISC-V machines
        RISC-V: Implement existential predicates for CSRs
        RISC-V: Implement atomic mip/sip CSR updates
        RISC-V: Implement modular CSR helper interface
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      7260438b
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kraxel/tags/input-20190111-pull-request' into staging · 4fbfedd1
      Peter Maydell authored
      
      input: avoid malloc for mouse events
      
      # gpg: Signature made Fri 11 Jan 2019 14:26:44 GMT
      # 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/input-20190111-pull-request:
        input: avoid malloc for mouse events
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      4fbfedd1
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging · d63a6af9
      Peter Maydell authored
      
      Work around test-qht-par + gprof issues
      
      Travis CI jobs are failing because of test-qht-par when gprof is
      enabled.  Temporarily disable test-qht-par if gprof is enabled,
      until we fix the bug.
      
      # gpg: Signature made Fri 11 Jan 2019 18:23:29 GMT
      # gpg:                using RSA key 2807936F984DC5A6
      # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
      # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
      
      * remotes/ehabkost/tags/machine-next-pull-request:
        tests: Disable qht-bench parallel test when using gprof
        configure: Let the TARGET_GPROF var use the regular 'y' for Yes
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      d63a6af9
  2. Jan 11, 2019
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kraxel/tags/vga-20190111-pull-request' into staging · 1fa404b6
      Peter Maydell authored
      
      vga: enable virtio test, fix ddc oob read
      
      # gpg: Signature made Fri 11 Jan 2019 13:58:12 GMT
      # 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/vga-20190111-pull-request:
        i2c-ddc: fix oob read
        tests/display-vga: Enable virtio-vga test
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      1fa404b6
    • Philippe Mathieu-Daudé's avatar
      tests: Disable qht-bench parallel test when using gprof · ce2eefd7
      Philippe Mathieu-Daudé authored
      This test is failing on the Travis CI [*] since some time now,
      disable it until it get fixed.
      
      [*] https://travis-ci.org/qemu/qemu/builds/474821674
      
      
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190103150951.17592-3-philmd@redhat.com>
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      ce2eefd7
    • Philippe Mathieu-Daudé's avatar
      configure: Let the TARGET_GPROF var use the regular 'y' for Yes · 0acf7ded
      Philippe Mathieu-Daudé authored
      
      All other variables are set using 'y', which is what the rules.mak
      functions expect to parse.
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190103150951.17592-2-philmd@redhat.com>
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      0acf7ded
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kraxel/tags/misc-20190111-pull-request' into staging · 27df21ca
      Peter Maydell authored
      
      misc: fix seabios cross build.
      
      # gpg: Signature made Fri 11 Jan 2019 11:46:47 GMT
      # 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/misc-20190111-pull-request:
        roms: seabios: Rename CROSS_COMPILE to CROSS_PREFIX
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      27df21ca
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 15bede55
      Peter Maydell authored
      
      * HAX support for Linux hosts (Alejandro)
      * esp bugfixes (Guenter)
      * Windows build cleanup (Marc-André)
      * checkpatch logic improvements (Paolo)
      * coalesced range bugfix (Paolo)
      * switch testsuite to TAP (Paolo)
      * QTAILQ rewrite (Paolo)
      * block/iscsi.c cancellation fixes (Stefan)
      * improve selection of the default accelerator (Thomas)
      
      # gpg: Signature made Fri 11 Jan 2019 14:47:40 GMT
      # gpg:                using RSA key BFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # 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/tags/for-upstream: (34 commits)
        avoid TABs in files that only contain a few
        remove space-tab sequences
        scripts: add script to convert multiline comments into 4-line format
        hw/watchdog/wdt_i6300esb: remove a unnecessary comment
        checkpatch: warn about qemu/queue.h head structs that are not typedef-ed
        qemu/queue.h: simplify reverse access to QTAILQ
        qemu/queue.h: reimplement QTAILQ without pointer-to-pointers
        qemu/queue.h: remove Q_TAILQ_{HEAD,ENTRY}
        qemu/queue.h: typedef QTAILQ heads
        qemu/queue.h: leave head structs anonymous unless necessary
        vfio: make vfio_address_spaces static
        qemu/queue.h: do not access tqe_prev directly
        test: replace gtester with a TAP driver
        test: execute g_test_run when tests are skipped
        qga: drop < Vista compatibility
        build-sys: build with Vista API by default
        build-sys: move windows defines in osdep.h header
        build-sys: don't include windows.h, osdep.h does it
        scsi: esp: Defer command completion until previous interrupts have been handled
        esp-pci: Fix status register write erase control
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      15bede55
    • Paolo Bonzini's avatar
      avoid TABs in files that only contain a few · 7d37435b
      Paolo Bonzini authored
      
      Most files that have TABs only contain a handful of them.  Change
      them to spaces so that we don't confuse people.
      
      disas, standard-headers, linux-headers and libdecnumber are imported
      from other projects and probably should be exempted from the check.
      Outside those, after this patch the following files still contain both
      8-space and TAB sequences at the beginning of the line.  Many of them
      have a majority of TABs, or were initially committed with all tabs.
      
          bsd-user/i386/target_syscall.h
          bsd-user/x86_64/target_syscall.h
          crypto/aes.c
          hw/audio/fmopl.c
          hw/audio/fmopl.h
          hw/block/tc58128.c
          hw/display/cirrus_vga.c
          hw/display/xenfb.c
          hw/dma/etraxfs_dma.c
          hw/intc/sh_intc.c
          hw/misc/mst_fpga.c
          hw/net/pcnet.c
          hw/sh4/sh7750.c
          hw/timer/m48t59.c
          hw/timer/sh_timer.c
          include/crypto/aes.h
          include/disas/bfd.h
          include/hw/sh4/sh.h
          libdecnumber/decNumber.c
          linux-headers/asm-generic/unistd.h
          linux-headers/linux/kvm.h
          linux-user/alpha/target_syscall.h
          linux-user/arm/nwfpe/double_cpdo.c
          linux-user/arm/nwfpe/fpa11_cpdt.c
          linux-user/arm/nwfpe/fpa11_cprt.c
          linux-user/arm/nwfpe/fpa11.h
          linux-user/flat.h
          linux-user/flatload.c
          linux-user/i386/target_syscall.h
          linux-user/ppc/target_syscall.h
          linux-user/sparc/target_syscall.h
          linux-user/syscall.c
          linux-user/syscall_defs.h
          linux-user/x86_64/target_syscall.h
          slirp/cksum.c
          slirp/if.c
          slirp/ip.h
          slirp/ip_icmp.c
          slirp/ip_icmp.h
          slirp/ip_input.c
          slirp/ip_output.c
          slirp/mbuf.c
          slirp/misc.c
          slirp/sbuf.c
          slirp/socket.c
          slirp/socket.h
          slirp/tcp_input.c
          slirp/tcpip.h
          slirp/tcp_output.c
          slirp/tcp_subr.c
          slirp/tcp_timer.c
          slirp/tftp.c
          slirp/udp.c
          slirp/udp.h
          target/cris/cpu.h
          target/cris/mmu.c
          target/cris/op_helper.c
          target/sh4/helper.c
          target/sh4/op_helper.c
          target/sh4/translate.c
          tcg/sparc/tcg-target.inc.c
          tests/tcg/cris/check_addo.c
          tests/tcg/cris/check_moveq.c
          tests/tcg/cris/check_swap.c
          tests/tcg/multiarch/test-mmap.c
          ui/vnc-enc-hextile-template.h
          ui/vnc-enc-zywrle.h
          util/envlist.c
          util/readline.c
      
      The following have only TABs:
      
          bsd-user/i386/target_signal.h
          bsd-user/sparc64/target_signal.h
          bsd-user/sparc64/target_syscall.h
          bsd-user/sparc/target_signal.h
          bsd-user/sparc/target_syscall.h
          bsd-user/x86_64/target_signal.h
          crypto/desrfb.c
          hw/audio/intel-hda-defs.h
          hw/core/uboot_image.h
          hw/sh4/sh7750_regnames.c
          hw/sh4/sh7750_regs.h
          include/hw/cris/etraxfs_dma.h
          linux-user/alpha/termbits.h
          linux-user/arm/nwfpe/fpopcode.h
          linux-user/arm/nwfpe/fpsr.h
          linux-user/arm/syscall_nr.h
          linux-user/arm/target_signal.h
          linux-user/cris/target_signal.h
          linux-user/i386/target_signal.h
          linux-user/linux_loop.h
          linux-user/m68k/target_signal.h
          linux-user/microblaze/target_signal.h
          linux-user/mips64/target_signal.h
          linux-user/mips/target_signal.h
          linux-user/mips/target_syscall.h
          linux-user/mips/termbits.h
          linux-user/ppc/target_signal.h
          linux-user/sh4/target_signal.h
          linux-user/sh4/termbits.h
          linux-user/sparc64/target_syscall.h
          linux-user/sparc/target_signal.h
          linux-user/x86_64/target_signal.h
          linux-user/x86_64/termbits.h
          pc-bios/optionrom/optionrom.h
          slirp/mbuf.h
          slirp/misc.h
          slirp/sbuf.h
          slirp/tcp.h
          slirp/tcp_timer.h
          slirp/tcp_var.h
          target/i386/svm.h
          target/sparc/asi.h
          target/xtensa/core-dc232b/xtensa-modules.inc.c
          target/xtensa/core-dc233c/xtensa-modules.inc.c
          target/xtensa/core-de212/core-isa.h
          target/xtensa/core-de212/xtensa-modules.inc.c
          target/xtensa/core-fsf/xtensa-modules.inc.c
          target/xtensa/core-sample_controller/core-isa.h
          target/xtensa/core-sample_controller/xtensa-modules.inc.c
          target/xtensa/core-test_kc705_be/core-isa.h
          target/xtensa/core-test_kc705_be/xtensa-modules.inc.c
          tests/tcg/cris/check_abs.c
          tests/tcg/cris/check_addc.c
          tests/tcg/cris/check_addcm.c
          tests/tcg/cris/check_addoq.c
          tests/tcg/cris/check_bound.c
          tests/tcg/cris/check_ftag.c
          tests/tcg/cris/check_int64.c
          tests/tcg/cris/check_lz.c
          tests/tcg/cris/check_openpf5.c
          tests/tcg/cris/check_sigalrm.c
          tests/tcg/cris/crisutils.h
          tests/tcg/cris/sys.c
          tests/tcg/i386/test-i386-ssse3.c
          ui/vgafont.h
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20181213223737.11793-3-pbonzini@redhat.com>
      Reviewed-by: default avatarAleksandar Markovic <amarkovic@wavecomp.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarWainer dos Santos Moschetta <wainersm@redhat.com>
      Acked-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Acked-by: default avatarEric Blake <eblake@redhat.com>
      Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarStefan Markovic <smarkovic@wavecomp.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7d37435b
    • Paolo Bonzini's avatar
      remove space-tab sequences · 72e21db7
      Paolo Bonzini authored
      
      There are not many, and they are all simple mistakes that ended up
      being committed.  Remove them.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20181213223737.11793-2-pbonzini@redhat.com>
      Reviewed-by: default avatarWainer dos Santos Moschetta <wainersm@redhat.com>
      Acked-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      72e21db7
    • Paolo Bonzini's avatar
      scripts: add script to convert multiline comments into 4-line format · 6afeb397
      Paolo Bonzini authored
      
      Since we're adding checkpatch rules to enforce 4-line multiline comment
      format, i.e. with lone /* and */, this script can be run on existing
      code so that the comment style does not become inconsistent within a
      file.
      
      The alternative to awk-in-a-shell-script could be Perl, which also
      supports -i directly, but a2p seems to have bitrotten and I didn't quite
      feel like writing this twice...
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6afeb397
    • Peng Hao's avatar
      hw/watchdog/wdt_i6300esb: remove a unnecessary comment · 7d2fcebb
      Peng Hao authored
      
      The registered memory region of i6300esb is not suitable for coalesced
      mmio, because a write for the region may trigger an immediate action
      and can't be delayed.
      
      Signed-off-by: default avatarPeng Hao <peng.hao2@zte.com.cn>
      Message-Id: <1544253511-82742-1-git-send-email-peng.hao2@zte.com.cn>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7d2fcebb
    • Paolo Bonzini's avatar
      checkpatch: warn about qemu/queue.h head structs that are not typedef-ed · 50db69a1
      Paolo Bonzini authored
      
      These are just like any other struct or union, so they should have
      CamelCase typedefs.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      50db69a1
    • Paolo Bonzini's avatar
      qemu/queue.h: simplify reverse access to QTAILQ · eae3eb3e
      Paolo Bonzini authored
      
      The new definition of QTAILQ does not require passing the headname,
      remove it.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      eae3eb3e
    • Paolo Bonzini's avatar
      qemu/queue.h: reimplement QTAILQ without pointer-to-pointers · 7274f01b
      Paolo Bonzini authored
      
      QTAILQ is a doubly linked list, with a pointer-to-pointer to the last
      element from the head, and the previous element from each node.
      
      But if you squint enough, QTAILQ becomes a combination of a singly-linked
      forwards list, and another singly-linked list which goes backwards and
      is circular.  This is the idea that lets QTAILQ implement reverse
      iteration: only, because the backwards list points inside the node,
      accessing the previous element needs to go two steps back and one
      forwards.
      
      What this patch does is implement it in these terms, without actually
      changing the in-memory layout at all.  The coexistence of the two lists
      is realized by making QTAILQ_HEAD and QTAILQ_ENTRY unions of the forwards
      pointer and a generic QTailQLink node.  Thq QTailQLink can walk the list in
      both directions; the union is needed so that the forwards pointer can
      have the correct type, as a sort of poor man's template.  While there
      are other ways to get the same layout without a union, this one has
      the advantage of simpler operation in the debugger, because the fields
      tqh_first and tqe_next still exist as before the patch.  Those fields are
      also used by scripts/qemugdb/mtree.py, so it's a good idea to preserve them.
      
      The advantage of the new representation is that the two-back-one-forward
      dance done by backwards accesses can be done all while operating on
      QTailQLinks.  No casting to the head struct is needed anymore because,
      even though the QTailQLink's forward pointer is a void *, we can use
      typeof to recover the correct type.  This patch only changes the
      implementation, not the interface.  The next patch will remove the head
      struct name from the backwards visit macros.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7274f01b
    • Paolo Bonzini's avatar
      qemu/queue.h: remove Q_TAILQ_{HEAD,ENTRY} · f95bb39c
      Paolo Bonzini authored
      
      These are not present for other kinds of queue, and unused.
      Zap them before more changes are made to the QTAILQ
      implementation.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f95bb39c
    • Paolo Bonzini's avatar
      qemu/queue.h: typedef QTAILQ heads · f481ee2d
      Paolo Bonzini authored
      
      This will be needed when we change the QTAILQ head and elem structs
      to unions.  However, it is also consistent with the usage elsewhere
      in QEMU for other list head structs (see for example FsMountList).
      
      Note that most QTAILQs only need their name in order to do backwards
      walks.  Those do not break with the struct->union change, and anyway
      the change will also remove the need to name heads when doing backwards
      walks, so those are not touched here.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f481ee2d
    • Paolo Bonzini's avatar
      qemu/queue.h: leave head structs anonymous unless necessary · b58deb34
      Paolo Bonzini authored
      
      Most list head structs need not be given a name.  In most cases the
      name is given just in case one is going to use QTAILQ_LAST, QTAILQ_PREV
      or reverse iteration, but this does not apply to lists of other kinds,
      and even for QTAILQ in practice this is only rarely needed.  In addition,
      we will soon reimplement those macros completely so that they do not
      need a name for the head struct.  So clean up everything, not giving a
      name except in the rare case where it is necessary.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b58deb34
    • Paolo Bonzini's avatar
      vfio: make vfio_address_spaces static · 10ca76b4
      Paolo Bonzini authored
      
      It is not used outside hw/vfio/common.c, so it does not need to
      be extern.
      
      Acked-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      10ca76b4
    • Paolo Bonzini's avatar
      qemu/queue.h: do not access tqe_prev directly · 70537ed5
      Paolo Bonzini authored
      
      Use the QTAILQ_IN_USE macro instead, it does the same thing but the next
      patch will change it to a different definition.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      70537ed5
    • Paolo Bonzini's avatar
      test: replace gtester with a TAP driver · 9df43317
      Paolo Bonzini authored
      gtester is deprecated by upstream glib (see for example the announcement
      at https://blog.gtk.org/2018/07/11/news-from-glib-2-58/
      
      ) and it does
      not support tests that call g_test_skip in some glib stable releases.
      
      glib suggests instead using Automake's TAP support, which gtest itself
      supports since version 2.38 (QEMU's minimum requirement is 2.40).
      We do not support Automake, but we can use Automake's code to beautify
      the TAP output.  I chose to use the Perl copy rather than the shell/awk
      one, with some changes so that it can accept TAP through stdin, in order
      to reuse Perl's TAP parsing package.  This also avoids duplicating the
      parser between tap-driver.pl and tap-merge.pl.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1543513531-1151-3-git-send-email-pbonzini@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9df43317
Loading