1. 23 6月, 2015 2 次提交
    • M
      qdev-monitor: Fix check for full bus · ed238ba2
      Markus Armbruster 提交于
      Property bus has always been too screwed up to be really usable for
      values other than plain bus IDs.  This just fixes a bug that crept in
      in commit 1395af6f "qdev: add a maximum device allowed field for the
      bus."
      
      It doesn't always fail when it should:
      
          $ qemu-system-x86_64 -nodefaults -device virtio-serial-pci -device virtio-rng-device,bus=pci.0/virtio-serial-pci/virtio-bus
      
      Happily plugs the virtio-rng-device into the virtio-bus provided by
      virtio-serial-pci, even though its only slot is already occupied by a
      virtio-serial-device.
      
      And sometimes fails when it shouldn't:
      
          $ qemu-system-x86_64 -nodefaults -device virtio-serial-pci -device virtserialport,bus=virtio-bus/virtio-serial-device
      
      Yes, the virtio-bus is full, but the virtio-serial-bus provided by
      virtio-serial-device isn't, and that's the one we're trying to use.
      
      Root cause: we check "bus full" when we resolve the first element of
      the path.  That's the correct one only when it's also the last one.
      
      Fix by moving the "bus full" check to right before we return a bus.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      ed238ba2
    • M
      qdev-monitor: Stop error avalanche in qbus_find_recursive() · a5ec494e
      Markus Armbruster 提交于
      Reproducer:
      
          $ qemu-system-x86_64 -nodefaults -device virtio-rng-pci -device virtio-rng-pci -device virtio-rng-device,bus=virtio-bus
          qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' is full
          qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' is full
          qemu-system-x86_64: -device virtio-rng-device,bus=virtio-bus: Bus 'virtio-bus' not found
      
      qbus_find_recursive() reports the "is full" error itself, and leaves
      reporting "not found" to its caller.  The result is confusion.  Write
      it a function contract that permits leaving all error reporting to the
      caller, and implement it.  Update callers to detect and report "is
      full".
      
      Screwed up when commit 1395af6f added the max_dev limit and the "is
      full" error condition to enforce it.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      a5ec494e
  2. 17 6月, 2015 1 次提交
  3. 09 6月, 2015 2 次提交
  4. 05 6月, 2015 1 次提交
    • P
      vl: allow full-blown QemuOpts syntax for -global · 3751d7c4
      Paolo Bonzini 提交于
      -global does not work for drivers that have a dot in their name, such as
      cfi.pflash01.  This is just a parsing limitation, because such globals
      can be declared easily inside a -readconfig file.
      
      To allow this usage, support the full QemuOpts key/value syntax for -global
      too, for example "-global driver=cfi.pflash01,property=secure,value=on".
      The two formats do not conflict, because the key/value syntax does not have
      a period before the first equal sign.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3751d7c4
  5. 17 3月, 2015 1 次提交
  6. 26 2月, 2015 1 次提交
  7. 18 2月, 2015 1 次提交
    • M
      hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() · 1ce6be24
      Markus Armbruster 提交于
      Some are called do_info_SUBCOMMAND() (old ones, usually), some
      hmp_info_SUBCOMMAND(), some SUBCOMMAND_info(), sometimes SUBCOMMAND
      pointlessly differs in spelling.
      
      Normalize to hmp_info_SUBCOMMAND(), where SUBCOMMAND is exactly the
      subcommand name with '-' replaced by '_'.
      
      Exceptions:
      
      * sun4m_irq_info(), sun4m_pic_info() renamed to sun4m_hmp_info_irq(),
        sun4m_hmp_info_pic().
      
      * lm32_irq_info(), lm32_pic_info() renamed to lm32_hmp_info_irq(),
        lm32_hmp_info_pic().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      1ce6be24
  8. 05 11月, 2014 3 次提交
  9. 15 10月, 2014 4 次提交
    • G
      qmp: Print descriptions of object properties · 07d09c58
      Gonglei 提交于
      Add a new "description" field to DevicePropertyInfo.
      The descriptions can serve as documentation in the code,
      and they can be used to provide better help. For example:
      
      $./qemu-system-x86_64 -device virtio-blk-pci,?
      
      Before this patch:
      
      virtio-blk-pci.iothread=link<iothread>
      virtio-blk-pci.x-data-plane=bool
      virtio-blk-pci.scsi=bool
      virtio-blk-pci.config-wce=bool
      virtio-blk-pci.serial=str
      virtio-blk-pci.secs=uint32
      virtio-blk-pci.heads=uint32
      virtio-blk-pci.cyls=uint32
      virtio-blk-pci.discard_granularity=uint32
      virtio-blk-pci.bootindex=int32
      virtio-blk-pci.opt_io_size=uint32
      virtio-blk-pci.min_io_size=uint16
      virtio-blk-pci.physical_block_size=uint16
      virtio-blk-pci.logical_block_size=uint16
      virtio-blk-pci.drive=str
      virtio-blk-pci.virtio-backend=child<virtio-blk-device>
      virtio-blk-pci.command_serr_enable=on/off
      virtio-blk-pci.multifunction=on/off
      virtio-blk-pci.rombar=uint32
      virtio-blk-pci.romfile=str
      virtio-blk-pci.addr=pci-devfn
      virtio-blk-pci.event_idx=on/off
      virtio-blk-pci.indirect_desc=on/off
      virtio-blk-pci.vectors=uint32
      virtio-blk-pci.ioeventfd=on/off
      virtio-blk-pci.class=uint32
      
      After:
      
      virtio-blk-pci.iothread=link<iothread>
      virtio-blk-pci.x-data-plane=bool (on/off)
      virtio-blk-pci.scsi=bool (on/off)
      virtio-blk-pci.config-wce=bool (on/off)
      virtio-blk-pci.serial=str
      virtio-blk-pci.secs=uint32
      virtio-blk-pci.heads=uint32
      virtio-blk-pci.cyls=uint32
      virtio-blk-pci.discard_granularity=uint32
      virtio-blk-pci.bootindex=int32
      virtio-blk-pci.opt_io_size=uint32
      virtio-blk-pci.min_io_size=uint16
      virtio-blk-pci.physical_block_size=uint16 (A power of two between 512 and 32768)
      virtio-blk-pci.logical_block_size=uint16 (A power of two between 512 and 32768)
      virtio-blk-pci.drive=str (ID of a drive to use as a backend)
      virtio-blk-pci.virtio-backend=child<virtio-blk-device>
      virtio-blk-pci.command_serr_enable=bool (on/off)
      virtio-blk-pci.multifunction=bool (on/off)
      virtio-blk-pci.rombar=uint32
      virtio-blk-pci.romfile=str
      virtio-blk-pci.addr=int32 (Slot and optional function number, example: 06.0 or 06)
      virtio-blk-pci.event_idx=bool (on/off)
      virtio-blk-pci.indirect_desc=bool (on/off)
      virtio-blk-pci.vectors=uint32
      virtio-blk-pci.ioeventfd=bool (on/off)
      virtio-blk-pci.class=uint32
      
      Cc: Markus Armbruster <armbru@redhat.com>
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      07d09c58
    • I
      qdev: device_del: Search for to be unplugged device in 'peripheral' container · b6cc36ab
      Igor Mammedov 提交于
      device_add puts every device with 'id' inside of 'peripheral'
      container using id's value as the last component name.
      Use it by replacing recursive search on sysbus with path
      lookup in 'peripheral' container, which could handle both
      BUS and BUS-less device cases.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      b6cc36ab
    • I
      qdev: do not allow to instantiate non hotpluggable device with device_add · ce9835e0
      Igor Mammedov 提交于
      It will allow explicitly mark device as not hotpluggable and
      avoid its creation with following error at realize time
      and destroying it afterwards anyway. Instead of it will
      error out even before instance of device is created.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      ce9835e0
    • I
      Access BusState::allow_hotplug using wraper qbus_is_hotpluggable() · 39b888bd
      Igor Mammedov 提交于
      It would allow to transparently switch detection whether Bus
      is hotpluggable from allow_hotplug field to hotplug_handler
      link and to drop allow_hotplug field once all users are
      converted to hotplug handler API.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      39b888bd
  10. 22 9月, 2014 1 次提交
  11. 15 8月, 2014 2 次提交
  12. 28 5月, 2014 1 次提交
  13. 06 5月, 2014 1 次提交
    • A
      qdev: Fix crash by validating the object type · ce0abca3
      Amos Kong 提交于
      QEMU crashed when I try to list device parameters and the driver name is
      actually an available bus name.
      
       # qemu -device virtio-pci-bus,?
       # qemu -device virtio-bus,?
       # qemu -device virtio-serial-bus,?
       qdev-monitor.c:212:qdev_device_help: Object 0x7fd932f50620 is not an
       instance of type device
       Aborted (core dumped)
      
      We can also reproduce this bug by adding device from monitor, so it's
      worth to fix the crash.
      
       (qemu) device_add virtio-serial-bus
       qdev-monitor.c:491:qdev_device_add: Object 0x7f5e89530920 is not an
       instance of type device
       Aborted (core dumped)
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NAmos Kong <akong@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      ce0abca3
  14. 25 4月, 2014 1 次提交
  15. 13 3月, 2014 1 次提交
  16. 27 2月, 2014 1 次提交
  17. 18 2月, 2014 1 次提交
  18. 15 2月, 2014 3 次提交
  19. 07 1月, 2014 1 次提交
  20. 25 12月, 2013 2 次提交
  21. 23 12月, 2013 2 次提交
    • M
      qdev: Do not let the user try to device_add when it cannot work · 7ea5e78f
      Markus Armbruster 提交于
      Such devices have always been unavailable and omitted from the list of
      available devices shown by device_add help.  Until commit 18b6dade
      silently broke the former, setting up nasty traps for unwary users,
      like this one:
      
          $ qemu-system-x86_64 -nodefaults -monitor stdio -display none
          QEMU 1.6.50 monitor - type 'help' for more information
          (qemu) device_add apic
          Segmentation fault (core dumped)
      
      I call that a regression.  Fix it.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel.a@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      7ea5e78f
    • M
      qdev: Replace no_user by cannot_instantiate_with_device_add_yet · efec3dd6
      Markus Armbruster 提交于
      In an ideal world, machines can be built by wiring devices together
      with configuration, not code.  Unfortunately, that's not the world we
      live in right now.  We still have quite a few devices that need to be
      wired up by code.  If you try to device_add such a device, it'll fail
      in sometimes mysterious ways.  If you're lucky, you get an
      unmysterious immediate crash.
      
      To protect users from such badness, DeviceClass member no_user used to
      make device models unavailable with -device / device_add, but that
      regressed in commit 18b6dade.  The device model is still omitted from
      help, but is available anyway.
      
      Attempts to fix the regression have been rejected with the argument
      that the purpose of no_user isn't clear, and it's prone to misuse.
      
      This commit clarifies no_user's purpose.  Anthony suggested to rename
      it cannot_instantiate_with_device_add_yet_due_to_internal_bugs, which
      I shorten somewhat to keep checkpatch happy.  While there, make it
      bool.
      
      Every use of cannot_instantiate_with_device_add_yet gets a FIXME
      comment asking for rationale.  The next few commits will clean them
      all up, either by providing a rationale, or by getting rid of the use.
      
      With that done, the regression fix is hopefully acceptable.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel.a@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      efec3dd6
  22. 06 11月, 2013 6 次提交
  23. 12 10月, 2013 1 次提交