summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* qemu-ga: separate out common commands from posix-specific onesMichael Roth2012-02-234-59/+76
| | | | | | | | | | Many of the current RPC implementations are very much POSIX-specific and require complete re-writes for Windows. There are however a small set of core guest agent commands that are common to both, and other commands such as guest-file-* which *may* be portable. So we introduce commands.c for the latter, and will rename guest-agent-commands.c to commands-posix.c in a future commit. Windows implementations will go in commands-win32.c, eventually.
* qemu-ga: move channel/transport functionality into wrapper classMichael Roth2012-02-235-233/+355
| | | | | | | | | | | | | | This is mostly in preparation for the win32 port, which won't use GIO channels for reasons that will be made clearer later. Here the GAChannel class is just a loose wrapper around GIOChannel calls/callbacks, but we also roll in the logic/configuration for various channel types and managing unix socket connections, which makes the abstraction much more complete and further aids in the win32 port since isa-serial/unix-listen will not be supported initially. There's also a bit of refactoring in the main logic to consolidate the exit paths so we can do common cleanup for things like pid files, which weren't always cleaned up previously.
* qemu-ga: Add schema documentation for typesMichael Roth2012-02-231-21/+97
| | | | | Document guest agent schema types in similar fashion to qmp schema types.
* qom: add test toolsAnthony Liguori2012-02-223-0/+195
| | | | | | | Tested-by: Andreas F=E4rber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qmp: make qmp.py easier to useAnthony Liguori2012-02-221-0/+6
| | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Makefile: Add dependency to fix linux-user-only buildPeter Maydell2012-02-221-0/+1
| | | | | | | | | Make qemu-bridge-helper explicitly depend on $(GENERATED_HEADERS) so that it doesn't fail to build when we configured for linux-user targets only. (Build breakage introduced in commit 7b93fad.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make kernel, initrd and append be machine_optsPeter Maydell2012-02-222-8/+28
| | | | | | | | | Make kernel, initrd, append be machine opts (ie -machine kernel=foo) with the old plain command line arguments as legacy/convenience equivalents. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* jazz-led: compile it only twiceHervé Poussineau2012-02-226-1/+5
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* jazz-led: convert to QOMHervé Poussineau2012-02-223-93/+71
| | | | | | | | Some simplifications in I/O functions are possible because Jazz LED only registers one byte of I/O. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* jazz-led: use trace frameworkHervé Poussineau2012-02-222-17/+13
| | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qom: Fix object_initialize_with_type() assertionAndreas Färber2012-02-221-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>
* pci: set memory type for memory behind the bridgeMichael S. Tsirkin2012-02-221-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>
* pci: add accessors to get/set registers by maskMichael S. Tsirkin2012-02-221-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>
* qom: Document ways to retrieve child object added by object_property_add_child()Alexander Barabash2012-02-221-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>
* pc_piix/pc_sysfw: enable flash by defaultJordan Justen2012-02-222-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>
* hw/pc_piix: add pc-1.1Jordan Justen2012-02-221-2/+10
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hw/pc_piix: remove is_default for pc-0.15Jordan Justen2012-02-221-1/+0
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hw/pc_sysfw: support system flash memory with pflashJordan Justen2012-02-223-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>
* hw/pc_sysfw: enable pc-sysfw as a qdevJordan Justen2012-02-221-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>
* hw/pc: move rom init to pc_sysfw.cJordan Justen2012-02-224-51/+101
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vl: make find_default_machine externally visibleJordan Justen2012-02-222-1/+2
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pflash_cfi01/02: support read-only pflash devicesJordan Justen2012-02-222-52/+75
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* blockdev: allow read-only pflash devicesJordan Justen2012-02-221-1/+2
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'bonzini/qdev-props-for-anthony' into stagingAnthony Liguori2012-02-2216-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
| * qdev: drop unnecessary parse/print methodsPaolo Bonzini2012-02-221-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>
| * qdev: use built-in QOM string parserPaolo Bonzini2012-02-221-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>
| * qdev: accept hex properties only if prefixed by 0xPaolo Bonzini2012-02-221-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>
| * qdev: accept both strings and integers for PCI addressesPaolo Bonzini2012-02-221-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>
| * qom: add generic string parsing/printingPaolo Bonzini2012-02-222-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>
| * qapi: add tests for string-based visitorsPaolo Bonzini2012-02-214-2/+395
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * qapi: add string-based visitorsPaolo Bonzini2012-02-215-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>
| * qapi: drop qmp_input_end_optionalPaolo Bonzini2012-02-211-5/+0
| | | | | | | | | | | | This method is optional, do not implement it if it is empty. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * qapi: allow sharing enum implementation across visitorsPaolo Bonzini2012-02-214-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>
* | qxl: add user-friendly bar size propertiesGerd Hoffmann2012-02-212-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>
* | qxl: move ram size init to new functionGerd Hoffmann2012-02-211-19/+22
| | | | | | | | | | | | Factor memory bar sizing bits out to a separate function. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | qxl: drop vram bar minimum sizeGerd Hoffmann2012-02-211-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.
* | spice: support ipv6 channel address in monitor events and in spice infoYonit Halperin2012-02-211-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>
* | Add SPICE support to add_client monitor commandDaniel P. Berrange2012-02-214-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>
* | qxl: make sure primary surface is saved on migration also in compat modeYonit Halperin2012-02-211-1/+1
| | | | | | | | | | | | | | RHBZ #790083 Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | qxl: set only off-screen surfaces dirty instead of the whole vramYonit Halperin2012-02-211-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>
* | qxl: don't render stuff when the vm is stopped.Gerd Hoffmann2012-02-211-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>
* | qxl: fix warnings on 32bitGerd Hoffmann2012-02-211-3/+4
|/ | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: send kbd+mouse events only to running guests.Gerd Hoffmann2012-02-171-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>
* i8259: Do not clear level-triggered lines in IRR on initJan Kiszka2012-02-173-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>
* i8254: Factor out pit_get_channel_infoJan Kiszka2012-02-173-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>
* pcspk: Convert to qdevJan Kiszka2012-02-177-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>
* i8254: Rework & fix interaction with HPET in legacy modeJan Kiszka2012-02-175-48/+57
| | | | | | | | | | | | | | | | | | | | | | | When the HPET enters legacy mode, the IRQ output of the PIT is suppressed and replaced by the HPET timer 0. But the current code to emulate this was broken in many ways. It reset the PIT state after re-enabling, it worked against a stale static PIT structure, and it did not properly saved/restored the IRQ output mask in the PIT vmstate. This patch solves the PIT IRQ control in a different way. On x86, it both redirects the PIT IRQ to the HPET, just like the RTC. But it also keeps the control line from the HPET to the PIT. This allows to disable the PIT QEMU timer when it is not needed. The PIT's view on the control line state is now saved in the same format that qemu-kvm is already using. Note that, in contrast to the suppressed RTC IRQ line, we do not need to save/restore the PIT line state in the HPET. As we trigger a PIT IRQ update via the control line, the line state is reconstructed on mode switch. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* i8254: Pass alternative IRQ output object on initializationJan Kiszka2012-02-179-12/+12
| | | | | | | | | | | | | HPET legacy emulation will require control over the PIT IRQ output. To enable this, add support for an alternative IRQ output object to the PIT factory function. If the isa_irq number is < 0, this object will be used. This also removes the IRQ number property from the PIT class as we now use a generic GPIO output pin that is connected by the factory function. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* i8254: Factor out interface headerJan Kiszka2012-02-1712-25/+64
| | | | | | | | Move the public interface of the PIT into its own header file and update all users. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hpet: Save/restore cached RTC IRQ levelJan Kiszka2012-02-171-0/+29
| | | | | | | | | | | | | | In legacy mode, the HPET suppresses the RTC interrupt delivery via IRQ 8 but keeps track of the RTC output level and applies it when legacy mode is turned off again. This value has to be preserved across save/ restore as it cannot be reconstructed otherwise. To document that a raised rtc_irq_level won't survive a vmload without a hpet/rtc_irq_level subsection, add an explicit clearing to the reset handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud