1. 13 1月, 2016 1 次提交
  2. 13 7月, 2015 1 次提交
  3. 01 6月, 2015 1 次提交
  4. 10 3月, 2015 2 次提交
    • E
      BlockConf: Call backend functions to detect geometry and blocksizes · 0eb28a42
      Ekaterina Tumanova 提交于
      geometry: hd_geometry_guess function autodetects the drive geometry.
      This patch adds a block backend call, that probes the backing device
      geometry. If the inner driver method is implemented and succeeds
      (currently only for DASDs), the blkconf_geometry will pass-through
      the backing device geometry. Otherwise will fallback to old logic.
      
      blocksize: This patch initializes blocksize properties to 0.
      In order to set the property a blkconf_blocksizes was introduced.
      If user didn't set physical or logical blocksize, it will
      retrieve its value from a driver (only succeeds for DASD), otherwise
      it will set default 512 value.
      
      The blkconf_blocksizes call was added to all users of BlkConf.
      Signed-off-by: NEkaterina Tumanova <tumanova@linux.vnet.ibm.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1424087278-49393-6-git-send-email-tumanova@linux.vnet.ibm.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0eb28a42
    • 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
  5. 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
  6. 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
  7. 19 9月, 2014 1 次提交
  8. 01 7月, 2014 2 次提交
  9. 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
  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. 13 3月, 2014 1 次提交
    • S
      iothread: add "iothread" qdev property type · 6e4a876b
      Stefan Hajnoczi 提交于
      Add a "iothread" qdev property type so devices can be hooked up to an
      IOThread from the comand-line:
      
        qemu -object iothread,id=iothread0 \
             -device some-device,x-iothread=iothread0
      
      Note that Paolo Bonzini <pbonzini@redhat.com> has suggested using QOM
      links instead.  This way the relationship between the objects is
      reflected in QOM.  There are currently shortcomings of
      object_property_add_link() which prevent this use case.  I will attempt
      to fix them and move to QOM links in a separate series.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      6e4a876b
  12. 15 2月, 2014 2 次提交
  13. 25 12月, 2013 1 次提交
  14. 30 7月, 2013 1 次提交
  15. 07 5月, 2013 2 次提交
  16. 16 4月, 2013 1 次提交
  17. 09 4月, 2013 1 次提交
    • P
      hw: move headers to include/ · 0d09e41a
      Paolo Bonzini 提交于
      Many of these should be cleaned up with proper qdev-/QOM-ification.
      Right now there are many catch-all headers in include/hw/ARCH depending
      on cpu.h, and this makes it necessary to compile these files per-target.
      However, fixing this does not belong in these patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0d09e41a
  18. 26 3月, 2013 1 次提交
  19. 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
  20. 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
  21. 02 2月, 2013 1 次提交
    • J
      net: multiqueue support · 1ceef9f2
      Jason Wang 提交于
      This patch adds basic multiqueue support for qemu. The idea is simple, an array
      of NetClientStates were introduced in NICState, parse_netdev() were extended to
      find and match all NetClientStates belongs to the backend and place their
      pointers in NICConf. Then qemu_new_nic can setup a N:N mapping between NICStates
      that belongs to a nic and NICStates belongs to the netdev. And a queue_index
      were introduced in NetClientState to track its index. After this, each peers of
      a NICState were abstracted as a queue.
      
      After this change, all NetClientState that belongs to the same backend/nic has
      the same id. When use want to change the link status, all NetClientStates that
      belongs to the same backend/nic will be also changed. When user want to delete
      a device or netdev, all NetClientStates that belongs to the same backend/nic
      will be deleted also. Changing or deleting an specific queue is not allowed.
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      1ceef9f2
  22. 19 12月, 2012 1 次提交
    • E
      qdev-properties.c: Separate core from the code used only by qemu-system-* · a404b612
      Eduardo Habkost 提交于
      This separates the qdev properties code in two parts:
       - qdev-properties.c, that contains most of the qdev properties code;
       - qdev-properties-system.c for code specific for qemu-system-*,
         containing:
         - Property types: drive, chr, netdev, vlan, that depend on code that
           won't be included on *-user
         - qemu_add_globals(), that depends on qemu-config.o.
      
      This change should help on two things:
       - Allowing DeviceState to be used by *-user without pulling
         dependencies that are specific for qemu-system-*;
       - Writing qdev unit tests without pulling too many dependencies.
      
      The copyright/license of qdev-properties.c isn't explicitly stated at
      the file, so add a simple copyright/license header pointing to the
      commit ID of the original file.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      a404b612
  23. 15 11月, 2012 1 次提交
    • A
      qdev: Split up header so it can be used in cpu.h · 074a86fc
      Anthony Liguori 提交于
      Header file dependency is a frickin' nightmare right now.  cpu.h tends
      to get included in our 'include everything' header files but qdev also
      needs to include those headers mainly for qdev-properties since it knows
      about CharDriverState and friends.
      
      We can solve this for now by splitting out qdev.h along the same lines
      that we previously split the C file.  Then cpu.h just needs to include
      qdev-core.h.
      
      hw/qdev.h is split into following new headers:
          hw/qdev-core.h
          hw/qdev-properties.h
          hw/qdev-monitor.h
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      
      [ehabkost: re-add DEFINE_PROP_PCI_HOST_DEVADDR, that was removed on the
       original patch (by mistake, I guess)]
      [ehabkost: kill qdev_prop_set_vlan() declaration]
      [ehabkost: moved get_fw_dev_path() comment to the original location
       (I don't know why it was moved)]
      [ehabkost: removed qdev_exists() declaration]
      [ehabkost: keep using 'QemuOpts' instead of 'struct QemuOpts', as
       qdev-core.h includes qemu-option.h]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      074a86fc