summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-02-23qemu-ga: add Windows service integrationMichael Roth4-10/+249
This allows qemu-ga to function as a Windows service: - to install the service (will auto-start on boot): qemu-ga --service install - to start the service: net start qemu-ga - to stop the service: net stop qemu-ga - to uninstall service: qemu-ga --service uninstall Original patch by Gal Hammer <ghammer@redhat.com>
2012-02-23qemu-ga: add initial win32 supportMichael Roth3-1/+345
This adds a win32 channel implementation that makes qemu-ga functional on Windows using virtio-serial (unix-listen/isa-serial not currently implemented). Unlike with the posix implementation, we do not use GIOChannel for the following reasons: - glib calls stat() on an fd to check whether S_IFCHR is set, which is the case for virtio-serial on win32. Because of that, a one-time check to determine whether the channel is readable is done by making a call to PeekConsoleInput(), which reports the underlying handle is not a valid console handle, and thus we can never read from the channel. - if one goes as far as to "trick" glib into thinking it is a normal file descripter, the buffering is done in such a way that data written to the output stream will subsequently result in that same data being read back as if it were input, causing an error loop. furthermore, a forced flush of the channel only moves the data into a secondary buffer managed by glib, so there's no way to prevent output from getting read back as input. The implementation here ties into the glib main loop by implementing a custom GSource that continually submits asynchronous/overlapped I/O to fill an GAChannel-managed read buffer, and tells glib to poll the corresponding event handle for a completion whenever there is no data/RPC in the read buffer to notify the main application about.
2012-02-23qemu-ga: fixes for win32 build of qemu-gaMichael Roth5-6/+114
Various stubs and #ifdefs to compile for Windows using mingw cross-build. Still has 1 linker error due to a dependency on the forthcoming win32 versions of the GAChannel/transport class.
2012-02-23qemu-ga: rename guest-agent-commands.c -> commands-posix.cMichael Roth2-1/+1
2012-02-23qemu-ga: separate out common commands from posix-specific onesMichael Roth4-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.
2012-02-23qemu-ga: move channel/transport functionality into wrapper classMichael Roth5-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.
2012-02-23qemu-ga: Add schema documentation for typesMichael Roth1-21/+97
Document guest agent schema types in similar fashion to qmp schema types.
2012-02-22qom: add test toolsAnthony Liguori3-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>
2012-02-22qmp: make qmp.py easier to useAnthony Liguori1-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>
2012-02-22Makefile: Add dependency to fix linux-user-only buildPeter Maydell1-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>
2012-02-22Make kernel, initrd and append be machine_optsPeter Maydell2-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>
2012-02-22jazz-led: compile it only twiceHervé Poussineau6-1/+5
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-22jazz-led: convert to QOMHervé Poussineau3-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>
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-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>