1. 13 10月, 2014 2 次提交
  2. 05 9月, 2014 2 次提交
  3. 04 9月, 2014 1 次提交
  4. 06 7月, 2014 1 次提交
  5. 01 7月, 2014 3 次提交
  6. 23 6月, 2014 1 次提交
  7. 19 6月, 2014 4 次提交
  8. 28 5月, 2014 1 次提交
  9. 08 5月, 2014 1 次提交
  10. 06 5月, 2014 1 次提交
  11. 20 3月, 2014 3 次提交
    • P
      qdev: Introduce FWPathProvider interface · 6b1566cb
      Paolo Bonzini 提交于
      QEMU supports firmware names for all devices in the QEMU tree but
      some architectures expect some parts of firmware path names in different
      format.
      
      This introduces a firmware-pathname-change interface definition.
      If some machines needs to redefine the firmware path format, it has
      to add the TYPE_FW_PATH_PROVIDER interface to an object that is above
      the device on the QOM tree (typically /machine).
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      6b1566cb
    • 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
    • S
      qom: Make QOM link property unref optional · 9561fda8
      Stefan Hajnoczi 提交于
      Some object_property_add_link() callers expect property deletion to
      unref the link property object.  Other callers expect to manage the
      refcount themselves.  The former are currently broken and therefore leak
      the link property object.
      
      This patch adds a flags argument to object_property_add_link() so the
      caller can specify which refcount behavior they require.  The new
      OBJ_PROP_LINK_UNREF_ON_RELEASE flag causes the link pointer to be
      unreferenced when the property is deleted.
      
      This fixes refcount leaks in qdev.c, xilinx_axidma.c, xilinx_axienet.c,
      s390-virtio-bus.c, virtio-pci.c, virtio-rng.c, and ui/console.c.
      
      Rationale for refcount behavior:
      
       * hw/core/qdev.c
         - bus children are explicitly unreferenced, don't interfere
         - parent_bus is essentially a read-only property that doesn't hold a
           refcount, don't unref
         - hotplug_handler is leaked, do unref
      
       * hw/dma/xilinx_axidma.c
         - rx stream "dma" links are set using set_link, therefore they
           need unref
         - tx streams are set using set_link, therefore they need unref
      
       * hw/net/xilinx_axienet.c
         - same reasoning as hw/dma/xilinx_axidma.c
      
       * hw/pcmcia/pxa2xx.c
         - pxa2xx bypasses set_link and therefore does not use refcounts
      
       * hw/s390x/s390-virtio-bus.c
       * hw/virtio/virtio-pci.c
       * hw/virtio/virtio-rng.c
       * ui/console.c
         - set_link is used and there is no explicit unref, do unref
      
      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>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      9561fda8
  12. 13 3月, 2014 4 次提交
  13. 05 3月, 2014 1 次提交
    • A
      qdev: Keep global allocation counter per bus · 61de3676
      Alexander Graf 提交于
      When we have 2 separate qdev devices that both create a qbus of the
      same type without specifying a bus name or device name, we end up
      with two buses of the same name, such as ide.0 on the Mac machines:
      
        dev: macio-ide, id ""
          bus: ide.0
            type IDE
        dev: macio-ide, id ""
          bus: ide.0
            type IDE
      
      If we now spawn a device that connects to a ide.0 the last created
      bus gets the device, with the first created bus inaccessible to the
      command line.
      
      After some discussion on IRC we concluded that the best quick fix way
      forward for this is to make automated bus-class type based allocation
      count a global counter. That's what this patch implements. With this
      we instead get
      
        dev: macio-ide, id ""
          bus: ide.1
            type IDE
        dev: macio-ide, id ""
          bus: ide.0
            type IDE
      
      on the example mentioned above.
      
      This also means that if you did -device ...,bus=ide.0 you got a device
      on the first bus (the last created one) before this patch and get that
      device on the second one (the first created one) now.  Breaks
      migration unless you change bus=ide.0 to bus=ide.1 on the destination.
      
      This is intended and makes the bus enumeration work as expected.
      
      As per review request follows a list of otherwise affected boards and
      the reasoning for the conclusion that they are ok:
      
         target      machine         bus id              times
         ------      -------         ------              -----
      
         aarch64     n800            i2c-bus.0           2
         aarch64     n810            i2c-bus.0           2
         arm         n800            i2c-bus.0           2
         arm         n810            i2c-bus.0           2
      
      -> Devices are only created explicitly on one of the two buses, using
         s->mpu->i2c[0], so no change to the guest.
      
         aarch64     vexpress-a15    virtio-mmio-bus.0   4
         aarch64     vexpress-a9     virtio-mmio-bus.0   4
         aarch64     virt            virtio-mmio-bus.0   32
         arm         vexpress-a15    virtio-mmio-bus.0   4
         arm         vexpress-a9     virtio-mmio-bus.0   4
         arm         virt            virtio-mmio-bus.0   32
      
      -> Makes -device bus= work for all virtio-mmio buses.  Breaks
         migration.  Workaround for migration from old to new: specify
         virtio-mmio-bus.4 or .32 respectively rather than .0 on the
         destination.
      
         aarch64     xilinx-zynq-a9  usb-bus.0           2
         arm         xilinx-zynq-a9  usb-bus.0           2
         mips64el    fulong2e        usb-bus.0           2
      
      -> Normal USB operation not affected. Migration driver needs command
         line to use the other bus.
      
         i386        isapc           ide.0               2
         x86_64      isapc           ide.0               2
         mips        mips            ide.0               2
         mips64      mips            ide.0               2
         mips64el    mips            ide.0               2
         mipsel      mips            ide.0               2
         ppc         g3beige         ide.0               2
         ppc         mac99           ide.0               2
         ppc         prep            ide.0               2
         ppc64       g3beige         ide.0               2
         ppc64       mac99           ide.0               2
         ppc64       prep            ide.0               2
      
      -> Makes -device bus= work for all IDE buses.  Breaks migration.
         Workaround for migration from old to new: specify ide.1 rather than
         ide.0 on the destination.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NAndreas Faerber <afaerber@suse.de>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      61de3676
  14. 15 2月, 2014 2 次提交
  15. 10 2月, 2014 3 次提交
  16. 07 1月, 2014 2 次提交
  17. 25 12月, 2013 1 次提交
  18. 23 12月, 2013 2 次提交
    • P
      qdev: switch reset to post-order · dcc20931
      Paolo Bonzini 提交于
      Post-order is the only sensible direction for the reset signals.
      For example, suppose pre-order is used and the parent has some data
      structures that cache children state (for example a list of active
      requests).  When the reset method is invoked on the parent, these caches
      could be in any state.
      
      If post-order is used, on the other hand, these will be in a known state
      when the reset method is invoked on the parent.
      
      This change means that it is no longer possible to block the visit of
      the devices, so the callback is changed to return void.  This is not
      a problem, because PCI was returning 1 exactly in order to achieve the
      same ordering that this patch implements.
      
      PCI can then rely on the qdev core having sent a "reset signal" (whatever
      that means) to the device, and only do the PCI-specific initialization
      with pci_do_device_reset.
      
      MST: fixed up virtio-ccw
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      dcc20931
    • P
      qdev: allow both pre- and post-order vists in qdev walking functions · 0293214b
      Paolo Bonzini 提交于
      Resetting should be done in post-order, not pre-order.  However,
      qdev_walk_children and qbus_walk_children do not allow this.  Fix
      it by adding two extra arguments to the functions.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      0293214b
  19. 06 11月, 2013 1 次提交
  20. 31 8月, 2013 2 次提交
  21. 17 8月, 2013 1 次提交
  22. 31 5月, 2013 1 次提交
    • A
      qdev: fix get_fw_dev_path to support to add nothing to fw_dev_path · bbfa18fc
      Amos Kong 提交于
      Recent virtio refactoring in QEMU made virtio-bus become the parent bus
      of scsi-bus, and virtio-bus doesn't have get_fw_dev_path implementation,
      typename will be added to fw_dev_path by default, the new fw_dev_path
      could not be identified by seabios. It causes that bootindex parameter
      of scsi device doesn't work.
      
      This patch implements get_fw_dev_path() in BusClass, it will be called
      if bus doesn't implement the method, tyename will be added to
      fw_dev_path. If the implemented method returns NULL, nothing will be
      added to fw_dev_path.
      
      It also implements virtio_bus_get_fw_dev_path() to return NULL. Then
      QEMU will still pass original style of fw_dev_path to seabios.
      Signed-off-by: NAmos Kong <akong@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 1369814202-10346-1-git-send-email-akong@redhat.com
      --
      v2: only add nothing to fw_dev_path when get_fw_dev_path() is
          implemented and returns NULL. then it will not effect other devices
          don't have get_fw_dev_path() implementation.
      v3: implement default get_fw_dev_path() in BusClass
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      bbfa18fc