summaryrefslogtreecommitdiffstats
path: root/include/hw/qdev-properties.h
Commit message (Collapse)AuthorAgeFilesLines
* qdev: add 64bit propertiesGerd Hoffmann2015-06-011-0/+10
| | | | | | | | Needed for virtio features which go from 32bit to 64bit with virtio 1.0 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell2015-03-101-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - scsi: improvements to error reporting and conversion to realize, Coverity/sparse fix for iscsi driver - RCU fallout: fix -daemonize and s390x system emulation - KVM: kvm_stat improvements and new man page - x86: SYSRET fix for VxWorks # gpg: Signature made Tue Mar 10 10:18:45 2015 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: x86: fix SS selector in SYSRET scsi: Convert remaining PCI HBAs to realize() scsi: Improve error reporting for invalid drive property hw: Propagate errors through qdev_prop_set_drive() scsi: Clean up duplicated error in legacy if=scsi code cpus: initialize cpu->memory_dispatch rcu: handle forks safely qemu-thread: do not use PTHREAD_MUTEX_ERRORCHECK kvm_stat: add kvm_stat.1 man page kvm_stat: add column headers to text UI iscsi: Fix check for username Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw: Propagate errors through qdev_prop_set_drive()Markus Armbruster2015-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three kinds of callers: 1. On failure, report the error and abort Passing &error_abort does the job. No functional change. 2. On failure, report the error and exit() This is qdev_prop_set_drive_nofail(). Error reporting moves from qdev_prop_set_drive() to its caller. Because hiding away the error in the monitor right before exit() isn't helpful, replace qerror_report_err() by error_report_err(). Shouldn't make a difference, because qdev_prop_set_drive_nofail() should never be used in QMP context. 3. On failure, report the error and recover This is usb_msd_init() and scsi_bus_legacy_add_drive(). Error reporting and freeing the error object moves from qdev_prop_set_drive() to its callers. Because usb_msd_init() can't run in QMP context, replace qerror_report_err() by error_report_err() there. No functional change. scsi_bus_legacy_add_drive() calling qerror_report_err() is of course inappropriate, but this commit merely makes it more obvious. The next one will clean it up. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-Id: <1425925048-15482-3-git-send-email-armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell2015-03-101-2/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Block patches for 2.3 # gpg: Signature made Tue Mar 10 13:03:17 2015 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (73 commits) MAINTAINERS: Add jcody as blockjobs, block devices maintainer iotests: add O_DIRECT alignment probing test block/raw-posix: fix launching with failed disks MAINTAINERS: Add jsnow as IDE maintainer sheepdog: Fix misleading error messages in sd_snapshot_create() Add testcase for scsi-hd devices without drive property scsi-hd: fix property unset case block/vdi: Add locking for parallel requests iotests: Drop vpc from 004's and 104's format list iotests: Remove 006 iotests: Fix 051's reference output virtio-blk: Remove the stale FIXME comment tests: Check QVIRTIO_F_ANY_LAYOUT flag in virtio-blk test libqos: Solve bug in interrupt checking when using MSIX in virtio-pci.c sheepdog: fix confused return values qtest/ahci: add fragmented dma test qtest/ahci: Add PIO and LBA48 tests qtest/ahci: Add DMA test variants libqos/ahci: add ahci command helpers qtest/ahci: Add a macro bootup routine ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * BlockConf: Call backend functions to detect geometry and blocksizesEkaterina Tumanova2015-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | geometry: hd_geometry_guess function autodetects the drive geometry. This patch adds a block backend call, that probes the backing device geometry. If the inner driver method is implemented and succeeds (currently only for DASDs), the blkconf_geometry will pass-through the backing device geometry. Otherwise will fallback to old logic. blocksize: This patch initializes blocksize properties to 0. In order to set the property a blkconf_blocksizes was introduced. If user didn't set physical or logical blocksize, it will retrieve its value from a driver (only succeeds for DASD), otherwise it will set default 512 value. The blkconf_blocksizes call was added to all users of BlkConf. Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1424087278-49393-6-git-send-email-tumanova@linux.vnet.ibm.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | qdev: Don't exit when running into bad -globalMarkus Armbruster2015-02-261-3/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -global lets you set a nice booby-trap for yourself: $ qemu-system-x86_64 -nodefaults -S -display none -usb -monitor stdio -global usb-mouse.usb_version=l QEMU 2.1.94 monitor - type 'help' for more information (qemu) device_add usb-mouse Parameter 'usb_version' expects an int64 value or range $ echo $? 1 Not nice. Until commit 3196270 we even abort()ed. The same error triggers if you manage to screw up a machine type's compat_props. To demonstrate, change HW_COMPAT_2_1's entry to .driver = "usb-mouse",\ .property = "usb_version",\ .value = "1", \ Then run $ qemu-system-x86_64 -usb -M pc-i440fx-2.1 -device usb-mouse upstream-qemu: -device usb-mouse: Parameter 'usb_version' expects an int64 value or range $ echo $? 1 One of our creatively cruel error messages. Since this is actually a coding error, we *should* abort() here. Replace the error by an assertion failure in this case. But turn the fatal error into a mere warning when the faulty GlobalProperty comes from the user. Looks like this: $ qemu-system-x86_64 -nodefaults -S -display none -usb -monitor stdio -global usb-mouse.usb_version=l QEMU 2.1.94 monitor - type 'help' for more information (qemu) device_add usb-mouse Warning: global usb-mouse.usb_version=l ignored (Parameter 'usb_version' expects an int64 value or range) (qemu) This is consistent with how we handle similarly unusable -global in qdev_prop_check_globals(). You could argue that the error should make device_add fail. Would be harder, because we're running within TypeInfo's instance_post_init() method device_post_init(), which can't fail. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
* hw: Convert from BlockDriverState to BlockBackend, mostlyMarkus Armbruster2014-10-201-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Device models should access their block backends only through the block-backend.h API. Convert them, and drop direct includes of inappropriate headers. Just four uses of BlockDriverState are left: * The Xen paravirtual block device backend (xen_disk.c) opens images itself when set up via xenbus, bypassing blockdev.c. I figure it should go through qmp_blockdev_add() instead. * Device model "usb-storage" prompts for keys. No other device model does, and this one probably shouldn't do it, either. * ide_issue_trim_cb() uses bdrv_aio_discard() instead of blk_aio_discard() because it fishes its backend out of a BlockAIOCB, which has only the BlockDriverState. * PC87312State has an unused BlockDriverState[] member. The next two commits take care of the latter two. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qdev: Rename qdev_prop_check_global() to qdev_prop_check_globals()Eduardo Habkost2014-09-181-1/+1
| | | | | | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* qdev: drop iothread property typeStefan Hajnoczi2014-07-011-3/+0
| | | | | | The iothread property type is no longer used and can be removed. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qdev: add qdev_alias_all_properties()Stefan Hajnoczi2014-07-011-0/+2
| | | | | | | | | The qdev_alias_all_properties() function creates QOM alias properties for each qdev property on a DeviceState. This is useful for parent objects that wish to forward property accesses to their children. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
* qdev: Display warning about unused -globalDon Slutz2014-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This can help a user understand why -global was ignored. For example: with "-vga cirrus"; "-global vga.vgamem_mb=16" is just ignored when "-global cirrus-vga.vgamem_mb=16" is not. This is currently clear when the wrong property is provided: out/x86_64-softmmu/qemu-system-x86_64 -global cirrus-vga.vram_size_mb=16 -monitor pty -vga cirrus char device redirected to /dev/pts/20 (label compat_monitor0) qemu-system-x86_64: Property '.vram_size_mb' not found Aborted (core dumped) vs out/x86_64-softmmu/qemu-system-x86_64 -global vga.vram_size_mb=16 -monitor pty -vga cirrus char device redirected to /dev/pts/20 (label compat_monitor0) VNC server running on `::1:5900' ^Cqemu: terminating on signal 2 Signed-off-by: Don Slutz <dslutz@verizon.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
* qom: Add check() argument to object_property_add_link()Stefan Hajnoczi2014-03-191-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | 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: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Tweaked documentation comment] Signed-off-by: Andreas Färber <afaerber@suse.de>
* iothread: add "iothread" qdev property typeStefan Hajnoczi2014-03-131-0/+3
| | | | | | | | | | | | | | | | Add a "iothread" qdev property type so devices can be hooked up to an IOThread from the comand-line: qemu -object iothread,id=iothread0 \ -device some-device,x-iothread=iothread0 Note that Paolo Bonzini <pbonzini@redhat.com> has suggested using QOM links instead. This way the relationship between the objects is reflected in QOM. There are currently shortcomings of object_property_add_link() which prevent this use case. I will attempt to fix them and move to QOM links in a separate series. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qdev: Remove hex8/32/64 property typesPaolo Bonzini2014-02-141-9/+0
| | | | | | | | | Replace them with uint8/32/64. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qdev: Inline qdev_prop_parse()Paolo Bonzini2014-02-141-2/+0
| | | | | | | Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qdev: Document that pointer properties kill device_addMarkus Armbruster2013-12-241-0/+17
| | | | | | | | | Ask users of DEFINE_PROP_PTR() to set cannot_instantiate_with_device_add_yet, or explain why it's not needed. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qdev: Add SIZE type to qdev propertiesVasilis Liaskovitis2013-07-291-0/+3
| | | | | | | | | | | | | This patch adds a 'SIZE' type property to qdev. Signed-off-by: Ian Molton <ian.molton@collabora.co.uk> Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-id: 1375109277-25561-7-git-send-email-imammedo@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Introduce qdev_prop_set_globals_for_type()Andreas Färber2013-05-061-0/+2
| | | | | | | | Reuse it in qdev_prop_set_globals(). Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> [AF: Renamed from qdev_prop_set_custom_globals()] Signed-off-by: Andreas Färber <afaerber@suse.de>
* qdev: Let qdev_prop_parse() pass through ErrorAndreas Färber2013-05-061-2/+3
| | | | | | | Move error reporting to callers. Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qdev: Add qdev property for bool typeIgor Mammedov2013-04-161-0/+10
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> [AF: Use new qdev_prop_set_after_realize()] Signed-off-by: Andreas Färber <afaerber@suse.de>
* hw: move headers to include/Paolo Bonzini2013-04-081-0/+182
Many of these should be cleaned up with proper qdev-/QOM-ification. Right now there are many catch-all headers in include/hw/ARCH depending on cpu.h, and this makes it necessary to compile these files per-target. However, fixing this does not belong in these patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
OpenPOWER on IntegriCloud