Checksum-related utility functions
net_checksum_add_cont()checksum calculation for scattered data with odd chunk sizes
net_raw_checksum()checksum calculation for a buffer
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>Signed-off-by: Yan Vugenfirer <yan@daynix.com>...
Add moxie disassembler
Signed-off-by: Anthony Green <green@moxielogic.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add sample moxie system
Merge remote-tracking branch 'kwolf/for-anthony' into staging
nbd: Remove unused functions
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
block: Introduce .bdrv_parse_filename callback
If a driver needs structured data and not just a string, it can providea .bdrv_parse_filename callback now that parses the command line stringinto separate options. Keeping this separate from .bdrv_open_filename...
block: Allow omitting the file name when using driver-specific options
After this patch, using -drive with an empty file name continues to openthe file if driver-specific options are used. If no driver-specificoptions are specified, the semantics stay as it was: It defines a drive...
block: Add options QDict to bdrv_file_open() prototypes
The new parameter is unused yet.
qemu-socket: Make socket_optslist public
Allow other users to create the QemuOpts needed for inet_connect_opts().
nbd: Keep hostname and port separate
The NBD block supports an URL syntax, for which a URL parser returnsseparate hostname and port fields. It also supports the traditional qemusyntax encoded in a filename. Until now, after parsing the URL to geteach piece of information, a new string is built to be fed to socket...
Fix typos and misspellings
Fix various typos and misspellings. The bulk of these were found withcodespell.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
char: Fix return type of qemu_chr_fe_add_watch()
qemu_chr_fe_add_watch() can return negative errors, therefore it mustnot have an unsigned return type. For consistency with otherqemu_chr_fe_* functions, this uses a standard C int instead of glibtypes....
spice: stop using DisplayState
Rework DisplayStateListener callbacks to not use the DisplayStateany more.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
console: zap displaystate from dcl callbacks
Now that nobody depends on DisplayState in DisplayChangeListenercallbacks any more we can remove the parameter from all callbacks.
console: stop using DisplayState in gfx hardware emulation
Use QemuConsole instead. Updates interfaces in console.[ch] and adaptsgfx hardware emulation code.
console: remove ds_get_* helper functions
Switch the few remaining ds_get_* uses in console.c over to the newsurface_* accessors.
While doing so tripped over a few leftovers from commita93a4a226a2afba147ba5df688b85d844f537c68 (code using depth == 0as indicator for textmode rendering). Fixed them up....
console: fix displaychangelisteners interface
Split callbacks into separate Ops struct. Pass DisplayChangeListenerpointer as first argument to all callbacks. Uninline a bunch ofdisplay functions and move them from console.h to console.c
console: kill DisplayState->opaque
It's broken by design. There can be multiple DisplayChangeListenerinstances, so they simply can't store state in the (single) DisplayStatestruct. Try 'qemu -display gtk -vnc :0', watch it crash & burn.
With DisplayChangeListenerOps having a more sane interface now we can...
console: rework DisplaySurface handling [vga emu side]
Decouple DisplaySurface allocation & deallocation from DisplayState.Replace dpy_gfx_resize + dpy_gfx_setdata with a dpy_gfx_replace_surfacefunction.
This handles the graphic hardware emulation.
console: rework DisplaySurface handling [dcl/ui side]
Replace the dpy_gfx_resize and dpy_gfx_setdata DisplayChangeListenercallbacks with a dpy_gfx_switch callback which notifies the ui codewhen the framebuffer backing storage changes.
console: add surface_*() getters
Add convinence wrappers to query DisplaySurface properties.Simliar to ds_get_*, but operating in the DisplaySurfacenot the DisplayState.
With this patch in place ui frontents can stop using DisplayStatein the rendering code paths, they can simply operate using the...
iov: Factor out hexdumper
Factor out the hexdumper functionality from iov for all to use. Useful forcreating verbose debug printfery that dumps packet data.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Message-id: faaac219c55ea586d3f748befaf5a2788fd271b8.1361853677.git.peter.crosthwaite@xilinx.com...
block: add bdrv_get_aio_context()
For now bdrv_get_aio_context() is just a stub that callsqemu_aio_get_context() since the block layer is currently tied to themain loop AioContext.
Add the stub now so that the block layer can begin accessing itsAioContext....
threadpool: drop global thread pool
Now that each AioContext has a ThreadPool and the main loop AioContextcan be fetched with bdrv_get_aio_context(), we can eliminate the conceptof a global thread pool from thread-pool.c.
The submit functions must take a ThreadPool* argument....
coroutine: use AioContext for CoQueue BH
CoQueue uses a BH to awake coroutines that were made ready to run againusing qemu_co_queue_next() or qemu_co_queue_restart_all(). The BHcurrently runs in the iothread AioContext and would break coroutinesthat run in a different AioContext....
main-loop: add qemu_get_aio_context()
It is very useful to get the main loop AioContext, which is a staticvariable in main-loop.c.
I'm not sure whether qemu_get_aio_context() will be necessary in thefuture once devices focus on using their own AioContext instead of the...
threadpool: add thread_pool_new() and thread_pool_free()
ThreadPool is tied to an AioContext through its event notifier, whichdictates in which AioContext the work item's callback function will beinvoked.
In order to support multiple AioContexts we need to support multiple...
aio: add a ThreadPool instance to AioContext
This patch adds a ThreadPool to AioContext. It's possible that someAioContext instances will never use the ThreadPool, so defer creationuntil aio_get_thread_pool().
The reason why AioContext should have the ThreadPool is because the...
block: Add options QDict to .bdrv_open()
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: Add options QDict to bdrv_open() prototype
It doesn't do anything yet except storing the options QDict in theBlockDriverState.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>...
Add qdict_clone_shallow()
qemu-option: Add qemu_opts_absorb_qdict()
This adds a function that adds all entries of a QDict to a QemuOpts ifthe keys are known, and leaves only the rest in the QDict.
This way a single QDict of -drive options can be processed in multipleplaces (generic block layer, block driver, backing file block driver,...
blockdev: Keep a copy of DriveInfo.serial
Pointing to a QemuOpts element is surprising and can lead to subtleuse-after-free errors when the QemuOpts is freed after all options areparsed.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Merge remote-tracking branch 'kraxel/chardev.5' into staging
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
chardev: add msmouse support to qapi
This patch adds 'msmouse' support to qapi and also switches overthe msmouse chardev initialization to the new qapi code path.
chardev: add braille support to qapi
This patch adds 'braille' support to qapi and also switches overthe braille chardev initialization to the new qapi code path.
chardev: add spice support to qapi
This patch adds 'spicevmc' and 'spiceport' support to qapi and alsoswitches over the spice chardev initialization to the new qapi codepath.
chardev: add vc support to qapi
This patch adds 'vc' support to qapi and also switches over thevc chardev initialization to the new qapi code path.
chardev: add udp support to qapi
This patch adds 'udp' support to qapi.
chardev: add support for qapi-based chardev initialization
This patch add support for a new way to initialize chardev devices.Instead of calling a initialization function with a QemuOpts we willnow create a (qapi) ChardevBackend, optionally call a function to...
Add a TPM Passthrough backend driver implementation
This patch is based of off version 9 of Stefan Berger's patch series "QEMU Trusted Platform Module (TPM) integration" and adds a new backend driver for it.
This patch adds a passthrough backend driver for passing commands sent to the...
Support for TPM command line options
This patch adds support for TPM command line options.The command line options supported here are
./qemu-... -tpmdev passthrough,path=<path to TPM device>,id=<id> -device tpm-tis,tpmdev=<id>,id=<other id>...
cpu: Move halted and interrupt_request fields to CPUState
Both fields are used in VMState, thus need to be moved together.Explicitly zero them on reset since they were located beforebreakpoints.
Pass PowerPCCPU to kvmppc_handle_halt().
Signed-off-by: Andreas Färber <afaerber@suse.de>
exec: Pass CPUState to cpu_reset_interrupt()
Move it to qom/cpu.c to avoid build failures depending on include orderof cpu-qom.h and exec/cpu-all.h.
Change opaques of various ..._irq_handler() functions to theappropriate CPU type to facilitate using cpu_reset_interrupt()....
cpu: Pass CPUState to cpu_interrupt()
Move it to qom/cpu.h to avoid issues with include order.
Change pc_acpi_smi_interrupt() opaque to X86CPU.
cpu: Replace do_interrupt() by CPUClass::do_interrupt method
This removes a global per-target function and thus takes us one stepcloser to compiling multiple targets into one executable.
It will also allow to override the interrupt handling for certain CPU...
vmstate: Make vmstate_register() static inline
This avoids adding a duplicate stub for CONFIG_USER_ONLY.
Suggested-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>...
stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY
Reviewed-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Register VMStateDescription through CPUState
In comparison to DeviceClass::vmsd, CPU VMState is split in two,"cpu_common" and "cpu", and uses cpu_index as instance_id instead of -1.Therefore add a CPU-specific CPUClass::vmsd field.
Unlike the legacy CPUArchState registration, rather register CPUState....
cpu: Introduce cpu_class_set_vmsd()
This setter avoids redefining each VMStateDescription value tovmstate_dummy by not referencing the value for CONFIG_USER_ONLY.
Suggested-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>...
migration: eliminate s->migration_file
The indirection is useless now. Backends can open s->file directly.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
page_cache: dup memory on insert
The page cache frees all data on finish, on resize andif there is collision on insert. So it should be the cachesresponsibility to dup the data that is stored in the cache.
Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Orit Wasserman <owasserm@redhat.com>...
migration: yay, buffering is gone
Buffering was needed because blocking writes could take a long timeand starve other threads seeking to grab the big QEMU mutex.
Now that all writes (except within _complete callbacks) are doneoutside the big QEMU mutex, we do not need buffering at all....
qemu-file: make qemu_fflush and qemu_file_set_error private again
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
migration: merge qemu_popen_cmd with qemu_popen
There is no reason for outgoing exec migration to do popen manuallyanymore (the reason used to be that we needed the FILE* to make itnon-blocking). Use qemu_popen_cmd.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>...
qemu-file: check exit status when closing a pipe QEMUFile
This is what exec_close does. Move this to the underlying QEMUFile.
qemu-file: add writable socket QEMUFile
migration: use QEMUFile for migration channel lifetime
As a start, use QEMUFile to store the destination and close it.qemu_get_fd gets a file descriptor that will be used by the writecallbacks.
Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>...
migration: use QEMUFile for writing outgoing migration data
Second, drop the file descriptor indirection, and write directly to theQEMUFile.
migration: move rate limiting to QEMUFile
Rate limiting is now simply a byte counter; client callqemu_file_rate_limit() manually to determine if they have to exit.So it is possible and simple to move the functionality to QEMUFile.
This makes the remaining functionality of s->file redundant;...
migration: use qemu_file_set_error to pass error codes back to qemu_savevm_state
qemu-file: temporarily expose qemu_file_set_error and qemu_fflush
Right now, migration cannot entirely rely on QEMUFile's automaticdrop of I/O after an error, because it does its "real" I/O outsidethe put_buffer callback. To fix this until buffering is gone, expose...
migration: simplify error handling
Always use qemu_file_get_error to detect errors, since that is howQEMUFile itself drops I/O after an error occurs. There is no needto propagate and check return values all the time.
Also remove the "complete" member, since we know that it is set (via...
migration: cleanup migration (including thread) in the iothread
Perform final cleanup in a bottom half, and add joining the thread tothe series of cleanup actions.
migrate_fd_error remains for connection error, but it doesn't needto cleanup anything anymore....
block-migration: add lock
Some state is shared between the block migration code and its AIOcallbacks. Once block migration will run outside the iothread,the block migration code and the AIO callbacks will be able torun concurrently. Protect the critical sections with a separate...
migration: reorder SaveVMHandlers members
This groups together the callbacks that later will have similarlocking rules.
migration: run pending/iterate callbacks out of big lock
This makes it possible to do blocking writes directly to the socket,with no buffer in the middle. For RAM, only the migration_bitmap_sync()call needs the iothread lock. For block migration, it is needed by...
migration: run setup callbacks out of big lock
Only the migration_bitmap_sync() call needs the iothread lock.
Merge remote-tracking branch 'origin/master' into staging
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
tcg: Don't make exitreq flag a local temporary
The value is not actually live across basic blocks, so there's noneed for the local property. This eliminates storing the temporaryto its home location at the branch.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
qemu-char: add watch support
This allows a front-end to request for a callback when the backendis writable again.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 96f93c0f741064604bbb6389ce962191120af8b7.1362505276.git.amit.shah@redhat.com...
qemu-char: remove use of QEMUTimer in favor of glib idle function
qemu-char is now independent of the QEMU main loop.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 3cda0bbcfb94912df8a767983a52bb71a4a3231d.1362505276.git.amit.shah@redhat.com...
qemu-char: make char drivers dynamically registerable
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 0ff4f5f2b8b7afdb85a0c241403ad73f472f0b81.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'stefanha/block' into staging
Merge remote-tracking branch 'stefanha/net' into staging
move socket_set_nodelay to osdep.c
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
gen-icount.h: Rename gen_icount_start/end to gen_tb_start/end
The gen_icount_start/end functions are now somewhat misnamed since theyare useful for generic "start/end of TB" code, used for more than justicount. Rename them to gen_tb_start/end.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
Handle CPU interrupts by inline checking of a flag
Fix some of the nasty TCG race conditions and crashes by implementingcpu_exit() as setting a flag which is checked at the start of each TB.This avoids crashes if a thread or signal handler calls cpu_exit()...
tcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses
Document tcg_qemu_tb_exec(). In particular, its return value is acombination of a pointer to the next translation block and someextra information in the low two bits. Provide some #defines for...
hw: move qdev-monitor.o to toplevel directory
qdev-monitor.c is the only "core qdev" file that is not used inuser-mode emulation, and it does not define anything that is usedby hardware models. Remove it from the hw/ directory andremove hw/qdev-monitor.h from hw/qdev.h too; this requires...
hw: move fifo.[ch] to libqemuutil
fifo.c is generic code that can be easily unit tested. So itbelongs in libqemuutil.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: move char backends to backends/
Braille and msmouse support is in hw/, but it is not hardware.Move it to the backends/ directory.
net: reduce the unnecessary memory allocation of multiqueue
Edivaldo reports a problem that the array of NetClientState in NICState is toolarge - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is notused.
Instead of static arrays, solving this issue by allocating the queues on demand...
glib: Add compat wrapper for g_poll on old glib
Older glib doesn't implement g_poll(). Most notably the glib version in useon SLE11 is on 2.18 which is hit by this.
We do want to use g_poll() in the source however. So on older systems, justwrap it with functions that do exist on older versions....
qemu-log: default to stderr for logging output
Switch the default for qemu_log logging output from "/tmp/qemu.log" to stderr. This is an incompatible change in some sense, but loggingis mostly used for debugging purposes so it shouldn't affect production...
Merge remote-tracking branch 'quintela/stats.next' into staging
Replace all setjmp()/longjmp() with sigsetjmp()/siglongjmp()
The setjmp() function doesn't specify whether signal masks are saved andrestored; on Linux they are not, but on BSD (including MacOSX) they are.We want to have consistent behaviour across platforms, so we should...
qemu-log: Remove qemu_log_try_set_file() and its users
Remove the function qemu_log_try_set_file() and its users (whichare all in TCG code generation functions for various targets).This function was added to abstract out code which was originallywritten as "if (!logfile) logfile = stderr;" in order that BUG:...
block: implement BDRV_O_UNMAP
It is better to present homogeneous hardware independent of the storagetechnology that is chosen on the host, hence we make discard a hostparameter; the user can choose whether to pass it down to the imageformat and protocol, or to ignore it....
qemu-img: add compressed clusters to BlockFragInfo
Show how many clusters are compressed. This can be used to monitor howmany compressed clusters remain and whether to recompress the image.
Suggested-by: Cole Robinson <crobinso@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: Add synchronous wrapper for bdrv_co_is_allocated_above
There's no synchronous wrapper for bdrv_co_is_allocated_above functionso it's not possible to check for sector allocation in an image witha backing file.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>...
qemu-img: Add "Quiet mode" option
There can be a need to turn output to stdout off. This patch adds a -q optionthat enable "Quiet mode". In Quiet mode, only errors are printed out.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>...
qemu-img: find the image end offset during check
This patch adds the support for reporting the image end offset (inbytes). This is particularly useful after a conversion (or a rebase)where the destination is a block device in order to find the firstunused byte at the end of the image....
migration: calculate expected_downtime
We removed the calculation in commit e4ed1541ac9413eac494a03532e34beaf8a7d1c5
Now we add it back. We need to create dirty_bytes_rate because wecan't include cpu-all.h from migration.c, and there is no other way to...
console: allow VCs to be overridden by UI
We want to expose VCs using a VteTerminal widget. We need access to provide ourown CharDriverState in order to do this.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1361367806-4599-3-git-send-email-aliguori@us.ibm.com
ui: add basic GTK gui (v5)
This is minimalistic and just contains the basic widget infrastructure. The GUIconsists of a menu and a GtkNotebook. To start with, the notebook has its tabshidden which provides a UI that looks very similar to SDL with the exception of...
vga: fix byteswapping.
In case host and guest endianness differ the vga code first createsa shared surface (using qemu_create_displaysurface_from), then goespatch the surface format to indicate that the bytes must be swapped.
The switch to pixman broke that hack as the format patching isn't...