1. 13 1月, 2016 1 次提交
    • M
      error: Don't append a newline when printing the error hint · 543202c0
      Markus Armbruster 提交于
      Since commit 50b7b000, we have error_append_hint() to conveniently
      accumulate Error member @hint.  error_report_err() prints it with a
      newline appended.  Consequently, users of error_append_hint() need to
      know whether theirs is the final line of the hint to decide whether it
      needs a newline.  Not a nice interface.
      
      Change error_report_err() to print just the hint, and the (still few)
      users of error_append_hint() to add the required newline.
      
      Cc: Eric Blake <eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1450370121-5768-7-git-send-email-armbru@redhat.com>
      543202c0
  2. 12 10月, 2015 1 次提交
  3. 09 10月, 2015 1 次提交
    • M
      Revert "qdev: Use qdev_get_device_class() for -device <type>,help" · 33fe9683
      Markus Armbruster 提交于
      This reverts commit 31bed550.
      
      The reverted commit changed qdev_device_help() to reject abstract
      devices and devices that have cannot_instantiate_with_device_add_yet
      set, to fix crash bugs like -device x86_64-cpu,help.
      
      Rejecting abstract devices makes sense: they're purely internal, and
      the implementation of the help feature can't cope with them.
      
      Rejecting non-pluggable devices makes less sense: even though you
      can't use them with -device, the help may still be useful elsewhere,
      for instance with -global.  This is a regression: -device FOO,help
      used to help even for FOO that aren't pluggable.
      
      The previous two commits fixed the crash bug at a lower layer, so
      reverting this one is now safe.  Fixes the -device FOO,help
      regression, except for the broken devices marked
      cannot_even_create_with_object_new_yet.  For those, the error message
      is improved.
      
      Example of a device where the regression is fixed:
      
          $ qemu-system-x86_64 -device PIIX4_PM,help
          PIIX4_PM.command_serr_enable=bool (on/off)
          PIIX4_PM.multifunction=bool (on/off)
          PIIX4_PM.rombar=uint32
          PIIX4_PM.romfile=str
          PIIX4_PM.addr=int32 (Slot and optional function number, example: 06.0 or 06)
          PIIX4_PM.memory-hotplug-support=bool
          PIIX4_PM.acpi-pci-hotplug-with-bridge-support=bool
          PIIX4_PM.s4_val=uint8
          PIIX4_PM.disable_s4=uint8
          PIIX4_PM.disable_s3=uint8
          PIIX4_PM.smb_io_base=uint32
      
      Example of a device where it isn't fixed:
      
          $ qemu-system-x86_64 -device host-x86_64-cpu,help
          Can't list properties of device 'host-x86_64-cpu'
      
      Both failed with "Parameter 'driver' expects pluggable device type"
      before.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1443689999-12182-11-git-send-email-armbru@redhat.com>
      33fe9683
  4. 22 9月, 2015 1 次提交
    • D
      monitor: allow device_del to accept QOM paths · 6287d827
      Daniel P. Berrange 提交于
      Currently device_del requires that the client provide the
      device short ID. device_add allows devices to be created
      without giving an ID, at which point there is no way to
      delete them with device_del. The QOM object path, however,
      provides an alternative way to identify the devices.
      
      Allowing device_del to accept an object path ensures all
      devices are deletable regardless of whether they have an
      ID.
      
       (qemu) device_add usb-mouse
       (qemu) qom-list /machine/peripheral-anon
       device[0] (child<usb-mouse>)
       type (string)
       (qemu) device_del /machine/peripheral-anon/device[0]
      
      Devices are required to be marked as hotpluggable
      otherwise an error is raised
      
       (qemu) device_del /machine/unattached/device[4]
       Device 'PIIX3' does not support hotplugging
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1441974836-17476-1-git-send-email-berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Commit message touched up, accidental white-space change dropped]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      6287d827
  5. 18 9月, 2015 1 次提交
    • E
      hmp: Allow for error message hints on HMP · 50b7b000
      Eric Blake 提交于
      Commits 7216ae3d and d2828429 disabled some error message hints,
      all because a change to use modern error reporting meant that the
      hint would be output prior to the actual error.  Fix this by making
      hints a first-class member of Error.
      
      For example, we are now back to the pleasant:
      
       $ qemu-system-x86_64 --nodefaults -S --vnc :0 --chardev null,id=,
       qemu-system-x86_64: --chardev null,id=,: Parameter 'id' expects an identifier
       Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1441901956-21991-1-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      50b7b000
  6. 23 6月, 2015 11 次提交
  7. 17 6月, 2015 1 次提交
  8. 09 6月, 2015 2 次提交
  9. 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
  10. 17 3月, 2015 1 次提交
  11. 26 2月, 2015 1 次提交
  12. 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
  13. 05 11月, 2014 3 次提交
  14. 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
  15. 22 9月, 2014 1 次提交
  16. 15 8月, 2014 2 次提交
  17. 28 5月, 2014 1 次提交
  18. 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
  19. 25 4月, 2014 1 次提交
  20. 13 3月, 2014 1 次提交
  21. 27 2月, 2014 1 次提交
  22. 18 2月, 2014 1 次提交
  23. 15 2月, 2014 1 次提交