History | View | Annotate | Download (21.9 kB)
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
QemuOpts: make most qemu_*_opts static
Switch tree to lookup-by-name using qemu_find_opts().Also hook up virtfs options so qemu_find_opts works for them too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'kwolf/for-anthony' into staging
savevm: Add DeviceState param
When available, we'd like to be able to access the DeviceStatewhen registering a savevm. For buses with a get_dev_path()function, this will allow us to create more unique savevmid strings.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
qdev: Don't hw_error() in qdev_init_nofail()
Some of the failures are internal errors, and hw_error() is okay then.But the common way to fail is bad user input, e.g. -globalisa-fdc.driveA=foo where drive foo has an unsupported rerror value.
exit(1) instead....
Conflicts: hw/pc.c
qbus: fix memory leak in qbus_free()
BusState::name is allocated in qbus_create_inplace().So it should be freed by qbus_free().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qdev: Don't leak string property value on hot unplug
parse_string() qemu_strdup()s the property value. It is never freed.It needs to be freed along with the device. Otherwise, the value ofscsi-disk property "ver" gets leaked when hot-unplugging the disk, for...
Monitor: Drop QMP documentation from code
Previous commit added QMP documentation to the qemu-monitor.hxfile, it's is a copy of this information.
While it's good to keep it near code, maintaining two copies ofthe same information is too hard and has little benefit as we...
vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manageinstance IDs on their own, and that unfortunately in a way that isincompatible with automatically generated ones. This so far preventsswitching those users to vmstates that are registered by qdev....
qdev: Convert qdev_unplug() to QError
Note: our device unplug methods don't need conversion work, becausethey can't currently fail.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: convert do_device_del() to QObject, QError
error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETER
monitor: Use argument type 'O' for device_add
While there, improve the params help text.
monitor: convert do_device_add() to QObject
qdev: Relax parsing of bus option
Treat multiple successive slashes as a one slash. Ignore trailingslashes. This is how POSIX pathnames work.
qdev: Convert qbus_find() to QError
Revert "qdev: Use QError for 'device not found' error"
This reverts commit 3ced9f7a36189aed94d8bf86f3f5087a53012455.
The next commit will convert all of qdev_device_add() to QError, andit'll be clearer with this partial conversion reverted.
error: Convert do_device_add() to QError
Conversion to QObject is still missing.
qemu-option: Move the implied first name into QemuOptsList
We sometimes permit omitting the first option name, for example-device foo is short for -device driver=foo. The name to use("driver" in the example) is passed as argument to qemu_opts_parse()....
qdev: convert setting device properties to QError
qdev: Hide "ptr" properties from users
Users can't set them, so qdev_device_help() shouldn't list them. Fixthat. Also make qdev_prop_parse() hide them instead of printing ameaningless "has no parser" error message.
Their value means nothing to users, so qdev_print_props() shouldn't...
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it itfrom its arguments.
This fixes a few error messages lacking a newline:net_handle_fd_param()'s "No file descriptor named %s found", andtap_open()'s "vnet_hdr=1 requested, but no kernel support for...
error: Rename qemu_error_new() to qerror_report()
qdev: Fix -device and device_add to handle unsuitable bus gracefully
"device_add isa-serial,bus=pci.0" kills QEMU. Not good.
qdev: Factor qdev_create_from_info() out of qdev_create()
To make it obvious that -device and device_add can't die inhw_error().
qdev: Hide "no_user" devices from users
Users can't create them, so qdev_device_help() shouldn't list them.Fix that.
Also make qdev_device_add() pretend they don't exist. Before, itrejected them with a "can't be added via command line" message, which...
error: Don't abuse qemu_error() for non-error in qdev_device_help()
qdev_device_help() prints device information with qemu_error(). Alater commit will make qemu_error() print additional stuff that isonly appropriate for proper errors, and then this will break. Use...
error: Don't abuse qemu_error() for non-error in qbus_find()
qbus_find() adds an informational line to error messages, and printsboth lines with one qemu_error(). Use error_printf() for theinformational line instead.
While there, simplify: instead of printing buffers filled by...
qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors
net.c used a constant to signify no MSI vectors were specified. Extendthat to all qdev devices.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reported-by: "Michael S. Tsirkin" <mst@redhat.com>...
qdev: Free opts on failed do_device_add
If the device can't be created, don't leak the QemuOpts and release the id ofthe device that should have been added by the failed device_add.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Fix exit code for -device ?
Help was shoehorned into device creation, qdev_device_add(). Sincehelp doesn't create a device, it returns NULL, which looks to callersjust like failed device creation. Monitor handler do_device_add()doesn't care, but main() exits unsuccessfully....
qdev: Add help for device properties
Option "-device DRIVER,?" and monitor command "device_add DRIVER,?" print the supported properties instead of creating a device. Theformer also terminates the program.
This is commit 2ba6edf0 (just reverted) done right....
qdev: Add rudimentary help for property value
This provides the same information as reverted commit 2ba6edf0. Notmuch, just better than nothing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-console: qdev conversion, new virtio-serial-bus
This commit converts the virtio-console device to create a newvirtio-serial bus that can host console and generic serial ports. Thefile hosting this code is now called virtio-serial-bus.c.
The virtio console is now a very simple qdev device that sits on the...
qdev: make compat stuff more generic
This patch renames the compat properties into global properties andmakes them more generic. The compatibility stuff is only one ofmultiple possible users now.
qdev: enable vmstate_unregister() support
Now vmstate_unregister have the right type
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Use QError for 'device not found' error
Please, note that we will lose the "Try -device '?' for a list" hint as it's qdev specific.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Check if unplug handler exists before calling it
A bus may have hotplugging enabled but not have the 'unplug'callback defined, which would lead to a crash on trying tounplug a device on the bus.
Fix by introducing an assert to check if the callback is valid....
usb core: use qdev for -usbdevice
This patchs adds infrastructure to handle -usbdevice via qdev callbacks.USBDeviceInfo gets a name field (for the -usbdevice driver name) and acallback for -usbdevice parameter parsing.
The new usbdevice_create() function walks the qdev driver list and looks...
zap DeviceState->nd
No users left.Also cleanup obsolete helper functions.
virtio: use qdev properties for configuration.
qdev/net: common nic property bits
Add a new type for properties common to all nics.Add helper functions and macros to deal with it.
net: allow NICs to be connected to netdevs
Introduce a 'peer' member to VLANClientState as an alternativeto a vlan. The idea being that packets are transfered directlyfrom peer clients rather than going through a vlan.
Patchworks-ID: 35516Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
Clean up test for qdev_init() failure
Some callers test for != 0, some for < 0. Normalize to < 0.
Patchworks-ID: 35171Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
New qdev_init_nofail()
Like qdev_init(), but terminate program via hw_error() instead ofreturning an error value.
Use it instead of qdev_init() where terminating the program on failureis okay, either because it's during machine construction, or because...
Make qdev_init() destroy the device on failure
Before, every caller had to do this. Only two actually did.
Patchworks-ID: 35170Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: move comment
Move comment back next to main_system_bus to avoid confusion.
qdev: show name of device that fails init
When initialising a device fails, show the name of the failing device.
The current behaviour is to silently exit on such errors.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu/qdev: type safety in reset handler
Add type safety to qdev reset handlers, by declaring them asDeviceState * rather than void *.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
store a pointer to QemuOpts in DeviceState, release it when zapping a device.
qdev: device free fixups.
Two bug fixes: * When freeing a device we unregister even stuff we didn't register in the first place because the ->init() callback failed. * When freeing a device with child busses attached, we fail to zap the child bus (and the devices attached to it)....
Add exit callback to DeviceInfo.
This adds a exit callback for device destruction to DeviceInfo, sowe can hook cleanups into qdev device destruction.
Followup patches will put that into use.
qdev hotplug: infrastructure and monitor commands.
Adds device_add and device_del commands. device_add accepts acceptsthe same syntax like the -device command line switch. device_delexpects a device id. So you should tag your devices with ids if you...
allow qdev busses allocations be inplace
Fix coding style issue
Replace:
if (-1 foo())
with:
if (foo() -1)
While this coding style is not in direct contravention of our currentlyratified CODING_STYLE treaty, it could be argued that the Article 3 ofthe European Convention on Human Rights (prohibiting torture and "inhuman...
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
qdev: integrate reset
qdev: integrate vmstate
qdev/scsi: add scsi bus support to qdev, convert drivers.
Adding scsi disks via -device works now, i.e. you can do:
-drive id=sda,if=none,......
qdev: add error message to qdev_device_add().
qdev error logging
Use the new qemu_error() function in qdev.c
qdev: add return value to init() callbacks.
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
fix qdev_print_devinfo()
snprintf returns number of bytes needed for the output, not the numberof bytes actually written. Thus the math is wrong ...
Spotted by Markus Armbruster.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
rename "info qdrv" to "info qdm"
As requested by avi: driver != device model.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
QemuOpts: switch over -device.
Make -device switch use the QemuOpts framework.Everything should continue to work like it did before.
New: "-set device.$id.$property=$value" works.
tolower -> qemu_tolower
Use qemu_tolower() instead of tolower().Fixes warning on NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
qdev: factor out qdev_print_devinfo.
qdev/core: add monitor command to list all drivers
kill drives_table
First step cleaning up the drives handling. This one does nothing butremoving drives_table[], still it became seriously big.
drive_get_index() is gone and is replaced by drives_get() which handsout DriveInfo pointers instead of a table index. This needs adaption in...
qdev: create default bus names.
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 createthe 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....
qdev: bus walker + qdev_device_add()
This patch implements a parser and qdev tree walker for bus paths andadds 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...
Suppress a Sparse warning
Move the export to a file used by both qdev.c and sysbus.c.
qdev: add user-specified identifier to devices.
Add id field to DeviceState. Make "info qtree" print it.
This helps users and management apps identifying devices in monitoroutput, which is especially useful with otherwise identical devicessuch as two virtio disks....
qdev: factor out driver search to qdev_find_info()
qdev/compat: compat property infrastructure.
This add support for switching devices into a compatibility modeusing device properties. Machine types can have a list of propertiesfor specific devices attached to allow the easy creation of machinetypes compatible to older qemu versions....
qdev: add no_user, alias and desc
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...
qdev: rework device properties.
This patch is a major overhaul of the device properties. The propertiesare saved directly in the device state struct now, the linked list ofproperty values is gone.
Advantages: * We don't have to maintain the list with the property values....
Update to a hopefully more future proof FSF address
Don't leak VLANClientState on PCI hot remove
destroy_nic() requires that NICInfo::private by a PCIDevice pointer,but then goes on to require that the same pointer matchesVLANClientState::opaque.
That is no longer the case for virtio-net since qdev and wasn't...
qdev: replace bus_type enum with bus_info struct.
BusInfo is filled with name and size (pretty much like I did forDeviceInfo as well). There is also a function pointer to printbus-specific device information to the monitor. sysbus is hookedup there, I've also added a print function for PCI....
qdev: remove DeviceType
The only purpose DeviceType serves is creating a linked list ofDeviceInfo structs. This removes DeviceType and add a next field toDeviceInfo instead, so the DeviceInfo structs can be changed that way.Elimitates a pointless extra level of indirection....
qdev: move name+size into DeviceInfo (v2)
Rationale: move device information from code to data structures.
v2: Adapt the drivers missed in the first version.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Merge branch 'net-queue'
Fix Sparse warning
net: add fd_readv() handler to qemu_new_vlan_client() args
This, apparently, is the style we prefer - all VLANClientStateshould be an argument to qemu_new_vlan_client().
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
net: re-name vc->fd_read() to vc->receive()
VLANClientState's fd_read() handler doesn't read from filedescriptors, it adds a buffer to the client's receive queue.
Re-name the handlers to make things a little less confusing.
qdev: c99 initilaizers for bus_type_names
Fix typo
Signed-off-by: Paul Brook <paul@codesourcery.com>
qdev: add monitor command to dump the tree.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Paul Brook <paul@codesourcery.com>
Record device property types
Record device property types, and provide a list of properties at deviceregistration time.
Add a "device" property type that holds a reference to annother device.
qdev: kill DeviceState->name
is redundant with DeviceState->type->name
Remove qdev irq sink handling
We have both IRQ sinks and GPIO inputs. These are in principle exactlythe same thing, so remove the former.
Add common BusState
Implement and use a common device bus state. The main side-effect isthat creating a bus and attaching it to a parent device are no longerseparate operations. For legacy code we allow a NULL parent, but thatshould go away eventually....
Consistently use uint64_t for int properties
I apparently failed to do this properly on the first attempt.
qdev scsi bus infrastructure
PCI network qdev conversion
Basic qdev infrastructure.
qdev child bus support