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.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 scsi bus to inplace allocation.
switch usb bus to inplace allocation.
Enable host-clock-based RTC
Switch RTC emulations to the new host_clock instead of vm_clock bydefault. This has the advantage that the emulated RTC will followautomatically the host time while it might be tuned via NTP. vm_clockcan still be selected by passing '-rtc clock=vm' on the command line....
allow qdev busses allocations be inplace
musicpal: Add VMState support
Register all relevant fields of Musicpal device states with the VMStateframework. This involves a few type changes of state variables.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix exit on 'pci_add' Monitor command
If the user issues one of the following commands to the Monitor:
pci_add pci_addr=auto nic model=Nonepci_add pci_addr=auto nic model=?
QEMU will exit, because the function used to perform sanitychecks (qemu_check_nic_model_list()) exits on error....
vmstate: Add suppot for field_exist() test
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
musicpal: Catch null TX qeueues
They likely represent invalid queues that should be skipped. We alreadydo this for RX queues. Wish I had a spec...
Credits go to malc for analyzing the issue and suggesting this fix.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>...
musicpal: Rework GPIO input events
The qdev_gpio conversion of 343ec8e caused come polarity mismatch of keyevent pins and left an overly complex solution behind. Take this chanceand refactor the GPIO input system of the Musicpal, moving it closer toreality:...
musicpal: Clean up typecasts
musicpal: Coding style fixes
musicpal: True reset support for GPIO
musicpal: True reset support for audio device
musicpal: Make PIT emulation more robust
Stop the periodic timers of the PIT on reset, disabling via the controlregister and invalid parameters.
Add *TL functions to vmstate
vmstate: port twl92230 device
Just don't look. struct tm members are ints' and they are sent as uint16_t.VMState code complains as it should. Have to create hacky int32_as_uint16type. Don't ever think about copying it
Signed-off-by: Juan Quintela <quintela@redhat.com>...
vmstate: add support for arrays of pointers
We need this to send arrays of timers
lm832x: make fields to have the same types that they are saved/loaded
They were saved as uint8_t already. To make things simpler, I justreg == -1 used to indicate an error, I create LM832x_GENERAL_ERRORwith vale 0xff to represet it
vmstate: port lm832x device
vmstate: remove i2c_slave_load/save
All its users moved to vmstate
vmstate: add uint8 array
vmstate: create VMSTATE_I2C_SLAVE
vmstate: port wm8750 device
vmstate: port max7310 device
vmstate: create VMSTATE_STRUCT_POINTER
vmstate: port pxa2xx_i2c device
vmstate: port ssd0303 device
vmstate: create VMSTATE_INT16_ARRAY
tmp105: change len and alorm to uint8_t
They were using only with very small integers, and they are sent/read asbytes. They can't become negative as far as I can see
vmstate: port tmp105 device
twl92230: change pwrbtn_state to uint8_t
its value is always the level of an interrupt, 0 or 1
vmstate: remove const from pre_save() functions
vmstate: remove ps2_kbd_load_old()
Now that we have version_id on post_load() we don't need the old loadfunction
vmstate: Add support for sending partial arrays
This one is needed for changees happening on fdc. It allows you to sendarrays of structs whose size we want to send it is another field with typeuint8_t. (If you have been able to read the whole sentence without...
qdev: Add support for uint8_t
i2c: addresses are load/save as uint8_t values, change types to reflect this
vmstate: port i2c_bus device
vmstate: port i2c_slave device
cirrus_vga: also assign gr0/1 when writting shadow_gr0/1
This is a regression/bug caused by previous vga_cleanup. This fixesUbuntu installer reported by: Pierre Riteau
vga: move back dirty_log functions to vga.c
They are needed there on qemu-kvm.
vmstate: remove const for put operations
In a later patch, we introduce pre_save() and post_save() functions.The whole point of that operation is to change things in the state.Without this patch, we have to remove the const qualifier in eachuse with a cast...
vmstate: add version_id argument to post_load
Revert "eepro100: Remove unused device status entries"
This reverts commit 3031efabd0bb744126a53f32c5426580b5d394d5.
eepro100: Add more i825xx devices
The new devices added here are still not functional -partially because some patches are still missing,partially because I cannot test them. Neverthelessthey belong to the same family and will be supportedby this driver some day....
eepro100: Remove unused device status entries
A lot of entries are unused (they were added by copy + pastefrom other drivers during development of eepro100.c).
Removing them from nic_save, nic_load makes anyold saved status incompatible, so a new version...
hw/omap_dma: add matching {} in if 0
MULTI_REQ is never defined, so it doesn't matter much, but sincewe have an if statement there, let's add {} to clarify what itshould do if it's uncommented, and indent the code properly.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
escc: fix another coding style nit
Fix another place with =- to be "= ".to avoid confusion with old-style "=" (which we also have, and needs to be fixed).
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
escc: fix coding style nit
Put space between = and - assigning a negative numberto avoid confusion with old-style "-=" (which we also have, and needs to be fixed).
omap_dma: fix unbalanced { in commented out code
Fix unbalanced {} in commented out code.
twl92230: fix old style increment/decrement usage
Modern compilers do not parse "=-" as decrement:you must use "-=" for that. Same for "=+"/"+=".
eepro100: Fix format strings in debug messages
size_t arguments need %zu instead of %d.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
eepro100: Replace sprintf by snprintf
eepro100: Remove unused code
eepro100: Enhanced logging and comments
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...
gcc wants 1st static and then const
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
static and inline should came before the type of the functions
Use proper typedef syntax
Why this ever compiled is a mistery to me.
Fix spelling in comment
replace Convery -> Convert
Cc: Paul Brook <paul@codesourcery.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Suppress some variants of English in comments
Replace surpress, supress by suppress.
Fix Sparse warning about invalid access past the end of 'mode'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix Sparse warning about obsolete struct initializer
Add 'static' to please Sparse
Fix Sparse warnings about using plain integer as NULL pointer
Compile ne2000 only once
ioports: remove unused env parameter and compile only once
The CPU state parameter is not used, remove it and adjust callers. Now wecan compile ioport.c once for all targets.
Compile msix only once
Get page size in device init.
Compile loader only once
Callers must pass ELF machine, byte swapping and symbol LSB clearinginformation to ELF loader. A.out loader needs page size information, passthat too as a parameter.
Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw....
Compile wdt_i6300esb only once
PPC: make system bus parent of PCI bus
ESP: convert to VMState
audio: use muldiv64 where it makes sense
qemu serial: lost tx irqs (affecting FreeBSD's new uart(4) driver)
Well one problem seems to be the rx condition, ... if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR))is not enough to trigger an irq, yet still causes the followingconditions not to be checked anymore at all....
escc: fix IRQ routing, broken by 6c319c82223a1766c5d64a20051e5c6ab7b53951
The logic of Zilog makes channel B the first device and channel A thesecond one.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
ide/isa: convert to qdev.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ide/pci: convert to qdev.
With this patch applied ide drives (when attached to a pci adapter) canbe created via -device, like this:
-drive if=none,id=mydisk,file=/path/to/disk.img -device ide-drive,drive=mydisk,bus=ide.0,unit=0
Note that creating a master on ide1 doesn't work that way. That is a...
ide/pci: fix indention
ide/qdev: add ide bus.
split away drive init from ide_init2()
This allows the ide bus being initialized without drives attachedand the drives being attached and initialization later on asseparate step.
qdev/pci: add pci_create_noinit()
Like pci_create_simple() but doesn't call qdev_init(), so one canset properties before initializing the device.
mips malta: ensure that the serial ports are associated with a device
The serial ports should be present even if associated with a null deviceas some firmware wants to initialize them.
hw/serial: don't create a char device if none is specified
When creating null devices, there is no way to ensure the unicity ofthe labels. Bail out with an error message instead.
unbreak ppc/prep
Changes: * added isa bus, hooked up to the system bus. Not sure this is correct, but 'info pci' lists lists no pci-isa bridge in the machine ...). * switches the default cpu to one which actually works.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
Add an ISA bus version of m48t59
Many thanks to Gerd Hoffmann for finding and fixing a bug in the initialversion.
Fix Linux task preemption on Versatile board
Recent versions of the Linux kernel will not preempt CPU-intensivetasks unless the clock used by sched_clock() works. On -M versatilepbthat's the 24MHz timer in the system controller. It's a very simpletimer, so implement it....