hw: move timer devices to hw/timer/, configure with default-configs/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
Merge branch 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-arm
Merge remote-tracking branch 'kwolf/for-anthony' into staging
block: fix I/O throttling accounting blind spot
I/O throttling relies on bdrv_acct_done() which is called when a requestcompletes. This leaves a blind spot since we only charge for completedrequests, not submitted requests.
For example, if there is 1 operation remaining in this time slice the...
block: keep I/O throttling slice time constant
It is not necessary to adjust the slice time at runtime. We alreadyextend the current slice in order to carry over accounting into the nextslice. Changing the actual slice time value introduces oscillations....
vmstate: Add support for two dimensional arrays
Add support for migrating two dimensional arrays, by defininga set of new macros VMSTATE_*_2DARRAY paralleling the existingVMSTATE_*_ARRAY macros. 2D arrays are handled the same for actualstate serialization; the only difference is that the type check...
vmstate.h: introduce VMSTATE_BUFFER_POINTER_UNSAFE macro
Macro could be used to migrate a dynamically allocated buffer of known size.
Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1362923278-4080-2-git-send-email-i.mitsyanko@gmail.com...
qstring: add qstring_get_length()
Long overdue.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Allow clock_gettime() monotonic clock to be utilized on more OS's
Allow the clock_gettime() code using monotonic clock to be utilized onmore POSIX compliannt OS's. This started as a fix for OpenBSD which waslisted in one function as part of the previous hard coded list of OS's...
acpi_table_add(): accept QemuOpts and parse it with OptsVisitor
As one consequence, strtok() -- which modifies its argument -- is replacedwith g_strsplit().
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
qemu-char: Add qemu_chr_fe_claim / _release helper functions
Add qemu_chr_fe_claim / _release helper functions for properly dealing withavail_connections.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364412581-3672-2-git-send-email-hdegoede@redhat.com...
Merge remote-tracking branch 'luiz/queue/qmp' into staging
oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()
The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.Rename to qemu_set_nonblock() just like qemu_set_cloexec().
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
QOM-ify the TPM support
QOM-ified the TPM support with much code borrowed from the rng implementation.
All other TPM related code moves will be provided in a subsequent patch.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>Message-id: 1364469981.24703.1.camel@d941e-10...
qemu-char: Rename qemu_chr_generic_open to qemu_chr_be_generic_open
To better reflect that it is for handling a backend being opened.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-3-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Add fe_open tracking
Add tracking of the fe_open state to struct CharDriverState.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-4-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Automatically do fe_open / fe_close on qemu_chr_add_handlers
Most frontends can't really determine if the guest actually has the frontendside open. So lets automatically generate fe_open / fe_close as soon as afrontend becomes ready (as signalled by calling qemu_chr_add_handlers) /...
qemu-char: Cleanup: consolidate fe_open/fe_close into fe_set_open
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-6-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Consolidate guest_close/guest_open into a set_fe_open callback
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-7-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Rename opened to be_open
Rename the opened variable to be_open to reflect that it contains theopened state of the backend.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-2-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
compiler: fix warning with GCC 4.8.0
GCC 4.8.0 introduces a new warning:
block/qcow2-snapshot.c: In function 'qcow2_write_snapshots’: block/qcow2-snapshot.c:252:18: error: typedef 'qemu_build_bug_on__253' locally defined but not used [-Werror=unused-local-typedefs]...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
virtio,pci,qom
Work by Alex to support VGA assignment,pci and virtio fixes by Stefan, Jason and myself, and anew qmp event for hotplug support by myself.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
Merge remote-tracking branch 'quintela/migration.next' into staging
char: introduce a blocking version of qemu_chr_fe_write
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration: do not sent zero pages in bulk stage
during bulk stage of ram migration if a page is azero page do not send it at all.the memory at the destination reads as zero anyway.
even if there is an madvise with QEMU_MADV_DONTNEEDat the target upon receipt of a zero page I have observed...
Add QemuFileWritevBuffer QemuFileOps
This will allow us to write an iovec
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
Add qemu_put_buffer_async
This allows us to add a buffer to the iovec to send without copying itinto the static buffer, the buffer will be sent later when qemu_fflush is called.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
cutils: add a function to find non-zero content in a buffer
this adds buffer_find_nonzero_offset() which is a SSE2/Altivecoptimized function that searches for non-zero content in abuffer.
the function starts full unrolling only after the first few chunks have...
savevm: Add VMSTATE_UINTTL_EQUAL helper
This adds an _EQUAL VMSTATE helper for target_ulongs, defined in terms ofVMSTATE_UINT32_EQUAL or VMSTATE_UINT64_EQUAL as appropriate.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Juan Quintela <quintela@redhat.com>
savevm: Add VMSTATE_FLOAT64 helpers
The current savevm code includes VMSTATE helpers for a number of commonlyused data types, but not for the float64 type used by the internal floatingpoint emulation code. This patch fixes the deficiency.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32
Currently the savevm code contains a VMSTATE_STRUCT_VARRAY_POINTER_INT32helper (a variably sized array with the number of elements in an int32_t),but not VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (... with the number of...
savevm: Fix bugs in the VMSTATE_VBUFFER_MULTIPLY definition
The VMSTATE_BUFFER_MULTIPLY macro is misnamed - it actually specifiesa variably sized buffer with VMS_VBUFFER, so should be namedVMSTATE_VBUFFER_MULTIPLY. This patch fixes this (the macro had no current...
move vector definitions to qemu-common.h
vector optimizations will now be used at various placesnot just in is_dup_page() in arch_init.c
Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Juan Quintela <quintela@redhat.com>
savevm: Add VMSTATE_UINT64_EQUAL helpers
The savevm code already includes a number of *_EQUAL helpers which act assanity checks verifying that the configuration of the saved state matchesthat of the machine we're loading into to work. Variants already exist...
Merge remote-tracking branch 'stefanha/net' into staging
glib: add a compatibility interface for g_timeout_add_seconds
net: increase buffer size to accommodate Jumbo frame pkts
Socket buffer sizes were hard-coded to 4K for VDE and socket netdevs. Bump thisup to 68K (ala tap netdev) to handle maximum GSO packet size (64k) plus plentyof room for the ethernet and virtio_net headers....
net: iovec checksum calculator
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>Signed-off-by: Yan Vugenfirer <yan@daynix.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Common definitions for VMWARE devices
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
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...
qdev: DEVICE_DELETED event
libvirt has a long-standing bug: when removing the device,it can request removal but does not know when theremoval completes. Add an event so we can fix this in a robust way.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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: 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
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: 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;...