fdc: convert to reset + vmsd
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
esp: convert to reset + vmsd
sparc32: convert cs4231 to VMState, vmsd and reset
Also remove unused include directive.
escc: add chipset docs
escc: convert to VMState, vmsd and reset
sparc32: add chipset docs for eccmemctl
sparc32: convert slavio_misc to reset + vmsd
sparc32: convert eccmemctl to reset + vmsd
sparc64: remove unused variables
char: rename CHR_EVENT_RESET to CHR_EVENT_OPENED
The char event RESET is emitted when a char device is opened.Give it a better name.
Patchworks-ID: 35287Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: add string property.
Patchworks-ID: 35755Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Suppress warnings about 'warn_unused_result' attribute directive
MIPS jazz: create isa bus
As i8259 in mips_jazz.c is not correctly connected to the isa bus, themc146818rtc isa devices fails to be created.
Signed-off-by: Roy Tam <roytam@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pcnet: Extend hardware reset
Update the IRQ state and stop the poll timer on reset. Moreover,register the reset function with qemu.
Patchworks-ID: 35462Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
multiboot: Fix cmdline of modules
Fix address specified for cmdline value of module in multiboot structure.
Patchworks-ID: 35699Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
multiboot: Limit number of multiboot modules
Add size checks to avoid overwriting the multiboot structurewhen too many modules are loaded.
Patchworks-ID: 35700Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>...
net: handle -netdevice options
Same as for -net except for:
- only tap, user, vde and socket types are supported- the vlan parameter is not allowed- the name parameter is not allowed but the id parameter isrequired
Patchworks-ID: 35517Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
eepro100: Remove unused device status entries
Once upon the time when QEMU hacking was funthere was a brave knight who wanted to havea driver for a special intel nic.
So he started by cloning ne2000.c which alsomeant that the new born eepro100.c wasimmediately three years old....
hotplug: safely iterate bus's sibling list while removing a device
Without this, I'm seeing a segfault when unpluging a NIC.
Cc: Gerd Hoffmann <kraxel@redhat.com>Patchworks-ID: 35519Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: remove id field from NICInfo
Just use the name field instead since we now use the id paramater asthe name, if supplied. Only implication with this change is that ifid is not supplied, the value of the name paramater is used as anid.
Patchworks-ID: 35512...
scsi disk block descriptor v2
The SCSI-2 documentation suggests, that although the blockdescriptor is optional for an arbitrary SCSI-2 device (chapter 8.2.10,http://ldkelley.com/SCSI2/SCSI2/SCSI2/SCSI2/SCSI2-08.html )it is mandatory for a disk: chapters 9.1.2, 9.3.3...
Add some chipset doc links
rom loader: also try filename as-is.
In case qemu_find_file fails try to open the file as-is.
Patchworks-ID: 35263Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fixed wacom emulation
- for absolute mode, scale coordinates to the real device maximum values,since some drivers (on Haiku and Linux at least) need them as such,and the HID descriptor is boggus on some models anyway,- keep the coordinates even when no button is pressed, on real tablet...
ide: cmd646 ->unit has just the value that we want
Patchworks-ID: 35307Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: BMDMAState don't need a pci_dev field anymore
Patchworks-ID: 35306Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
TARGET_I386 is always defined if TARGET_X86_64 is defined
Patchworks-ID: 35378Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
rom loader: fix sparc -kernel boot.
Changes:(1) register pstrcpy_targphys() in rom list, it is used for kernelcommand lines by a number of architectures.(2) add rom_ptr() function to get a pointer for applying changesto loaded images. Needed for example to tell the linux kernel...
ide: change cast to DO_UPCAST
Patchworks-ID: 35293Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: Remove cast in pci_register_bar
We already have a PCIDevice at that point
Patchworks-ID: 35296Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: Remove duplicated definitions
Patchworks-ID: 35297Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: remove uselsess casts from void *
Patchworks-ID: 35298Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: create ide/pci.h for common ide pci definitions
Patchworks-ID: 35299Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: export needed ide-pci functions for split
Patchworks-ID: 35300Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: split cmd646 and piix from pci.c
This patch splits cmd646 specific code from pci.c.This patch splits piix4 specific code from pci.c.And compile new piix.o and cmd646.o when they are needed.The only change that is not code movemet is removal of cmd646 specific parts...
ide: PCIIDEState type field is not needed anymore
We have split the functions that needed it for cmd646
Patchworks-ID: 35302Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: 'secondary' field is only used by cmd646
Patchworks-ID: 35303Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: cmd646 we can get the pci device with container_of
Patchworks-ID: 35305Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix Windows host breakage by 45a50b1668822c23afc2a89f724654e176518bc4 (TeLeMan)
Signed-off-by: malc <av1474@comtv.ru>
pcnet: Restart poll timer on pcnet_start
Just like we call into pcnet_poll_timer on stop, we need to call it onstart to trigger the setup of the poll timer.
Patchworks-ID: 35313Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pcnet: Drop unused recv_pos field
This state field was never used, simply remained 0. Drop it from thePCNetState and update the save/restore code accordingly, keepingbackward compatibility.
Patchworks-ID: 35314Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Warn if value of qdev_init() isn't checked
After qdev_init() fails, the device is gone. Failure to check runs ahigh risk of use-after-free.
Patchworks-ID: 35166Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.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>
Check return value of qdev_init()
But do so only where it may actually fail. Leave the rest for thenext commit.
Patchworks-ID: 35167Signed-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 isa_create() terminate program on failure
Callers don't check the return value anyway.
Patchworks-ID: 35172Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Port PCI NIC hotplug to QemuOpts
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Final net cleanup after conversion to QemuOpts
Now that net_client_init() has no users, kill it off and renamenet_client_init_from_opts().
There is no further need for the old code in net_client_parse() either.We use qemu_opts_parse() 'firstname' facitity for that. Instead, move...
qemu/pci: clarify pci config load routine
PCI load routine has to be called with size equal to 256 (otherwise itwill crash in weird ways). So assert this, making code clearer.Also avoid dynamically sized array on stack - good for portability.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
qemu/pci: make pci not depend on msix
Making pci device cleanup msix automatically makes pci.c depend onmsix.c, which is IMO messy. Since devices do msix_init it's easy andnatural for them to also do msix_uninit.
Make NICInfo string fields non-const
We now only assign strdup()ed strings to these fields, never staticstrings.
aliguori: fix build for ppc_prep and mips_jazz
Revert "Fix exit on 'pci_add' Monitor command"
This reverts commit 0148fde54c2478ea8a47c8dbfe4c0fb8bda4d996.
As requested by Luiz.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: support 16 bit read from SCBCmd (== 2)
This is necessary to support OpenBSD 4.2 install, withoutthis change it triggers an assert.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Reorganize option rom (+linux kernel) loading.
This patch adds infrastructure to maintain memory regions which must berestored on reset. That includes roms (vga bios and option roms on pc),but is also used when loading linux kernels directly. Features:...
Improve error reporting on file access
By making the error reporting include strerror(errno), it gives the usera bit more indication as to why qemu failed. This is particularlyimportant for people running qemu as a non root user.
Signed-off-by: Justin M. Forbes <jforbes@redhat.com>...
virtio-pci: return error if virtio_console_init fails
Currently only one virtio_console device is supported. Trying to addmultiple devices fails and such failure should be reported back to theqdev init functions.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
Set revision in eeprom correctly for 82557 versions.
This is necessary to make FreeBSD recognize the device as 82557 - otherwise itsdriver will use unsupported features and fail to work.
set correct CS seg limit and flags on sipi
TCG works with incorrect values somehow.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix pci_vga_init() not to ignore bus argument
Commit a414c306 converted all VGA devices to qdev. It usedpci_create_simple() for all devices, except for this one it usedpci_create(). That's wrong, because it uses PCI bus#0 regardless ofthe bus argument. Fix by switching to pci_create_noinit()....
Fix pci_add storage not to exit on bad first argument
Monitor command "pci_add ADDR storage ..." does its work inqemu_pci_hot_add_nic(). It called pci_create(..., ADDR) to create thedevice. That's wrong, because pci_create() terminates the programwhen ADDR is invalid....
Make it obvious that pci_nic_init() can't fail
Before this patch, pci_nic_init() returns NULL when it can't find themodel in pci_nic_models[]. Except this can't happen, becauseqemu_check_nic_model_list() just searched for model inpci_nic_models[], and terminated the program on failure....
Fix pci_add nic not to exit on bad model
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() tocreate the NIC. When MODEL is unknown or "?", this prints to stderrand terminates the program.
Change pci_nic_init() not to treat "?" specially, and to return NULL...
pci_create() is now unused, remove it
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Rename pci_create_noinit() to pci_create()
It's qdev_create() specialized for PCI, so name it accordingly.
qemu: clean up target page usage in msix
Since cpu_register_phys_memory does not require size to be a multiple oftarget page size, simply make msix page size 0x1000. Do this in msix,reverting part of 5e520a7d500ec2569d22d80f9ef4272a34cb3c80, as we nolonger have to pass target page around....
qemu/virtio-pci: remove unnecessary check
it's safe to call msix_write_config if msixis disabled, so call it unconditionally onpci config write.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: Don't allow guests to fail assertions
The idea of using assert() for input validation is rather questionable.Let's remove it from eepro100, so that guests need to find more interestingways if they want to crash qemu.
This patch replaces asserts that are directly dependent on guest-accessible...
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/pci: refactor code/symbolic constants
refactor code slightly, adding symbolic constants and functions, andusing macros where possible. This will also make following resetpatches easier.
No functional changes.
qemu/pci: reset device registers on bus reset
Reset BARs and a couple of other registers on bus reset, as per PCIspec.
floppy: move dma setup + drive connect to fdctrl_init_common()
isa-fdc is completely qdev-ified with this patch applied, allconfiguration uses properties.
sysbus-fdc needs dma_channel config fixed. There is only one user(mips_jazz) which uses dma channel 0. Can anyone knowing this...
qdev: don't crash on unset drive properties.
serial: convert isa to qdev
Everything using standard isa I/O ports and IRQ windup is considerdbeing an actual isa device. That are all serial_init() users exceptmips_mipssim() which seems to have a non-standard IRQ windup.
baud rate is fixed at 115200 now as no caller passed in something else....
qemu/qdev: type safety in reset handler
Add type safety to qdev reset handlers, by declaring them asDeviceState * rather than void *.
qemu/virtio: fix reset with device removal
virtio pci registers its own reset handler, but fails to unregister it,which will lead to crashes after device removal. Solve this problem byswitching to qdev reset handler, which is automatically unregistered....
scsi: hotplug windup
pci: hotplug windup
Create qdev infrastructure for pci hotplug. PCI bus implementationsmust register a handler for hotplug. Creating a new PCI device willautomagically hot-plug it in case the PCI bus in question supports this.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
pci: windup acpi-based hotplug
Switch over acpi-based PCI hotplug for pc over to the newqdev-based pci hotplugging.
drive cleanup fixes.
Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the...
refactor drive_hot_add
move pci device lookup into the "case IF_SCSI" section, so wecan do something else for other interface types.
allow if=none for drive_add
Allow adding unconnected host drives by specifying if=none like it ispossible with -drive. They can be put in use with drive attributes,like this:
drive_add dummy if=none,id=mydisk,file=/some/disk.img device_add virtio-blk-pci,drive=mydisk...
store a pointer to QemuOpts in DeviceState, release it when zapping a device.
floppy: add drive properties.
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.
Implement scsi device destruction
pci: use qdev for device destruction.
pci_unregister_device is static now and hooked into Devicestate->exit.qdev_free(pci_device) works now.
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;)
usb: hook unplug into qdev, cleanups + fixes.
Hook into DeviceInfo->exit().
handle_destroy() must not free the state struct, this is handledby the new usb_qdev_exit() function now.
qdev_free(usb_device) works now.
Fix usb hub to qdev_free() all connected devices on unplug....
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...
usb: hotplug windup
switch ide bus to inplace allocation.
support inplace allocation for pci bus, split irq init.
convert pci bridge to qdev
piix_pci: kill PIIX3IrqState
parallel: convert isa to qdev
switch usb bus to inplace allocation.