1. 25 1月, 2017 1 次提交
  2. 13 7月, 2016 2 次提交
  3. 23 3月, 2016 2 次提交
    • V
      util: move declarations out of qemu-common.h · f348b6d1
      Veronia Bahaa 提交于
      Move declarations out of qemu-common.h for functions declared in
      utils/ files: e.g. include/qemu/path.h for utils/path.c.
      Move inline functions out of qemu-common.h and into new files (e.g.
      include/qemu/bcd.h)
      Signed-off-by: NVeronia Bahaa <veroniabahaa@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f348b6d1
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  4. 08 3月, 2016 1 次提交
  5. 29 1月, 2016 1 次提交
  6. 16 1月, 2016 2 次提交
  7. 18 12月, 2015 2 次提交
  8. 04 11月, 2015 1 次提交
  9. 13 10月, 2015 1 次提交
  10. 15 8月, 2015 1 次提交
  11. 24 7月, 2015 1 次提交
  12. 12 6月, 2015 1 次提交
    • J
      migration: Use normal VMStateDescriptions for Subsections · 5cd8cada
      Juan Quintela 提交于
      We create optional sections with this patch.  But we already have
      optional subsections.  Instead of having two mechanism that do the
      same, we can just generalize it.
      
      For subsections we just change:
      
      - Add a needed function to VMStateDescription
      - Remove VMStateSubsection (after removal of the needed function
        it is just a VMStateDescription)
      - Adjust the whole tree, moving the needed function to the corresponding
        VMStateDescription
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      5cd8cada
  13. 10 3月, 2015 3 次提交
    • M
      scsi: Improve error reporting for invalid drive property · 390e90a9
      Markus Armbruster 提交于
      When setting "realized" fails, scsi_bus_legacy_add_drive() passes the
      error to qerror_report_err(), then returns an unspecific "Setting
      drive property failed" error, which is reported further up the call
      chain.
      
      Example:
      
          $ qemu-system-x86_64 -nodefaults -S -display none \
          > -drive if=scsi,id=foo,file=tmp.qcow2 -global isa-fdc.driveA=foo
          qemu-system-x86_64: -drive if=scsi,id=foo,file=tmp.qcow2: Property 'scsi-disk.drive' can't take value 'foo', it's in use
          qemu-system-x86_64: Setting drive property failed
          qemu-system-x86_64: Initialization of device lsi53c895a failed: Device initialization failed
      
      Clean up the obvious way: simply return the original error to the
      caller.  Gets rid of the second message in the above error cascade.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      Message-Id: <1425925048-15482-4-git-send-email-armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      390e90a9
    • M
      hw: Propagate errors through qdev_prop_set_drive() · 9b3d111a
      Markus Armbruster 提交于
      Three kinds of callers:
      
      1. On failure, report the error and abort
      
         Passing &error_abort does the job.  No functional change.
      
      2. On failure, report the error and exit()
      
         This is qdev_prop_set_drive_nofail().  Error reporting moves from
         qdev_prop_set_drive() to its caller.  Because hiding away the error
         in the monitor right before exit() isn't helpful, replace
         qerror_report_err() by error_report_err().  Shouldn't make a
         difference, because qdev_prop_set_drive_nofail() should never be
         used in QMP context.
      
      3. On failure, report the error and recover
      
         This is usb_msd_init() and scsi_bus_legacy_add_drive().  Error
         reporting and freeing the error object moves from
         qdev_prop_set_drive() to its callers.
      
         Because usb_msd_init() can't run in QMP context, replace
         qerror_report_err() by error_report_err() there.
      
         No functional change.
      
         scsi_bus_legacy_add_drive() calling qerror_report_err() is of
         course inappropriate, but this commit merely makes it more obvious.
         The next one will clean it up.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      Message-Id: <1425925048-15482-3-git-send-email-armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9b3d111a
    • M
      scsi: Clean up duplicated error in legacy if=scsi code · fa617181
      Markus Armbruster 提交于
      Commit a818a4b6 changed scsi_bus_legacy_handle_cmdline() to report
      errors from scsi_bus_legacy_add_drive() with error_report() in
      addition to returning them.  That's inappropriate.
      
      Two kinds of callers:
      
      1. realize methods (devices "esp", "virtio-scsi-device" and
         "spapr-vscsi")
      
         The error object gets passed up the call chain until it gets
         reported again and freed.
      
         Example:
      
         $ qemu-system-arm -M virt -S -display none \
         > -drive if=scsi,id=foo,bus=1,file=tmp.qcow2 \
         > -device nec-usb-xhci -device usb-storage,drive=foo \
         > -device virtio-scsi-pci
         qemu-system-arm: -drive if=scsi,id=foo,bus=1,file=tmp.qcow2: Property 'scsi-disk.drive' can't take value 'foo', it's in use
         qemu-system-arm: -drive if=scsi,id=foo,bus=1,file=tmp.qcow2: Setting drive property failed
         qemu-system-arm: -device virtio-scsi-pci: Setting drive property failed
         qemu-system-arm: -device virtio-scsi-pci: Device initialization failed
         qemu-system-arm: -device virtio-scsi-pci: Device 'virtio-scsi-pci' could not be initialized
      
         The second message in this error cascade comes from
         scsi_bus_legacy_handle_cmdline().  The error object then gets
         passed up to the qdev_init() called from
         virtio_scsi_pci_init_pci(), which reports it again.
      
      2. init methods (devices "am53c974", "dc390", "lsi53c895a",
         "lsi53c810", "megasas", "megasas-gen2")
      
         init methods need to report their errors with qerror_report().
         These don't.  The inappropriate error_report() papers over the bug.
      
         error_report() isn't the same as qerror_report() in QMP context,
         but this can't actually happen: QMP can still only hot-plug, and
         callers call scsi_bus_legacy_handle_cmdline() only on cold-plug.
         Except for sysbus_esp_realize(), but that can't be hot-plugged at
         all, as far as I can tell.
      
      Fix the init methods and drop the inappropriate error_report() in
      scsi_bus_legacy_handle_cmdline().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      Message-Id: <1425925048-15482-2-git-send-email-armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fa617181
  14. 27 2月, 2015 1 次提交
    • P
      scsi: give device a parent before setting properties · 22647504
      Paolo Bonzini 提交于
      This mimics what is done in qdev_device_add, and lets the device be
      freed in case something goes wrong.  Otherwise, object_unparent returns
      immediately without freeing the device, which is on the other hand left
      in the parent bus's list of children.
      
      scsi_bus_legacy_handle_cmdline then returns an error, and the HBA is
      destroyed as well with object_unparent.  But the lingering device that
      was not removed in scsi_bus_legacy_add_drive cannot be removed now either,
      and bus_unparent gets stuck in an infinite loop trying to empty the list
      of children.
      
      The right fix of course would be to assert in bus_add_child that the
      device already has a bus, and remove the "safety net" that adds the
      drive to the QOM tree in device_set_realized.  I am not yet sure whether
      that would entail changing all callers to qdev_create (as well as
      isa_create and usb_create and the corresponding _try_create versions).
      Reported-by: NMarkus Armbruster <armbru@redhat.com>
      Tested-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      22647504
  15. 02 2月, 2015 1 次提交
  16. 14 1月, 2015 1 次提交
  17. 31 10月, 2014 3 次提交
  18. 20 10月, 2014 2 次提交
  19. 15 10月, 2014 4 次提交
  20. 30 9月, 2014 4 次提交
  21. 23 9月, 2014 1 次提交
    • F
      scsi: Optimize scsi_req_alloc · 61e68b3f
      Fam Zheng 提交于
      Zeroing sense buffer for each scsi request is not efficient, we can just
      leave it uninitialized because sense_len is set to 0.
      
      Move the implicitly zeroed fields to the end of the structure and use a
      partial memset.
      
      The explicitly initialized fields (by scsi_req_alloc or scsi_req_new)
      are moved to the beginning of the structure, before sense buffer, to
      skip the memset.
      
      Also change g_malloc0 to g_slice_alloc.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      61e68b3f
  22. 26 8月, 2014 1 次提交
  23. 29 7月, 2014 3 次提交