1. 13 Jun, 2017 1 commit
  2. 17 May, 2017 1 commit
    • Eduardo Habkost's avatar
      qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable · e90f2a8c
      Eduardo Habkost authored
      cannot_instantiate_with_device_add_yet was introduced by commit
      efec3dd6 to replace no_user. It was
      supposed to be a temporary measure.
      When it was introduced, we had 54
      cannot_instantiate_with_device_add_yet=true lines in the code.
      Today (3 years later) this number has not shrunk: we now have
      57 cannot_instantiate_with_device_add_yet=true lines. I think it
      is safe to say it is not a temporary measure, and we won't see
      the flag go away soon.
      Instead of a long field name that misleads people to believe it
      is temporary, replace it a shorter and less misleading field:
      Except for code comments, changes were generated using the
      following Coccinelle patch:
        expression DC;
        -DC->cannot_instantiate_with_device_add_yet = false;
        +DC->user_creatable = true;
        -DC->cannot_instantiate_with_device_add_yet = true;
        +DC->user_creatable = false;
        typedef ObjectClass;
        expression dc;
        identifier class, data;
         static void device_class_init(ObjectClass *class, void *data)
         dc->hotpluggable = true;
        +dc->user_creatable = true;
         struct DeviceClass {
        -bool cannot_instantiate_with_device_add_yet;
        +bool user_creatable;
        expression DC;
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Thomas Huth <thuth@redhat.com>
      Acked-by: 's avatarAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: 's avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: 's avatarMarcel Apfelbaum <marcel@redhat.com>
      Acked-by: 's avatarMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-2-ehabkost@redhat.com>
      [ehabkost: kept "TODO remove once we're there" comment]
      Reviewed-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
  3. 21 Apr, 2017 2 commits
  4. 28 Feb, 2017 1 commit
  5. 27 Jan, 2017 1 commit
  6. 24 Jan, 2017 1 commit
  7. 22 Nov, 2016 1 commit
  8. 23 Sep, 2016 2 commits
  9. 22 Mar, 2016 1 commit
  10. 16 Mar, 2016 3 commits
  11. 04 Feb, 2016 1 commit
    • Peter Maydell's avatar
      all: Clean up includes · d38ea87a
      Peter Maydell authored
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      This commit was created with scripts/clean-includes.
      Signed-off-by: 's avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-16-git-send-email-peter.maydell@linaro.org
  12. 13 Jan, 2016 2 commits
    • Markus Armbruster's avatar
      error: Use error_report_err() instead of ad hoc prints · 78288671
      Markus Armbruster authored
      Unlike ad hoc prints, error_report_err() uses the error whole instead
      of just its message obtained with error_get_pretty().  This avoids
      suppressing its hint (see commit 50b7b000).  Example:
          $ bld/ivshmem-server -l 42@
          Parameter 'shm_size' expects a size
          You may use k, M, G or T suffixes for kilobytes, megabytes, gigabytes and terabytes.
      The last line is new with this patch.
      While there, drop a "cannot parse shm size: " message prefix; it's
      redundant, because the error message proper is always of the form
      "Parameter 'shm_size' expects ...".
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      Message-Id: <1450452927-8346-5-git-send-email-armbru@redhat.com>
    • Markus Armbruster's avatar
      error: Don't append a newline when printing the error hint · 543202c0
      Markus Armbruster authored
      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: 's avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      Message-Id: <1450370121-5768-7-git-send-email-armbru@redhat.com>
  13. 12 Oct, 2015 1 commit
  14. 09 Oct, 2015 1 commit
    • Markus Armbruster's avatar
      Revert "qdev: Use qdev_get_device_class() for -device <type>,help" · 33fe9683
      Markus Armbruster authored
      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.addr=int32 (Slot and optional function number, example: 06.0 or 06)
      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"
      Cc: qemu-stable@nongnu.org
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      Reviewed-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1443689999-12182-11-git-send-email-armbru@redhat.com>
  15. 22 Sep, 2015 1 commit
    • Daniel P. Berrange's avatar
      monitor: allow device_del to accept QOM paths · 6287d827
      Daniel P. Berrange authored
      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
       (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: 's avatarDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1441974836-17476-1-git-send-email-berrange@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      [Commit message touched up, accidental white-space change dropped]
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
  16. 18 Sep, 2015 1 commit
    • Eric Blake's avatar
      hmp: Allow for error message hints on HMP · 50b7b000
      Eric Blake authored
      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: 's avatarEric Blake <eblake@redhat.com>
      Reviewed-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1441901956-21991-1-git-send-email-eblake@redhat.com>
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
  17. 22 Jun, 2015 11 commits
  18. 17 Jun, 2015 1 commit
  19. 09 Jun, 2015 2 commits
  20. 05 Jun, 2015 1 commit
    • Paolo Bonzini's avatar
      vl: allow full-blown QemuOpts syntax for -global · 3751d7c4
      Paolo Bonzini authored
      -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: 's avatarPaolo Bonzini <pbonzini@redhat.com>
  21. 17 Mar, 2015 1 commit
  22. 26 Feb, 2015 1 commit
  23. 18 Feb, 2015 1 commit
    • Markus Armbruster's avatar
      hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() · 1ce6be24
      Markus Armbruster authored
      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 '_'.
      * sun4m_irq_info(), sun4m_pic_info() renamed to sun4m_hmp_info_irq(),
      * lm32_irq_info(), lm32_pic_info() renamed to lm32_hmp_info_irq(),
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
  24. 04 Nov, 2014 1 commit
    • Eduardo Habkost's avatar
      qdev: Use qdev_get_device_class() for -device <type>,help · 31bed550
      Eduardo Habkost authored
      Make sure we try to list properties from classes that can be safely used
      with "-device".
      Fixes the following crashes:
        $ qemu-system-x86_64 -device x86_64-cpu,help
        ERROR:qom/object.c:336:object_initialize_with_type: assertion failed: (type->abstract == false)
        Aborted (core dumped)
        $ qemu-system-x86_64 -device host-x86_64-cpu,help
        qemu-system-x86_64: [...]/target-i386/cpu.c:1329: host_x86_cpu_initfn: Assertion `(kvm_allowed)' failed.
        Aborted (core dumped)
      After applying this patch:
        $ qemu-system-x86_64 -device x86_64-cpu,help
        Parameter 'driver' expects non-abstract device type
        $ qemu-system-x86_64 -device host-x86_64-cpu,help
        Parameter 'driver' expects pluggable device type
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: 's avatarAndreas Färber <afaerber@suse.de>