Skip to content

Commits

Permalink
berto-intermed…
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 Jun 23, 2015

  1. qemu-iotests: test overlapping block-stream operations

    This test case checks that it's not possible to perform two
    block-stream operations if there are nodes involved in both.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Message-id: 9701d3d627befe71e634a72323e04cd2f994adf5.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    3cd0a70 View commit details
    Browse the repository at this point in the history
  2. qemu-iotests: test block-stream operations in parallel

    This test case checks that it's possible to launch several stream
    operations in parallel in the same snapshot chain, each one involving
    a different set of nodes.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Message-id: 80e1aac9613b5c1d62d93c3059f177efe2159e4b.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    9e1e4ac View commit details
    Browse the repository at this point in the history
  3. qemu-iotests: test streaming to an intermediate layer

    This adds test_stream_intermediate(), similar to test_stream() but
    streams to the intermediate image instead.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Message-id: 42105efb010b2a8dc7d3a0d74057c1935b47af73.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    d649843 View commit details
    Browse the repository at this point in the history
  4. qemu-iotests: add no-op streaming test

    This patch tests that in a partial block-stream operation, no data is
    ever copied from the base image.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Message-id: ee6036a3d7f36c4a2940da02cce9e01d086c271b.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    fb611ee View commit details
    Browse the repository at this point in the history
  5. qemu-iotests: fix test_stream_partial()

    This test is streaming to the top layer using the intermediate image
    as the base. This is a mistake since block-stream never copies data
    from the base image and its backing chain, so this is effectively a
    no-op.
    
    In addition to fixing the base parameter, this patch also writes some
    data to the intermediate image before the test, so there's something
    to copy and the test is meaningful.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Message-id: e3a0618a90e763e0a7ac09684d1074d1d0f606aa.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    f36d776 View commit details
    Browse the repository at this point in the history
  6. docs: Document how to stream to an intermediate layer

    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-id: 5c6108fbc7c3845f1a9ca6e5fbbd82a6562483ae.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    0ce3ad2 View commit details
    Browse the repository at this point in the history
  7. block: Add QMP support for streaming to an intermediate layer

    This patch makes the 'device' parameter of the 'block-stream' command
    accept a node name as well as a device name.
    
    In addition to that, operation blockers will be checked in all
    intermediate nodes between the top and the base node.
    
    Since qmp_block_stream() now uses the error from bdrv_lookup_bs() and
    no longer returns DeviceNotFound, iotest 030 is updated to expect
    GenericError instead.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-id: f3091fbef28d3c530171d88ad912efb1e79e5331.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    8826819 View commit details
    Browse the repository at this point in the history
  8. block: Support streaming to an intermediate layer

    This makes sure that the image we are steaming into is open in
    read-write mode during the operation.
    
    Operation blockers are also set in all intermediate nodes, since they
    will be removed from the chain afterwards.
    
    Finally, this also unblocks the stream operation in backing files.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Message-id: 3a6f83f28294c46bb97896a92aa83363fb2b29a2.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    e205611 View commit details
    Browse the repository at this point in the history
  9. block: never cancel a streaming job without running stream_complete()

    We need to call stream_complete() in order to do all the necessary
    clean-ups, even if there's an early failure. At the moment it's only
    useful to make sure that s->backing_file_str is not leaked, but it
    will become more important as we introduce support for streaming to
    any intermediate node.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Message-id: d575a576c18d8972ac1a200c4022b39cbbce2507.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    929f150 View commit details
    Browse the repository at this point in the history
  10. block: allow block jobs in any arbitrary node

    Currently, block jobs can only be owned by root nodes. This patch
    allows block jobs to be in any arbitrary node, by making the following
    changes:
    
    - Block jobs can now be identified by the node name of their
      BlockDriverState in addition to the device name. Since both device
      and node names live in the same namespace there's no ambiguity.
    
    - The "device" parameter used by all commands that operate on block
      jobs can also be a node name now.
    
    - The node name is used as a fallback to fill in the BlockJobInfo
      structure and all BLOCK_JOB_* events if there is no device name for
      that job.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Max Reitz <mreitz@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-id: 5f1d264e6422d56e443972adf29bc32c2e0e176c.1435008395.git.berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    2456478 View commit details
    Browse the repository at this point in the history
  11. block: keep a list of block jobs

    The current way to obtain the list of existing block jobs is to
    iterate over all root nodes and check which ones own a job.
    
    Since we want to be able to support block jobs in other nodes as well,
    this patch keeps a list of jobs that is updated every time one is
    created or destroyed.
    
    This also updates qmp_query_block_jobs() and bdrv_drain_all() to use
    this new list.
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Message-id: cd43c2ee74533597ec7c4adaab8d833247766e64.1435008395.git.berto@igalia.com
    Cc: Max Reitz <mreitz@redhat.com>
    Cc: Eric Blake <eblake@redhat.com>
    Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    b87e340 View commit details
    Browse the repository at this point in the history
  12. iov: don't touch iov in iov_send_recv()

    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Message-id: 555D39D2.4000705@cn.fujitsu.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    wencongyang authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    6b64640 View commit details
    Browse the repository at this point in the history
  13. raw-posix: Introduce hdev_is_sg()

    Until now, an SG device was identified only by checking if its path
    started with "/dev/sg". Then, hdev_open() would set the bs->sg flag
    accordingly. The patch relies on the actual properties of the device
    instead of the specified file path.
    
    To this end, test for an SG device (e.g. /dev/sg0) by ensuring that
    all of the following holds:
    
     - The specified file name corresponds to a character device
     - The device supports the SG_GET_VERSION_NUM ioctl
     - The device supports the SG_GET_SCSI_ID ioctl
    
    Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
    Message-id: 1435056300-14924-6-git-send-email-dimara@arrikto.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    dimara authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    3307ed7 View commit details
    Browse the repository at this point in the history
  14. raw-posix: Use DPRINTF for DEBUG_FLOPPY

    Get rid of several #ifdef DEBUG_FLOPPY and substitute them with
    DPRINTF.
    
    Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-id: 1435056300-14924-5-git-send-email-dimara@arrikto.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    dimara authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    a93a398 View commit details
    Browse the repository at this point in the history
  15. raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

    Building the QEMU tools fails if we #define DEBUG_BLOCK inside
    block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y
    so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with
    a simple DPRINTF() (that does not cause bit-rot).
    
    Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-id: 1435056300-14924-4-git-send-email-dimara@arrikto.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    dimara authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    bcb2255 View commit details
    Browse the repository at this point in the history
  16. Fix migration in case of scsi-generic

    During migration, QEMU uses fsync()/fdatasync() on the open file
    descriptor for read-write block devices to flush data just before
    stopping the VM.
    
    However, fsync() on a scsi-generic device returns -EINVAL which
    causes the migration to fail. This patch skips flushing data in case
    of an SG device, since submitting SCSI commands directly via an SG
    character device (e.g. /dev/sg0) bypasses the page cache completely,
    anyway.
    
    Note that fsync() not only flushes the page cache but also the disk
    cache. The scsi-generic device never sends flushes, and for
    migration it assumes that the same SCSI device is used by the
    destination host, so it does not issue any SCSI SYNCHRONIZE CACHE
    (10) command.
    
    Finally, remove the bdrv_is_sg() test from iscsi_co_flush() since
    this is now redundant (we flush the underlying protocol at the end
    of bdrv_co_flush() which, with this patch, we never reach).
    
    Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-id: 1435056300-14924-3-git-send-email-dimara@arrikto.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    dimara authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    1b6bc94 View commit details
    Browse the repository at this point in the history
  17. block: Use bdrv_is_sg() everywhere

    Instead of checking bs->sg use bdrv_is_sg() consistently throughout
    the code.
    
    Signed-off-by: Dimitris Aragiorgis <dimara@arrikto.com>
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-id: 1435056300-14924-2-git-send-email-dimara@arrikto.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    dimara authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    b192af8 View commit details
    Browse the repository at this point in the history
  18. nvme: Fix memleak in nvme_dma_read_prp

    Signed-off-by: Lu Lina <lina.lulina@huawei.com>
    Acked-by: Keith Busch <keith.busch@intel.com>
    Message-id: 1434695254-69808-1-git-send-email-kathy.wangting@huawei.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Lu Lina authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    25940fa View commit details
    Browse the repository at this point in the history
  19. vvfat: add a label option

    Until now the vvfat volume label was hardcoded to be
    "QEMU VVFAT", now you can pass a file.label=labelname option
    to the -drive to change it.
    
    The FAT structure defines the volume label to be limited to
    11 bytes and is filled up spaces when shorter than that. The
    trailing spaces however aren't exposed to the user by
    operating systems.
    
    [Added missing comment '#' characters in block-core.json to fix build
    errors.
    --Stefan]
    
    Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
    Message-id: 1434706529-13895-2-git-send-email-w.bumiller@proxmox.com
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Blub authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    d5941dd View commit details
    Browse the repository at this point in the history
  20. util/hbitmap: Add an API to reset all set bits in hbitmap

    The function bdrv_clear_dirty_bitmap() is updated to use
    faster hbitmap_reset_all() call.
    
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
    Signed-off-by: Gonglei <arei.gonglei@huawei.com>
    Acked-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: John Snow <jsnow@redhat.com>
    Message-id: 555E868A.60506@cn.fujitsu.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    wencongyang authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    c6a8c32 View commit details
    Browse the repository at this point in the history
  21. virtio-blk: Use blk_drain() to drain IO requests

    Each call of the virtio_blk_reset() function calls blk_drain_all(),
    which works for all existing BlockDriverStates, while draining only
    one is needed.
    
    This patch replaces blk_drain_all() by blk_drain() in
    virtio_blk_reset(). virtio_blk_data_plane_stop() should be called
    after draining because it restores vblk->complete_request.
    
    Cc: "Michael S. Tsirkin" <mst@redhat.com>
    Cc: Christian Borntraeger <borntraeger@de.ibm.com>
    Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
    Cc: Kevin Wolf <kwolf@redhat.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
    Message-id: 1434537440-28236-3-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    zpp0 authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    6e40b3b View commit details
    Browse the repository at this point in the history
  22. block-backend: Introduce blk_drain()

    This patch introduces the blk_drain() function which allows to replace
    blk_drain_all() when only one BlockDriverState needs to be drained.
    
    Cc: Christian Borntraeger <borntraeger@de.ibm.com>
    Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
    Cc: Kevin Wolf <kwolf@redhat.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Acked-by: Kevin Wolf <kwolf@redhat.com>
    Message-id: 1434537440-28236-2-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    zpp0 authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    97b0385 View commit details
    Browse the repository at this point in the history
  23. throttle: Check current timers before updating any_timer_armed[]

    Calling throttle_group_config() cancels all timers from a particular
    BlockDriverState, so any_timer_armed[] should be updated accordingly.
    
    However, with the current code it may happen that a timer is armed in
    a different BlockDriverState from the same group, so any_timer_armed[]
    would be set to false in a situation where there is still a timer
    armed.
    
    The consequence is that we might end up with two timers armed. This
    should not have any noticeable impact however, since all accesses to
    the ThrottleGroup are protected by a lock, and the situation would
    become normal again shortly thereafter as soon as all timers have been
    fired.
    
    The correct way to solve this is to check that we're actually
    cancelling a timer before updating any_timer_armed[].
    
    Signed-off-by: Alberto Garcia <berto@igalia.com>
    Message-id: 1434382875-3998-1-git-send-email-berto@igalia.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    bertogg authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    2f388b9 View commit details
    Browse the repository at this point in the history
  24. block: Let bdrv_drain_all() to call aio_poll() for each AioContext

    After the commit 9b536ad ("block: acquire AioContext in
    bdrv_drain_all()") the aio_poll() function got called for every
    BlockDriverState, in assumption that every device may have its own
    AioContext. If we have thousands of disks attached, there are a lot of
    BlockDriverStates but only a few AioContexts, leading to tons of
    unnecessary aio_poll() calls.
    
    This patch changes the bdrv_drain_all() function allowing it find shared
    AioContexts and to call aio_poll() only for unique ones.
    
    Cc: Christian Borntraeger <borntraeger@de.ibm.com>
    Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
    Cc: Kevin Wolf <kwolf@redhat.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Stefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Message-id: 1433936297-7098-4-git-send-email-yarygin@linux.vnet.ibm.com
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    zpp0 authored and Stefan Hajnoczi committed Jun 23, 2015
    Copy the full SHA
    f406c03 View commit details
    Browse the repository at this point in the history
  25. Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-0…

    …6-22' into staging
    
    Monitor patches
    
    # gpg: Signature made Mon Jun 22 18:56:18 2015 BST using RSA key ID EB918653
    # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
    # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
    
    * remotes/armbru/tags/pull-monitor-2015-06-22: (24 commits)
      Include monitor/monitor.h exactly where needed
      Include qapi/qmp/qerror.h exactly where needed
      qerror: Move #include out of qerror.h
      qerror: Finally unused, clean up
      qmp: Wean off qerror_report()
      tpm: Avoid qerror_report() outside QMP command handlers
      qerror: Clean up QERR_ macros to expand into a single string
      qerror: Eliminate QERR_DEVICE_NOT_FOUND
      vl: Use error_report() for --display errors
      vl: Avoid qerror_report() outside QMP command handlers
      QemuOpts: Wean off qerror_report_err()
      qdev-monitor: Propagate errors through qdev_device_add()
      qdev-monitor: Propagate errors through set_property()
      qdev-monitor: Convert qbus_find() to Error
      qdev-monitor: Fix check for full bus
      qdev-monitor: Stop error avalanche in qbus_find_recursive()
      disas: Remove uses of CPU env
      monitor: Split mon_get_cpu fn to remove ENV_GET_CPU
      monitor: Fix failure path for "S" argument
      monitor: Point to "help" command on syntax error
      ...
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Jun 23, 2015
    Copy the full SHA
    a320697 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2015

  1. Include monitor/monitor.h exactly where needed

    In particular, don't include it into headers.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    a0b1a66 View commit details
    Browse the repository at this point in the history
  2. Include qapi/qmp/qerror.h exactly where needed

    In particular, don't include it into headers.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    cc7a8ea View commit details
    Browse the repository at this point in the history
  3. qerror: Move #include out of qerror.h

    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    d49b683 View commit details
    Browse the repository at this point in the history
  4. qerror: Finally unused, clean up

    Remove it except for two things in qerror.h:
    
    * Two #include to be cleaned up separately to avoid cluttering this
      patch.
    
    * The QERR_ macros.  Mark as obsolete.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    4629ed1 View commit details
    Browse the repository at this point in the history
  5. qmp: Wean off qerror_report()

    The traditional QMP command handler interface
    
        int qmp_FOO(Monitor *mon, const QDict *params, QObject **ret_data);
    
    doesn't provide for returning an Error object.  Instead, the handler
    is expected to stash it in the monitor with qerror_report().
    
    When we rebased QMP on top of QAPI, we didn't change this interface.
    Instead, commit 776574d introduced "middle mode" as a temporary aid
    for converting existing QMP commands to QAPI one by one.  More than
    three years later, we're still using it.
    
    Middle mode has two effects:
    
    * Instead of the native input marshallers
    
          static void qmp_marshal_input_FOO(QDict *, QObject **, Error **)
    
      it generates input marshallers conforming to the traditional QMP
      command handler interface.
    
    * It suppresses generation of code to register them with
      qmp_register_command()
    
      This permits giving them internal linkage.
    
    As long as we need qmp-commands.hx, we can't use the registry behind
    qmp_register_command(), so the latter has to stay for now.
    
    The former has to go to get rid of qerror_report().  Changing all QMP
    commands to fit the QAPI mold in one go was impractical back when we
    started, but by now there are just a few stragglers left:
    do_qmp_capabilities(), qmp_qom_set(), qmp_qom_get(), qmp_object_add(),
    qmp_netdev_add(), do_device_add().
    
    Switch middle mode to generate native input marshallers, and adapt the
    stragglers.  Simplifies both the monitor code and the stragglers.
    
    Rename do_qmp_capabilities() to qmp_capabilities(), and
    do_device_add() to qmp_device_add, because that's how QMP command
    handlers are named today.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    485febc View commit details
    Browse the repository at this point in the history
  6. tpm: Avoid qerror_report() outside QMP command handlers

    qerror_report() is a transitional interface to help with converting
    existing monitor commands to QMP.  It should not be used elsewhere.
    Replace by error_report().
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    8b53a19 View commit details
    Browse the repository at this point in the history
  7. qerror: Clean up QERR_ macros to expand into a single string

    These macros expand into error class enumeration constant, comma,
    string.  Unclean.  Has been that way since commit 13f59ae.
    
    The error class is always ERROR_CLASS_GENERIC_ERROR since the previous
    commit.
    
    Clean up as follows:
    
    * Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and
      delete it from the QERR_ macro.  No change after preprocessing.
    
    * Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into
      error_setg(...).  Again, no change after preprocessing.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    c6bd8c7 View commit details
    Browse the repository at this point in the history
  8. qerror: Eliminate QERR_DEVICE_NOT_FOUND

    Error classes other than ERROR_CLASS_GENERIC_ERROR should not be used
    in new code.  Hiding them in QERR_ macros makes new uses hard to spot.
    Fortunately, there's just one such macro left.  Eliminate it with this
    coccinelle semantic patch:
    
        @@
        expression EP, E;
        @@
        -error_set(EP, QERR_DEVICE_NOT_FOUND, E)
        +error_set(EP, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", E)
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    75158eb View commit details
    Browse the repository at this point in the history
  9. vl: Use error_report() for --display errors

    Results in nicer error messages.  Before this patch:
    
        Invalid GTK option string: gtk,lirum-larum
    
    After:
    
        qemu-system-x86_64: -display gtk,lirum-larum: Invalid GTK option string
    
    Of course, the thing ought to use QemuOpts instead of parsing by hand.
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    c6bf0f7 View commit details
    Browse the repository at this point in the history
  10. vl: Avoid qerror_report() outside QMP command handlers

    qerror_report() is a transitional interface to help with converting
    existing monitor commands to QMP.  It should not be used elsewhere.
    Replace by error_report() in initial startup helpers parse_sandbox()
    and parse_add_fd().
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
    Markus Armbruster committed Jun 22, 2015
    Copy the full SHA
    1459407 View commit details
    Browse the repository at this point in the history
Older