summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* slirp: Put forked exec into separate process groupJan Kiszka2011-07-231-1/+2
| | | | | | | | | | Recent smb daemons tend to terminate themselves via a process group SIGTERM. If the daemon is still in qemu's group by that time, qemu will die as well. Avoid this by always pushing fork_exec processes into a group of their own, not just (unused) type 2 execs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Replace m_freem with m_freeJan Kiszka2011-07-237-19/+16
| | | | | | | Remove this pointless wrapping. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Strictly associate DHCP/BOOTP and TFTP with virtual hostJan Kiszka2011-07-231-5/+8
| | | | | | | | Instead of accepting every DHCP/BOOTP and TFTP packet, only invoke the built-in servers if the target is the virtual host. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Canonicalize restrict syntaxJan Kiszka2011-07-232-8/+17
| | | | | | | | | | | | All other boolean arguments accept on|off - except for slirp's restrict. Fix that while still accepting the formerly allowed yes|y|no|n, but reject everything else. This avoids accidentally allowing external connections because syntax errors were so far interpreted as 'restrict=no'. CC: Gleb Natapov <gleb@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* slirp: Fix restricted modeJan Kiszka2011-07-233-25/+6
| | | | | | | | | | | | This aligns the code to what the documentation claims: Allow everything but requests that would have to be routed outside of the virtual LAN. So we need to drop the unneeded IP-level filter, allow TFTP requests, and add the missing protocol-level filter to ICMP. CC: Gleb Natapov <gleb@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Deprecate -M command line optionsJan Kiszka2011-07-231-25/+20
| | | | | | | | Superseded by -machine. Therefore, this patch removes -M from the help list and pushes -machine at the same place in the output. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Generalize -machine command line optionJan Kiszka2011-07-233-22/+46
| | | | | | | | | | | | | | | -machine somehow suggests that it selects the machine, but it doesn't. Fix that before this command is set in stone. Actually, -machine should supersede -M and allow to introduce arbitrary per-machine options to the command line. That will change the internal realization again, but we will be able to keep the user interface stable. Tested-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* guest-agent: fix build with OpenBSDAnthony Liguori2011-07-221-11/+52
| | | | | | FS-Freeze only works with Linux. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* xen: fix xen-mapcache build on non-Xen capable targetsAvi Kivity2011-07-221-0/+32
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote-tracking branch 'origin/master' into stagingAnthony Liguori2011-07-221-2/+2
|\
| * target-sparc: Fix compiler errors (format strings)Stefan Weil2011-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | This change is needed because commit 06e12b65 now uses an unsigned long long value (uint64_t && unsigned long long => unsigned long long). Cc: Tsuneo Saito <tsnsaito@gmail.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Merge remote-tracking branch 'spice/spice.v39' into stagingAnthony Liguori2011-07-222-3/+12
|\ \
| * | qxl: upon reset, if spice worker is stopped, the command rings can be not emptyYonit Halperin2011-07-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Spice worker does no longer process commands when it is stopped. Otherwise, it might crash during migration when attempting to process commands while the guest is not completely loaded. Cc: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | spice: add sanity check for spice portsGerd Hoffmann2011-07-201-1/+10
| | | | | | | | | | | | | | | | | | | | | Make sure at least one port (port=.. or tls-port=...) is specified. Also apply range checks to the port numbers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | Merge remote-tracking branch 'qmp/for-anthony' into stagingAnthony Liguori2011-07-2240-31/+4842
|\ \ \
| * | | guest agent: add guest agent RPCs/commandsMichael Roth2011-07-217-3/+768
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the initial set of QMP/QAPI commands provided by the guest agent: guest-sync guest-ping guest-info guest-shutdown guest-file-open guest-file-read guest-file-write guest-file-seek guest-file-flush guest-file-close guest-fsfreeze-freeze guest-fsfreeze-thaw guest-fsfreeze-status The input/output specification for these commands are documented in the schema. Example usage: host: qemu -device virtio-serial \ -chardev socket,path=/tmp/vs0.sock,server,nowait,id=qga0 \ -device virtserialport,chardev=qga0,name=org.qemu.quest_agent.0 ... echo "{'execute':'guest-info'}" | socat stdio unix-connect:/tmp/qga0.sock guest: qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 \ -p /var/run/qemu-guest-agent.pid -d Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | guest agent: qemu-ga daemonMichael Roth2011-07-214-3/+660
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the actual guest daemon, it listens for requests over a virtio-serial/isa-serial/unix socket channel and routes them through to dispatch routines, and writes the results back to the channel in a manner similar to QMP. A shorthand invocation: qemu-ga -d Is equivalent to: qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 \ -f /var/run/qemu-ga.pid -d Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | guest agent: command state classMichael Roth2011-07-214-1/+102
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qerror: add QERR_JSON_PARSE_ERROR to qerror.cMichael Roth2011-07-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Missing from previous addition of error to qerror.h. Needed for qerror_format() and friends. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add QAPI code generation documentationMichael Roth2011-07-211-0/+316
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add test-qmp-commands, tests for gen. marshalling/dispatch codeMichael Roth2011-07-212-1/+120
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add test-visitor, tests for gen. visitor codeMichael Roth2011-07-212-2/+323
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: test schema used for unit testsMichael Roth2011-07-211-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is how QMP commands/parameters/types would be defined. We use a subset of that functionality here to implement functions/types for unit testing. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add qapi-commands.py code generatorMichael Roth2011-07-211-0/+385
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the code generator for qapi command marshaling/dispatch. Currently only generators for synchronous qapi/qmp functions are supported. This script generates the following files: $(prefix)qmp-marshal.c: command marshal/dispatch functions for each QMP command defined in the schema. Functions generated by qapi-visit.py are used to convert qobjects recieved from the wire into function parameters, and uses the same visiter functions to convert native C return values to qobjects from transmission back over the wire. $(prefix)qmp-commands.h: Function prototypes for the QMP commands specified in the schema. $(prefix) is used in the same manner as with qapi-types.py Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add qapi-visit.py code generatorMichael Roth2011-07-211-0/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the code generator for qapi visiter functions used to marshal/unmarshal/dealloc qapi types. It generates the following 2 files: $(prefix)qapi-visit.c: visiter function for a particular c type, used to automagically convert qobjects into the corresponding C type and vice-versa, and well as for deallocation memory for an existing C type $(prefix)qapi-visit.h: declarations for previously mentioned visiter functions $(prefix) is used as decribed for qapi-types.py Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add qapi-types.py code generatorMichael Roth2011-07-211-0/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the code generator for qapi types. It will generation the following files: $(prefix)qapi-types.h - C types corresponding to types defined in the schema you pass in $(prefix)qapi-types.c - Cleanup functions for the above C types The $(prefix) is used to as a namespace to keep the generated code from one schema/code-generation separated from others so code and be generated from multiple schemas with clobbering previously created code. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add qapi.py helper librariesMichael Roth2011-07-211-0/+203
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add ordereddict.py helper libraryMichael Roth2011-07-211-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need this to parse dictionaries with schema ordering intact so that C prototypes can be generated deterministically. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add QMP dispatch functionsMichael Roth2011-07-213-1/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given an object recieved via QMP, this code uses the dispatch table provided by qmp_registry.c to call the corresponding marshalling/dispatch function and format return values/errors for delivery to the QMP. Currently only synchronous QMP functions are supported, but this will also be used for async QMP functions and QMP guest proxy dispatch as well. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add QMP command registration/lookup functionsMichael Roth2011-07-213-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Registration/lookup functions for that provide a lookup table for dispatching QMP commands. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add QAPI dealloc visitorMichael Roth2011-07-213-1/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type of Visitor class that can be passed into a qapi-generated C type's visitor function to free() any heap-allocated data types. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add QMP output visitorMichael Roth2011-07-213-1/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type of Visiter class that serves as the inverse of the input visitor: it takes a series of native C types and uses their values to construct a corresponding QObject. The command marshaling/dispatcher functions will use this to convert the output of QMP functions into a QObject that can be sent over the wire. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add QMP input visitorMichael Roth2011-07-214-1/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A type of Visiter class that is used to walk a qobject's structure and assign each entry to the corresponding native C type. Command marshaling function will use this to pull out QMP command parameters recieved over the wire and pass them as native arguments to the corresponding C functions. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add QAPI visitor coreMichael Roth2011-07-215-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Base definitions/includes for Visiter interface used by generated visiter/marshalling code. Includes a GenericList type. Our lists require an embedded element. Since these types are generated, if you want to use them in a different type of data structure, there's no easy way to add another embedded element. The solution is to have non-embedded lists and that what this is. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qapi: add module init types for qapiMichael Roth2011-07-211-0/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | qlist: add qlist_first()/qlist_next()Michael Roth2011-07-211-0/+11
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | Add hard build dependency on glibAnthony Liguori2011-07-214-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLib is an extremely common library that has a portable thread implementation along with tons of other goodies. GLib and GObject have a fantastic amount of infrastructure we can leverage in QEMU including an object oriented programming infrastructure. Short term, it has a very nice thread pool implementation that we could leverage in something like virtio-9p. It also has a test harness implementation that this series will use. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | Error: Fix build when qemu-common.h is not includedLuiz Capitulino2011-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e4ea5e2d0e0e4c5188ab45b66f3195062ae059dc added the use of the macro GCC_FMT_ATTR to error.h, however compiler.h is not included by error.h This will cause a build error when files including error.h don't include qemu-common.h (or compiler.h). Not an issue today because the only file including it is json-parser.h and it does include qemu-common.h, but let's get it fixed. Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | Introduce compiler.h header fileLuiz Capitulino2011-07-212-24/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves compiler related macros from qemu-common.h to compiler.h. The reason for this change is that there are simple header files that depend only on the compiler macros, so including qemu-common.h is overkill. Besides, qemu-common.h is bloated and will benefit from some splitting. Please, also note that the QEMU_BUILD_BUG_ON() macro is being fixed to not use double underscores as a prefix and the license text was added by Vassili Karpov (malc), who is one of the authors of the new file. Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
| * | | QMP: add snapshot-blkdev-sync commandJes Sorensen2011-07-213-3/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add QMP bits for snapshot_blkdev command. This is the same as snapshot_blkdev in the human monitor. The command is synchronous. In the future async commands and or a break down of the functionality into multiple commands might be added. Also change the 'snapshot_file' argument to 'snapshot-file' in the human monitor, so that it matches QMP. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
* | | | Merge remote-tracking branch 'kraxel/usb.21' into stagingAnthony Liguori2011-07-226-8/+1260
|\ \ \ \
| * | | | USB: add usb network redirection supportHans de Goede2011-07-223-0/+1247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for a usb-redir device, which takes a chardev as a communication channel to an actual usbdevice using the usbredir protocol. Compiling the usb-redir device requires usbredir-0.3 to be installed for the usbredir protocol parser, usbredir-0.3 also contains a server for redirecting usb traffic from an actual usb device. You can get the 0.3 release of usbredir here: http://people.fedoraproject.org/~jwrdegoede/usbredir-0.3.tar.bz2 (getting a more formal site for it is a WIP) Example usage: 1) Start usbredirserver for a usb device: sudo usbredirserver 045e:0772 2) Start qemu with usb2 support + a chardev talking to usbredirserver + a usb-redir device using this chardev: qemu ... \ -readconfig docs/ich9-ehci-uhci.cfg \ -chardev socket,id=usbredirchardev,host=localhost,port=4000 \ -device usb-redir,chardev=usbredirchardev,id=usbredirdev Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | | usb-ehci: trace: rename "next" to "nxt".Gerd Hoffmann2011-07-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "next" is reserved in systemtap thus using this as a trace parameter name causes trouble when trying to trace with systemtap. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | | usb-uhci: fix irq handling on error.Gerd Hoffmann2011-07-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Spec on UHCI_STS_USBERR: "If the TD on which the error interrupt occurred also had its IOC bit set, both this bit and Bit 0 are set." Make UHCI emulation do that. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | | | usb-hid: fixup changed tracking.Gerd Hoffmann2011-07-221-5/+4
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove leftover calls to usb_hid_changed(). Take care to update the changed flag after delivering a event via GET_REPORT like we do when sending events via interrupt endpoint. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | | Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2011-07-2228-1860/+2509
|\ \ \ \ | |/ / / |/| | |
| * | | Add missing documentation for qemu-img -pJes Sorensen2011-07-202-4/+6
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qcow2: Use Qcow2Cache in writeback mode during loadvm/savevmKevin Wolf2011-07-193-11/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In snapshotting there is no guest involved, so we can safely use a writeback mode and do the flushes in the right place (i.e. at the very end). This improves the time that creating/restoring an internal snapshot takes with an image in writethrough mode. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: add bdrv_get_allocated_file_size() operationFam Zheng2011-07-197-30/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qemu-img.c wants to count allocated file size of image. Previously it counts a single bs->file by 'stat' or Window API. As VMDK introduces multiple file support, the operation becomes format specific with platform specific meanwhile. The functions are moved to block/raw-{posix,win32}.c and qemu-img.c calls bdrv_get_allocated_file_size to count the bs. And also added VMDK code to count his own extents. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | VMDK: fix coding styleFam Zheng2011-07-191-30/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conform coding style in vmdk.c to pass scripts/checkpatch.pl checks. Signed-off-by: Fam Zheng <famcool@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud