aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2012-02-22jazz-led: use trace frameworkHervé Poussineau2-17/+13
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22qom: Fix object_initialize_with_type() assertionAndreas Färber1-1/+1
Assert the object is at least sizeof(Object), not sizeof(ObjectClass). Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22pci: set memory type for memory behind the bridgeMichael S. Tsirkin1-2/+13
As we make upper bits in IO and prefetcheable memory registers writeable, we should declare support for 64 bit prefetcheable memory and 32 bit io in the bridge. This changes the default for apb, dec, but I'm guessing they got the defaults wrong by accident. Alternatively, we could let bridges declare lack of 64 bit support and make the upper bits read-only zero. With this applied, we can drop these bits from express code. Reported-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Could someone familiar with apb,dec ack this please? Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22pci: add accessors to get/set registers by maskMichael S. Tsirkin1-0/+61
pci_regs.h specifies many registers by mask + shifted register values. There's always some duplication when using such: for example to override device type, we would need: pci_word_test_and_clear_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE); pci_word_test_and_set_mask(cap + PCI_EXP_FLAGS, PCI_EXP_TYPE_ENDPOINT << (ffs(PCI_EXP_FLAGS_TYPE) - 1)); Getting such registers also uses some duplication: word = pci_get_word(cap + PCI_EXP_FLAGS) & PCI_EXP_FLAGS_TYPE; if ((word >> ffs((PCI_EXP_FLAGS_TYPE) - 1)) == PCI_EXP_TYPE_ENDPOINT) Add API to access such registers in one line: pci_set_word_by_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE, PCI_EXP_TYPE_ENDPOINT) and word = pci_get_word_by_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE) if (word == PCI_EXP_TYPE_ENDPOINT) Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22qom: Document ways to retrieve child object added by object_property_add_child()Alexander Barabash1-0/+4
object_property_add_child() creates a property whose values as a string is the child object's canonical path. Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22pc_piix/pc_sysfw: enable flash by defaultJordan Justen2-1/+50
Now, the pc-sysfw:rom_only property will default to false which enables flash by default. All pc types below pc-1.1 set rom_only to true. This prevents flash from being enabled on these pc machine types. For pc-1.1 rom_only will use the default (false), which will allow flash to be used for pc-1.1. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22hw/pc_piix: add pc-1.1Jordan Justen1-2/+10
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22hw/pc_piix: remove is_default for pc-0.15Jordan Justen1-1/+0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22hw/pc_sysfw: support system flash memory with pflashJordan Justen3-2/+129
Flash can be enabled by calling pc_system_firmware_init with the system_flash_enabled parameter being non-zero. If system_flash_enabled is zero, then the older qemu rom creation method will be used. If flash is enabled and a pflash image is found, then it is used for the system firmware image. If flash is enabled and a pflash image is not initially found, then a read-only pflash device is created using the -bios filename. KVM cannot execute from a pflash region currently. Therefore, when KVM is enabled, the old rom based initialization method is used. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22hw/pc_sysfw: enable pc-sysfw as a qdevJordan Justen1-0/+37
Setup a pc-sysfw device type. It contains a single property of 'rom_only' which is defaulted to enabled. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22hw/pc: move rom init to pc_sysfw.cJordan Justen4-51/+101
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22vl: make find_default_machine externally visibleJordan Justen2-1/+2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22pflash_cfi01/02: support read-only pflash devicesJordan Justen2-52/+75
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22blockdev: allow read-only pflash devicesJordan Justen1-1/+2
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22Merge remote-tracking branch 'bonzini/qdev-props-for-anthony' into stagingAnthony Liguori16-208/+842
* bonzini/qdev-props-for-anthony: qdev: drop unnecessary parse/print methods qdev: use built-in QOM string parser qdev: accept hex properties only if prefixed by 0x qdev: accept both strings and integers for PCI addresses qom: add generic string parsing/printing qapi: add tests for string-based visitors qapi: add string-based visitors qapi: drop qmp_input_end_optional qapi: allow sharing enum implementation across visitors
2012-02-22virtio-scsi: add basic SCSI bus operationPaolo Bonzini1-13/+98
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22virtio-scsi: Add basic request processing infrastructureStefan Hajnoczi1-2/+140
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22virtio-scsi: Add virtio-scsi stub deviceStefan Hajnoczi11-0/+364
Add a useless virtio SCSI HBA device: qemu -device virtio-scsi-pci Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi-disk: add migration supportPaolo Bonzini1-4/+55
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi-generic: add migration supportPaolo Bonzini1-0/+25
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi: add SCSIDevice vmstate definitionsPaolo Bonzini2-3/+120
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi-disk: enable scatter/gather functionalityPaolo Bonzini2-13/+51
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi: add scatter/gather functionalityPaolo Bonzini2-2/+29
Scatter/gather functionality uses the newly added DMA helpers. The device can choose between doing DMA itself, or calling scsi_req_data as usual, which will use the newly added DMA helpers to copy piecewise to/from the destination area(s). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi: pass residual amount to command_completePaolo Bonzini6-9/+15
With the upcoming sglist support, HBAs will not see any transfer_data call and will not have a way to detect short transfers. So pass the residual amount of data upon command completion. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22ahci: use new DMA helpersPaolo Bonzini1-69/+13
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22dma-helpers: add accounting wrappersPaolo Bonzini2-0/+9
The length of the transfer is already in the sglist, the wrapper simply fetches it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22dma-helpers: add dma_buf_read and dma_buf_writePaolo Bonzini2-0/+34
These helpers do a full transfer from an in-memory buffer to target memory, with support for scatter/gather lists. It will be used to store the reply of an emulated command into a QEMUSGList provided by the adapter. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22dma-helpers: make QEMUSGList target independentPaolo Bonzini1-7/+7
scsi-disk will manage scatter/gather list, but it does not create single entries so it remains target-independent. Make QEMUSGList available to it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22qdev: drop unnecessary parse/print methodsPaolo Bonzini1-134/+0
More qdev printers could have been removed in the previous series, and object_property_parse also made several parsers unnecessary. In fact, the new code is even more robust with respect to overflows, so clean them up! Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22qdev: use built-in QOM string parserPaolo Bonzini1-2/+2
object_property_parse lets us drop the legacy setters when their task is done just as well by the string visitors. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22qdev: accept hex properties only if prefixed by 0xPaolo Bonzini1-0/+12
Hex properties are an obstacle to removal of old qdev string parsing, but even here we can lay down the foundations for future simplification. In general, they are rarely used and their printed form is more interesting than the parsing. For example you'd usually set isa-serial.index instead of isa-serial.iobase. And luckily our main client, libvirt only cares about few of these, and always sets them with a 0x prefix. So the series stops accepting bare hexadecimal numbers, preparing for making legacy properties read-only in 1.3 or so. The read side will stay as long as "info qtree" is with us. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22qdev: accept both strings and integers for PCI addressesPaolo Bonzini1-11/+25
Visitors allow a limited form of polymorphism. Exploit it to support setting the non-legacy PCI address property both as a DD.F string and as an 8-bit integer. The 8-bit integer form is just too clumsy, it is unlikely that we will ever drop it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22qom: add generic string parsing/printingPaolo Bonzini2-0/+49
Add generic property accessors that take a string and parse it appropriately for the property type. All the magic here is done by the new string-based visitors. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-21qxl: add user-friendly bar size propertiesGerd Hoffmann2-0/+12
Add two properties to specify bar sizes in megabytes instead of bytes, which is alot more user-friendly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: move ram size init to new functionGerd Hoffmann1-19/+22
Factor memory bar sizing bits out to a separate function. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: drop vram bar minimum sizeGerd Hoffmann1-2/+2
There is no reason to require a minimum size of 16 MB for the vram. Lower the limit to 4096 (one page). Make it disapper completely would break guests.
2012-02-21spice: support ipv6 channel address in monitor events and in spice infoYonit Halperin1-5/+32
RHBZ #788444 CC: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21Add SPICE support to add_client monitor commandDaniel P. Berrange4-4/+31
With the acceptance of some new APIs to libspice-server.so it is possible to add support for SPICE to the 'add_client' monitor command, bringing parity with VNC. Since SPICE can use TLS or plain connections, the command also gains a new 'tls' parameter to specify whether TLS should be attempted on the injected client sockets. This new feature is only enabled if building against a libspice-server >= 0.10.1 * qmp-commands.hx: Add 'tls' parameter & missing doc for 'skipauth' parameter * monitor.c: Wire up SPICE for 'add_client' command * ui/qemu-spice.h, ui/spice-core.c: Add qemu_spice_display_add_client API to wire up from monitor [1] http://cgit.freedesktop.org/spice/spice/commit/server/spice.h?id=d55b68b6b44f2499278fa860fb47ff22f5011faa http://cgit.freedesktop.org/spice/spice/commit/server/spice.h?id=bd07dde530d9504e1cfe7ed5837fc00c26f36716 Changes in v3: - Added 'optional' flag to new parameters documented - Added no-op impl of qemu_spice_display_add_client when SPICE is disabled during build Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: make sure primary surface is saved on migration also in compat modeYonit Halperin1-1/+1
RHBZ #790083 Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: set only off-screen surfaces dirty instead of the whole vramYonit Halperin1-9/+44
We used to assure the guest surfaces were saved before migration by setting the whole vram dirty. This patch sets dirty only the areas that are actually used in the vram. Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: don't render stuff when the vm is stopped.Gerd Hoffmann1-7/+5
This patch fixes the local qxl renderer to not kick spice-server in case the vm is stopped. First it is largely pointless because we ask spice-server to process all not-yet processed commands when the vm is stopped, so there isn't much do do anyway. Second we avoid triggering an assert in spice-server. The patch makes sure we still honor redraw requests, even if we don't ask spice-server for updates. This is needed to handle displaysurface changes with a stopped vm correctly. With this patch applied it is possible to take screen shots (via screendump monitor command) from a qxl gpu even in case the guest is stopped. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qxl: fix warnings on 32bitGerd Hoffmann1-3/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-02-21qapi: add tests for string-based visitorsPaolo Bonzini4-2/+395
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-21qapi: add string-based visitorsPaolo Bonzini5-2/+281
String based visitors provide a consistent interface for parsing strings to C values, as well as consuming C values as strings. They will be used to parse command-line options. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-21qapi: drop qmp_input_end_optionalPaolo Bonzini1-5/+0
This method is optional, do not implement it if it is empty. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-21qapi: allow sharing enum implementation across visitorsPaolo Bonzini4-52/+78
Most visitors will use the same code for enum parsing. Move it to the core. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-17input: send kbd+mouse events only to running guests.Gerd Hoffmann1-0/+6
Trying to interact with a stopped guest will queue up the events, then send them all at once when the guest continues running, with a high chance to have them cause unwanted actions. Avoid that by only injecting the input events only when the guest is in running state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17i8259: Do not clear level-triggered lines in IRR on initJan Kiszka3-3/+3
When an input line is handled as level-triggered, it will immediately raise an IRQ on the output of a PIC again that goes through an init reset. So only clear the edge-triggered inputs from IRR in that scenario. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17i8254: Factor out pit_get_channel_infoJan Kiszka3-34/+29
Instead of providing 4 individual query functions for mode, gate, output and initial counter state, introduce a service that queries all information at once. This comes with tiny additional costs for pcspk_callback but with a much cleaner interface. Also, it will simplify the implementation of the KVM in-kernel PIT model. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17pcspk: Convert to qdevJan Kiszka7-17/+109
Convert the PC speaker device to a qdev ISA model. Move the public interface to a dedicated header file at this chance. CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>