summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2012-02-03qdev: refactor device creation to allow bus_info to be set only in classAnthony Liguori1-23/+19
As we use class_init to set class members, DeviceInfo no longer holds this information. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qdev: allow classes to overload qdev functionsAnthony Liguori1-20/+33
This allows us to drop per-Device registration functions by allowing the class_init functions to overload qdev methods. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qdev: remove info from classAnthony Liguori3-44/+80
Now DeviceInfo is no longer used after object construction. All of the relevant members have been moved to DeviceClass. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qdev: make DeviceInfo privateAnthony Liguori4-23/+48
Introduce accessors and remove any code that directly accesses DeviceInfo members. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03usb: separate out legacy usb registration from type registrationAnthony Liguori11-25/+37
Type registeration is going to get turned into a QOM call so decouple the legacy support. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03usb-hid: simplify class initialization a bitAnthony Liguori1-14/+13
We can probably model USBHidDevice as a base class to get even better code sharing but for now, just use a common function to initialize the common class members. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-01hw/vmmouse.c: Disable vmmouse after rebootGerhard Wiesinger1-0/+2
Bugfix after reboot when vmmouse was enabled and another OS which uses e.g. PS/2 mouse. Details: When a guest activated the vmmouse followed by a reboot the vmmouse was still enabled and the PS/2 mouse was therefore unsusable. When another guest is then booted without vmmouse support (e.g. PS/2 mouse) the mouse is not working. Reason is that VMMouse has priority and disables all other mouse entities and therefore must be disabled on reset. Testscenario: 1.) Boot e.g. OS with VMMouse support (e.g. Windows with VMMouse tools) 2.) reboot 3.) Boot e.g. OS without VMMouse support (e.g. DOS) => PS/2 mouse doesn't work any more. Fixes that issue. Testscenario 2 by Jan Kiszka <jan.kiszka@siemens.com>: Confirm that this patch fixes a real issue. Setup: qemu.git, opensuse 11.4 guest, SDL graphic, system_reset while guest is using the vmmouse. Without the patch, the vmmouse become unusable after the reboot. Also, the mouse stays in absolute mode even before X starts again. Fixed by: Disabling the vmmouse in its reset handler. Tested-by: Andreas F=E4rber <afaerber@suse.de> Signed-off-by: Gerhard Wiesinger <lists@wiesinger.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-01mc146818rtc: Use lost_tick_policy propertyJan Kiszka1-7/+19
Allow to configure the MC146818 RTC via the new lost tick policy property and replace rtc_td_hack with this mechanism. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-01qdev: Introduce lost tick policy propertyJan Kiszka2-0/+62
Potentially tick-generating timer devices will gain a common property: lock_tick_policy. It allows to encode 4 different ways how to deal with tick events the guest did not process in time: discard - ignore lost ticks (e.g. if the guest compensates for them already) delay - replay all lost ticks in a row once the guest accepts them again merge - if multiple ticks are lost, all of them are merged into one which is replayed once the guest accepts it again slew - lost ticks are gradually replayed at a higher frequency than the original tick Not all timer device will need to support all modes. However, all need to accept the configuration via this common property. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-30m48t59: use rtc_clock for alarm timerPaolo Bonzini1-2/+2
This lets the RTC get adjustments from the host NTP client. The watchdog still uses the vm_clock. The previous behavior is available with "-rtc clock=vm". Cc: Andreas Färber <afaerber@suse.de> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-30GRLIB UART: Add RX channelFabien Chouteau1-17/+89
This patch implements the RX channel of GRLIB UART with a FIFO to improve data rate. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-27unin_pci: Fix typos in device namesAndreas Färber1-2/+2
Commit 999e12bbe85c5dcf49bef13bce4f97399c7105f4 (sysbus: apic: ioapic: convert to QEMU Object Model) introduced two typos, one of which broke the mac99 machine. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: change ambiguous qdev namesAnthony Liguori3-4/+4
Reported-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27virtio-s390: convert to QEMU Object ModelAnthony Liguori1-28/+65
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27sysbus: apic: ioapic: convert to QEMU Object ModelAnthony Liguori131-1296/+2733
This converts three devices because apic and ioapic are subclasses of sysbus. Converting subclasses independently of their base class is prohibitively hard. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27pci: convert to QEMU Object ModelAnthony Liguori53-1050/+1599
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27unin_pci: Drop unused reset handlerAndreas Färber1-7/+0
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-27unin_pci: Drop duplicate busdevAndreas Färber1-9/+20
PCIHostState already has a busdev. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-27unin_pci: Clean up qdev namesAndreas Färber1-15/+39
Add -pcihost to SysBus devices to resolve name conflicts, and clarify PCI vs. Internal PCI. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2012-01-27virtio-serial: convert to QEMU Object ModelAnthony Liguori3-90/+128
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27spapr: convert to QEMU Object Model (v2)Anthony Liguori5-71/+126
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - use QOM to check for the default console
2012-01-27scsi: convert to QEMU Object ModelAnthony Liguori4-113/+201
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27ide: convert to QEMU Object ModelAnthony Liguori2-49/+82
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27hda-codec: convert to QEMU Object ModelAnthony Liguori3-44/+71
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27i2c: smbus: convert to QEMU Object ModelAnthony Liguori15-164/+331
This converts two types because smbus is implemented as a subclass of i2c. It's extremely difficult to convert these two independently. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27i2c: rename i2c_slave -> I2CSlaveAnthony Liguori15-86/+88
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27ssi: convert to QEMU Object ModelAnthony Liguori10-70/+150
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27ccid: convert to QEMU Object ModelAnthony Liguori4-49/+109
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27usb: convert to QEMU Object ModelAnthony Liguori14-263/+469
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27isa: pic: convert to QEMU Object ModelAnthony Liguori28-192/+390
This converts two devices at once because PIC subclasses ISA and converting subclasses independently is extremely hard. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: prepare source tree for code conversionAnthony Liguori15-312/+304
These are various small stylistic changes which help make things more consistent such that the automated conversion script can be simpler. It's not necessary to agree or disagree with these style changes because all of this code is going to be rewritten by the patch monkey script anyway. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: add class_init to DeviceInfoAnthony Liguori2-0/+9
Since we are still dynamically creating TypeInfo, we need to chain the class_init function in order to be able to make use of it within subclasses of TYPE_DEVICE. This will disappear once we register TypeInfos directly. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: add a interface to register subclassesAnthony Liguori2-2/+8
In order to introduce inheritance while still using the qdev registration interfaces, we need to be able to use a parent other than TYPE_DEVICE. Add a new interface that allows this. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: use a wrapper to access reset and promote reset to a class methodAnthony Liguori4-9/+27
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: don't access name through infoAnthony Liguori28-44/+44
We already have a QOM interface for this so let's use it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: move qdev->info to classAnthony Liguori33-93/+119
Right now, DeviceInfo acts as the class for qdev. In order to switch to a proper ObjectClass derivative, we need to ween all of the callers off of interacting directly with the info pointer. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: integrate with QEMU Object Model (v2)Anthony Liguori2-2/+35
This is a very shallow integration. We register a TYPE_DEVICE but only use QOM as basically a memory allocator. This will make all devices show up as QOM objects but they will all carry the TYPE_DEVICE. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - update for new location of object.h
2012-01-27pci: call reset unconditionallyAnthony Liguori1-5/+2
Because now all PCI devices are converted to qdev. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27openpic: remove dead code to make a PCI device versionAnthony Liguori3-29/+5
bus is always NULL so the code in this if clause is dead (and therefore untested). Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27macio: convert to qdevAnthony Liguori1-13/+30
This is a "shallow", half hearted, and untested conversion. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into stagingAnthony Liguori5-17/+860
* pmaydell/arm-devs.for-upstream: arm: SoC model for Calxeda Highbank arm_boot: support board IDs more than 16 bits wide arm: add secondary cpu boot callbacks to arm_boot.c ahci: add support for non-PCI based controllers Add xgmac ethernet model
2012-01-27Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2-9/+3
* kwolf/for-anthony: (22 commits) scsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_command qcow: Use bdrv functions to replace file operation qcow: Return real error code in qcow_open block/vdi: Zero unused parts when allocating a new block (fix #919242) virtio-blk: add virtio_blk_handle_read trace event docs: describe live block operations block: add support for partial streaming add QERR_BASE_NOT_FOUND block: add bdrv_find_backing_image blockdev: make image streaming safe across hotplug qmp: add query-block-jobs qmp: add block_job_cancel command qmp: add block_job_set_speed command qmp: add block_stream command block: rate-limit streaming operations block: add image streaming block job block: add BlockJob interface for long-running operations block: make copy-on-read a per-request flag block: check bdrv_in_use() before blockdev operations coroutine: add co_sleep_ns() coroutine sleep function ...
2012-01-27pcnet: Preserve link state across device resetJan Kiszka1-1/+2
A device reset does not affect the link state, only set_link does. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-27e1000: Preserve link state across device resetJan Kiszka1-0/+5
A device reset does not affect the link state, only set_link does. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-27qdev-property: Make bit property parsing stricterJan Kiszka1-2/+2
By using strncasecmp, we allow for arbitrary characters after the "on"/"off" string. Fix this by switching to strcasecmp. Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-26scsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_commandThomas Higdon1-9/+1
Limit the return value (corresponding to the length of the buffer to be DMAed back to the intiator) to the value in req->cmd.xfer, which is the amount of data that the initiator expects. Eliminate now-duplicate code that does this guarding in the functions for individual commands. Without this, the SCRIPTS code in the emulated LSI device eventually raises a DMA interrupt for a data overrun when an INQUIRY command whose buflen exceeds req->cmd.xfer is processed. It's the responsibility of the client to provide a request buffer and allocation length that are large enough for the result of the command. Signed-off-by: Thomas Higdon <thigdon@akamai.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-01-26virtio-blk: add virtio_blk_handle_read trace eventStefan Hajnoczi1-0/+2
There already exists a virtio_blk_handle_write trace event as well as completion events. Add the virtio_blk_handle_read event so it's easy to trace virtio-blk requests for both read and write operations. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-01-26arm: SoC model for Calxeda HighbankRob Herring1-0/+330
Adds support for Calxeda's Highbank SoC. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-26arm_boot: support board IDs more than 16 bits widePeter Maydell1-6/+5
Support passing a board ID value to the kernel in r1 that is more than 16 bits wide. This is needed to pass the '-1 == invalid' value for boards which only support device tree booting. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
2012-01-26arm: add secondary cpu boot callbacks to arm_boot.cMark Langsdorf2-11/+60
Create two functions, write_secondary_boot() and secondary_cpu_reset_hook(), to allow platforms more control of how secondary CPUs are brought up. The new functions default to NULL and aren't called unless they are populated so there are no changes to existing platform models. Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>