1. 01 6月, 2015 1 次提交
  2. 10 3月, 2015 1 次提交
  3. 26 2月, 2015 1 次提交
    • M
      qdev: Don't exit when running into bad -global · 25f8dd96
      Markus Armbruster 提交于
      -global lets you set a nice booby-trap for yourself:
      
          $ qemu-system-x86_64 -nodefaults -S -display none -usb -monitor stdio -global usb-mouse.usb_version=l
          QEMU 2.1.94 monitor - type 'help' for more information
          (qemu) device_add usb-mouse
          Parameter 'usb_version' expects an int64 value or range
          $ echo $?
          1
      
      Not nice.  Until commit 31962700 we even abort()ed.
      
      The same error triggers if you manage to screw up a machine type's
      compat_props.  To demonstrate, change HW_COMPAT_2_1's entry to
      
                  .driver   = "usb-mouse",\
                  .property = "usb_version",\
                  .value    = "1", \
      
      Then run
      
          $ qemu-system-x86_64 -usb -M pc-i440fx-2.1 -device usb-mouse
          upstream-qemu: -device usb-mouse: Parameter 'usb_version' expects an int64 value or range
          $ echo $?
          1
      
      One of our creatively cruel error messages.
      
      Since this is actually a coding error, we *should* abort() here.
      Replace the error by an assertion failure in this case.
      
      But turn the fatal error into a mere warning when the faulty
      GlobalProperty comes from the user.  Looks like this:
      
          $ qemu-system-x86_64 -nodefaults -S -display none -usb -monitor stdio -global usb-mouse.usb_version=l
          QEMU 2.1.94 monitor - type 'help' for more information
          (qemu) device_add usb-mouse
          Warning: global usb-mouse.usb_version=l ignored (Parameter 'usb_version' expects an int64 value or range)
          (qemu)
      
      This is consistent with how we handle similarly unusable -global in
      qdev_prop_check_globals().
      
      You could argue that the error should make device_add fail.  Would be
      harder, because we're running within TypeInfo's instance_post_init()
      method device_post_init(), which can't fail.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      
      25f8dd96
  4. 20 10月, 2014 1 次提交
    • M
      hw: Convert from BlockDriverState to BlockBackend, mostly · 4be74634
      Markus Armbruster 提交于
      Device models should access their block backends only through the
      block-backend.h API.  Convert them, and drop direct includes of
      inappropriate headers.
      
      Just four uses of BlockDriverState are left:
      
      * The Xen paravirtual block device backend (xen_disk.c) opens images
        itself when set up via xenbus, bypassing blockdev.c.  I figure it
        should go through qmp_blockdev_add() instead.
      
      * Device model "usb-storage" prompts for keys.  No other device model
        does, and this one probably shouldn't do it, either.
      
      * ide_issue_trim_cb() uses bdrv_aio_discard() instead of
        blk_aio_discard() because it fishes its backend out of a BlockAIOCB,
        which has only the BlockDriverState.
      
      * PC87312State has an unused BlockDriverState[] member.
      
      The next two commits take care of the latter two.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4be74634
  5. 15 10月, 2014 2 次提交
  6. 19 9月, 2014 2 次提交
  7. 06 6月, 2014 1 次提交
    • D
      qdev: Display warning about unused -global · 9f9260a3
      Don Slutz 提交于
      This can help a user understand why -global was ignored.
      
      For example: with "-vga cirrus"; "-global vga.vgamem_mb=16" is just
      ignored when "-global cirrus-vga.vgamem_mb=16" is not.
      
      This is currently clear when the wrong property is provided:
      
      out/x86_64-softmmu/qemu-system-x86_64 -global cirrus-vga.vram_size_mb=16 -monitor pty -vga cirrus
      char device redirected to /dev/pts/20 (label compat_monitor0)
      qemu-system-x86_64: Property '.vram_size_mb' not found
      Aborted (core dumped)
      
      vs
      
      out/x86_64-softmmu/qemu-system-x86_64 -global vga.vram_size_mb=16 -monitor pty -vga cirrus
      char device redirected to /dev/pts/20 (label compat_monitor0)
      VNC server running on `::1:5900'
      ^Cqemu: terminating on signal 2
      Signed-off-by: NDon Slutz <dslutz@verizon.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      9f9260a3
  8. 06 5月, 2014 1 次提交
    • M
      qom: Clean up fragile use of error_is_set() in set() methods · 65cd9064
      Markus Armbruster 提交于
      Using error_is_set(ERRP) to find out whether a function failed is
      either wrong, fragile, or unnecessarily opaque.  It's wrong when ERRP
      may be null, because errors go undetected when it is.  It's fragile
      when proving ERRP non-null involves a non-local argument.  Else, it's
      unnecessarily opaque (see commit 84d18f06).
      
      I guess the error_is_set(errp) in the ObjectProperty set() methods are
      merely fragile right now, because I can't find a call chain that
      passes a null errp argument.
      
      Make the code more robust and more obviously correct: receive the
      error in a local variable, then propagate it through the parameter.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      65cd9064
  9. 25 4月, 2014 1 次提交
  10. 20 3月, 2014 1 次提交
    • S
      qom: Add check() argument to object_property_add_link() · 39f72ef9
      Stefan Hajnoczi 提交于
      There are currently three types of object_property_add_link() callers:
      
      1. The link property may be set at any time.
      2. The link property of a DeviceState instance may only be set before
         realize.
      3. The link property may never be set, it is read-only.
      
      Something similar can already be achieved with
      object_property_add_str()'s set() argument.  Follow its example and add
      a check() argument to object_property_add_link().
      
      Also provide default check() functions for case #1 and #2.  Case #3 is
      covered by passing a NULL function pointer.
      
      Cc: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Anthony Liguori <aliguori@amazon.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      [AF: Tweaked documentation comment]
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      39f72ef9
  11. 15 2月, 2014 9 次提交
  12. 07 1月, 2014 1 次提交
  13. 31 7月, 2013 2 次提交
  14. 30 7月, 2013 1 次提交
  15. 29 7月, 2013 1 次提交
  16. 07 5月, 2013 2 次提交
  17. 16 4月, 2013 2 次提交
  18. 09 4月, 2013 2 次提交
  19. 26 3月, 2013 1 次提交
  20. 16 3月, 2013 1 次提交
    • P
      qdev: Implement (variable length) array properties · 0be6bfac
      Peter Maydell 提交于
      Add support for declaring array properties for qdev devices.
      These work by defining an initial static property 'len-arrayname'
      which the user of the device should set to the desired size
      of the array. When this property is set, memory is allocated
      for the array elements, and dynamic properties "arrayname[0]",
      "arrayname[1]"... are created so the user of the device can
      then set the values of the individual array elements.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0be6bfac
  21. 01 3月, 2013 1 次提交
    • P
      hw: include hw header files with full paths · 83c9f4ca
      Paolo Bonzini 提交于
      Done with this script:
      
      cd hw
      for i in `find . -name '*.h' | sed 's/^..//'`; do
        echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
      done | sed -i -f - `find . -type f`
      
      This is so that paths remain valid as files are moved.
      
      Instead, files in hw/dataplane are referenced with the relative path.
      We know they are not going to move to include/, and they are the only
      include files that are in subdirectories _and_ move.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83c9f4ca
  22. 16 1月, 2013 1 次提交
  23. 19 12月, 2012 4 次提交