1. 09 1月, 2017 1 次提交
  2. 01 11月, 2016 1 次提交
  3. 28 10月, 2016 1 次提交
  4. 25 10月, 2016 2 次提交
  5. 24 10月, 2016 2 次提交
  6. 12 10月, 2016 1 次提交
    • D
      trace: provide mechanism for registering trace events · fe4db84d
      Daniel P. Berrange 提交于
      Remove the notion of there being a single global array
      of trace events, by introducing a method for registering
      groups of events.
      
      The module_call_init() needs to be invoked at the start
      of any program that wants to make use of the trace
      support. Currently this covers system emulators qemu-nbd,
      qemu-img and qemu-io.
      
      [Squashed the following fix from Daniel P. Berrange
      <berrange@redhat.com>:
      
      linux-user/bsd-user: initialize trace events subsystem
      
      The bsd-user/linux-user programs make use of the CPU emulation
      code and this now requires that the trace events subsystem
      is enabled, otherwise it'll crash trying to allocate an empty
      trace events bitmap for the CPU object.
      
      --Stefan]
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NLluís Vilanova <vilanova@ac.upc.edu>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1475588159-30598-14-git-send-email-berrange@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      fe4db84d
  7. 21 9月, 2016 2 次提交
  8. 13 9月, 2016 1 次提交
  9. 06 9月, 2016 3 次提交
  10. 11 8月, 2016 1 次提交
  11. 08 8月, 2016 1 次提交
  12. 13 7月, 2016 3 次提交
  13. 06 7月, 2016 3 次提交
    • E
      qapi: Add new visit_complete() function · 3b098d56
      Eric Blake 提交于
      Making each output visitor provide its own output collection
      function was the only remaining reason for exposing visitor
      sub-types to the rest of the code base.  Add a polymorphic
      visit_complete() function which is a no-op for input visitors,
      and which populates an opaque pointer for output visitors.  For
      maximum type-safety, also add a parameter to the output visitor
      constructors with a type-correct version of the output pointer,
      and assert that the two uses match.
      
      This approach was considered superior to either passing the
      output parameter only during construction (action at a distance
      during visit_free() feels awkward) or only during visit_complete()
      (defeating type safety makes it easier to use incorrectly).
      
      Most callers were function-local, and therefore a mechanical
      conversion; the testsuite was a bit trickier, but the previous
      cleanup patch minimized the churn here.
      
      The visit_complete() function may be called at most once; doing
      so lets us use transfer semantics rather than duplication or
      ref-count semantics to get the just-built output back to the
      caller, even though it means our behavior is not idempotent.
      
      Generated code is simplified as follows for events:
      
      |@@ -26,7 +26,7 @@ void qapi_event_send_acpi_device_ost(ACP
      |     QDict *qmp;
      |     Error *err = NULL;
      |     QMPEventFuncEmit emit;
      |-    QmpOutputVisitor *qov;
      |+    QObject *obj;
      |     Visitor *v;
      |     q_obj_ACPI_DEVICE_OST_arg param = {
      |         info
      |@@ -39,8 +39,7 @@ void qapi_event_send_acpi_device_ost(ACP
      |
      |     qmp = qmp_event_build_dict("ACPI_DEVICE_OST");
      |
      |-    qov = qmp_output_visitor_new();
      |-    v = qmp_output_get_visitor(qov);
      |+    v = qmp_output_visitor_new(&obj);
      |
      |     visit_start_struct(v, "ACPI_DEVICE_OST", NULL, 0, &err);
      |     if (err) {
      |@@ -55,7 +54,8 @@ void qapi_event_send_acpi_device_ost(ACP
      |         goto out;
      |     }
      |
      |-    qdict_put_obj(qmp, "data", qmp_output_get_qobject(qov));
      |+    visit_complete(v, &obj);
      |+    qdict_put_obj(qmp, "data", obj);
      |     emit(QAPI_EVENT_ACPI_DEVICE_OST, qmp, &err);
      
      and for commands:
      
      | {
      |     Error *err = NULL;
      |-    QmpOutputVisitor *qov = qmp_output_visitor_new();
      |     Visitor *v;
      |
      |-    v = qmp_output_get_visitor(qov);
      |+    v = qmp_output_visitor_new(ret_out);
      |     visit_type_AddfdInfo(v, "unused", &ret_in, &err);
      |-    if (err) {
      |-        goto out;
      |+    if (!err) {
      |+        visit_complete(v, ret_out);
      |     }
      |-    *ret_out = qmp_output_get_qobject(qov);
      |-
      |-out:
      |     error_propagate(errp, err);
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1465490926-28625-13-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3b098d56
    • E
      qmp-output-visitor: Favor new visit_free() function · 1830f22a
      Eric Blake 提交于
      Now that we have a polymorphic visit_free(), we no longer need
      qmp_output_visitor_cleanup(); however, we still need to
      expose the subtype for qmp_output_get_qobject().
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1465490926-28625-10-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      1830f22a
    • E
      qemu-img: Don't leak errors when outputting JSON · 911ee36d
      Eric Blake 提交于
      If our JSON output ever encounters an error, we would just silently
      leak the error object.  Instead, assert that our usage won't fail.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1465490926-28625-3-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      911ee36d
  14. 05 7月, 2016 4 次提交
    • K
      720ff280
    • E
      block: Switch discard length bounds to byte-based · b9f7855a
      Eric Blake 提交于
      Sector-based limits are awkward to think about; in our on-going
      quest to move to byte-based interfaces, convert max_discard and
      discard_alignment.  Rename them, using 'pdiscard' as an aid to
      track which remaining discard interfaces need conversion, and so
      that the compiler will help us catch the change in semantics
      across any rebased code.  The BlockLimits type is now completely
      byte-based; and in iscsi.c, sector_limits_lun2qemu() is no
      longer needed.
      
      pdiscard_alignment is made unsigned (we use power-of-2 alignments
      as bitmasks, where unsigned is easier to think about) while
      leaving max_pdiscard signed (since we still have an 'int'
      interface); this is comparable to what commit cf081fca did for
      write zeroes limits.  We may later want to make everything an
      unsigned 64-bit limit - but that requires a bigger code audit.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b9f7855a
    • E
      block: Switch transfer length bounds to byte-based · 5def6b80
      Eric Blake 提交于
      Sector-based limits are awkward to think about; in our on-going
      quest to move to byte-based interfaces, convert max_transfer_length
      and opt_transfer_length.  Rename them (dropping the _length suffix)
      so that the compiler will help us catch the change in semantics
      across any rebased code, and improve the documentation.  Use unsigned
      values, so that we don't have to worry about negative values and
      so that bit-twiddling is easier; however, we are still constrained
      by 2^31 of signed int in most APIs.
      
      When a value comes from an external source (iscsi and raw-posix),
      sanitize the results to ensure that opt_transfer is a power of 2.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5def6b80
    • D
      qemu-img: fix failed autotests · cfef6a45
      Denis V. Lunev 提交于
      There are 9 iotests failed on Ubuntu 15.10 at the moment.
      The problem is that options parsing in qemu-img is broken by the
      following commit:
          commit 10985131
          Author: Denis V. Lunev <den@openvz.org>
          Date:   Fri Jun 17 17:44:13 2016 +0300
          qemu-img: move common options parsing before commands processing
      
      This strange command line reports error
        ./qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1024
        qemu-img: Invalid image size specified!
      while original code parses it successfully.
      
      The problem is that getopt_long state should be reset. This could be done
      using this assignment according to the manual:
          optind = 0
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Eric Blake <eblake@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      cfef6a45
  15. 29 6月, 2016 2 次提交
  16. 16 6月, 2016 1 次提交
  17. 08 6月, 2016 5 次提交
  18. 07 6月, 2016 1 次提交
    • F
      Makefile: Derive "PKGVERSION" from "git describe" by default · 67a1de0d
      Fam Zheng 提交于
      Currently, if not specified in "./configure", QEMU_PKGVERSION will be
      empty. Write a rule in Makefile to generate a value from "git describe"
      combined with a possible git tree cleanness suffix, and write into a new
      header.
      
          $ cat qemu-version.h
          #define QEMU_PKGVERSION "-v2.6.0-557-gd6550e9e-dirty"
      
      Include the header in .c files where the macro is referenced. It's not
      necessary to include it in all files, otherwise each time the content of
      the file changes, all sources have to be recompiled.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-Id: <1464774261-648-3-git-send-email-famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      67a1de0d
  19. 26 5月, 2016 2 次提交
  20. 21 5月, 2016 1 次提交
  21. 12 5月, 2016 2 次提交