1. 07 10月, 2009 1 次提交
    • M
      New qdev_init_nofail() · e23a1b33
      Markus Armbruster 提交于
      Like qdev_init(), but terminate program via hw_error() instead of
      returning an error value.
      
      Use it instead of qdev_init() where terminating the program on failure
      is okay, either because it's during machine construction, or because
      we know that failure can't happen.
      
      Because relying in the latter is somewhat unclean, and the former is
      not always obvious, it would be nice to go back to qdev_init() in the
      not-so-obvious cases, only with proper error handling.  I'm leaving
      that for another day, because it involves making sure that error
      values are properly checked by all callers.
      
      Patchworks-ID: 35168
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      e23a1b33
  2. 05 10月, 2009 7 次提交
  3. 25 9月, 2009 1 次提交
  4. 12 9月, 2009 1 次提交
    • B
      Fix sys-queue.h conflict for good · 72cf2d4f
      Blue Swirl 提交于
      Problem: Our file sys-queue.h is a copy of the BSD file, but there are
      some additions and it's not entirely compatible. Because of that, there have
      been conflicts with system headers on BSD systems. Some hacks have been
      introduced in the commits 15cc9235,
      f40d7537,
      96555a96 and
      3990d09a but the fixes were fragile.
      
      Solution: Avoid the conflict entirely by renaming the functions and the
      file. Revert the previous hacks.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      72cf2d4f
  5. 10 9月, 2009 4 次提交
  6. 28 8月, 2009 2 次提交
  7. 11 8月, 2009 6 次提交
  8. 30 7月, 2009 1 次提交
  9. 27 7月, 2009 3 次提交
    • G
      qdev: bus walker + qdev_device_add() · 8ffb1bcf
      Gerd Hoffmann 提交于
      This patch implements a parser and qdev tree walker for bus paths and
      adds qdev_device_add on top of this.
      
      A bus path can be:
        (1) full path, i.e. /i440FX-pcihost/pci.0/lsi/scsi.0
        (2) bus name, i.e. "scsi.0".  Best used together with id= to make
            sure this is unique.
        (3) relative path starting with a bus name, i.e. "pci.0/lsi/scsi.0"
      
      For the (common) case of a single child bus being attached to a device
      it is enougth to specify the device only, i.e. "pci.0/lsi" will be
      accepted too.
      
      qdev_device_add() adds devices and accepts bus= parameters to find the
      bus the device should be attached to.  Without bus= being specified it
      takes the first bus it finds where the device can be attached to (i.e.
      first pci bus for pci devices, ...).
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8ffb1bcf
    • G
      qdev: create default bus names. · d271de9f
      Gerd Hoffmann 提交于
      Create a default bus name if none is passed to qbus_create().
      
      If the parent device has DeviceState->id set it will be used to create
      the bus name,. i.e. -device lsi,id=foo will give you a scsi bus named
      "foo.0".
      
      If there is no id BusInfo->name (lowercased) will be used instead, i.e.
      -device lsi will give you a scsi bus named "scsi.0".
      
      A scsi adapter with two scsi busses would have "scsi.0" and "scsi.1" or
      "$id.0" and "$id.1" busses.  The numbers of the child busses are per
      device, i.e. when adding two lsi adapters both will have a "*.0" child
      bus.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      d271de9f
    • G
      qdev/prop: add pci devfn property · 05cb5fe4
      Gerd Hoffmann 提交于
      So we can parse "$slot.$fn" strings into devfn numbers.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      05cb5fe4
  10. 21 7月, 2009 1 次提交
  11. 17 7月, 2009 5 次提交
    • B
      Suppress a Sparse warning · a9ff9df1
      Blue Swirl 提交于
      Move the export to a file used by both qdev.c and sysbus.c.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      a9ff9df1
    • G
      qdev: add user-specified identifier to devices. · ccb63de3
      Gerd Hoffmann 提交于
      Add id field to DeviceState.  Make "info qtree" print it.
      
      This helps users and management apps identifying devices in monitor
      output, which is especially useful with otherwise identical devices
      such as two virtio disks.
      
      This patch doesn't add a way to set the id, followup patches will do.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ccb63de3
    • G
      qdev: add no_user, alias and desc · 3320e56e
      Gerd Hoffmann 提交于
      no_user: prevent users from adding certain devices.
      desc: description of the device.
      alias: to allow user friendly shortcuts on the command line, i.e.
        -device usbmouse  instead of  -device "QEMU USB Mouse"  or
        -device lsi       instead of  -device lsi53c895a
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      3320e56e
    • G
      qdev/compat: compat property infrastructure. · b6b61144
      Gerd Hoffmann 提交于
      This add support for switching devices into a compatibility mode
      using device properties.  Machine types can have a list of properties
      for specific devices attached to allow the easy creation of machine
      types compatible to older qemu versions.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      b6b61144
    • G
      qdev: rework device properties. · ee6847d1
      Gerd Hoffmann 提交于
      This patch is a major overhaul of the device properties.  The properties
      are saved directly in the device state struct now, the linked list of
      property values is gone.
      
      Advantages:
        * We don't have to maintain the list with the property values.
        * The value in the property list and the value actually used by
          the device can't go out of sync any more (used to happen for
          the pci.devfn == -1 case) because there is only one place where
          the value is stored.
        * A record describing the property is required now, you can't set
          random properties any more.
      
      There are bus-specific and device-specific properties.  The former
      should be used for properties common to all bus drivers.  Typical
      use case is bus addressing, i.e. pci.devfn and i2c.address.
      
      Properties have a PropertyInfo struct attached with name, size and
      function pointers to parse and print properties.  A few common property
      types have PropertyInfos defined in qdev-properties.c.  Drivers are free
      to implement their own very special property parsers if needed.
      
      Properties can have default values.  If unset they are zero-filled.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ee6847d1
  12. 09 7月, 2009 2 次提交
    • G
      qdev: remove DeviceType · 042f84d0
      Gerd Hoffmann 提交于
      The only purpose DeviceType serves is creating a linked list of
      DeviceInfo structs.  This removes DeviceType and add a next field to
      DeviceInfo instead, so the DeviceInfo structs can be changed that way.
      Elimitates a pointless extra level of indirection.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      042f84d0
    • G
      qdev: replace bus_type enum with bus_info struct. · 10c4c98a
      Gerd Hoffmann 提交于
      BusInfo is filled with name and size (pretty much like I did for
      DeviceInfo as well).  There is also a function pointer to print
      bus-specific device information to the monitor.  sysbus is hooked
      up there, I've also added a print function for PCI.
      
      Device creation is slightly modified as well:  The device type search
      loop now also checks the bus type while scanning the list instead of
      complaining thereafter in case of a mismatch.  This effectively gives
      each bus a private namespace for device names.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NPaul Brook <paul@codesourcery.com>
      10c4c98a
  13. 11 6月, 2009 1 次提交
  14. 05 6月, 2009 2 次提交
  15. 04 6月, 2009 1 次提交
  16. 26 5月, 2009 1 次提交
  17. 23 5月, 2009 1 次提交
    • P
      Add common BusState · 02e2da45
      Paul Brook 提交于
      Implement and use a common device bus state.  The main side-effect is
      that creating a bus and attaching it to a parent device are no longer
      separate operations.  For legacy code we allow a NULL parent, but that
      should go away eventually.
      
      Also tweak creation code to veriry theat a device in on the right bus.
      Signed-off-by: NPaul Brook <paul@codesourcery.com>
      02e2da45