pixman: add qemu_pixman_color()
Helper function to map qemu colors (32bit integer + matching PixelFormat)into pixman_color_t.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
pixman: render vgafont glyphs into pixman images
Add helper functions to create pixman mask images for glyphsand to render these glyphs into a pixman image.
console: displaystate init revamp
We have only one DisplayState, so there is no need for the "next" linking, rip it. Also consolidate all displaystate initializationinto init_displaystate(). This function is called by vl.c aftercreating the devices (and thus all QemuConsoles) and before...
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
qdev: Fix QOM unrealize behavior
Since commit 249d41720b7dfbb5951b430b9eefdbee7464f515 (qdev: Prepare"realized" property) setting realized = true would register the device'sVMStateDescription, but realized = false would not unregister it. Fix that.
Moving the code from unparenting also revealed that we were calling...
memory: move core typedefs to qemu/typedefs.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec: remove useless declarations from memory-internal.h
tpm: reorganize headers and split hardware part
The TPM subsystem does not have a full front-end/back-end separation.The sole available backend, tpm_passthrough, depends on the datastructures of the sole available frontend, tpm_tis.
However, we can at least try to split the user interface (tpm.c) from the...
sysemu: avoid proliferation of include/ subdirectories
virtio-serial: cleanup: use QOM casts.
As the virtio-serial-pci and virtio-serial-s390 are switched to the newAPI, we can use QOM casts.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
virtio-serial: cleanup: remove qdev field.
The qdev field is no longer needed, just drop it.
acpi.h: make it self contained
Headers shouldn't assume another header is included,pull in everything necessary.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 20130415081250.GA7374@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio: fix broken aliases.
This fix the broken aliases, by renaming the devices.
So: * virtio-blk => virtio-blk-device. * virtio-balloon => virtio-balloon-device. * virtio-scsi => virtio-scsi-device.
All virtio-*-pci, virtio-*-s390, virtio-*-ccw didn't change....
virtio-serial: add the virtio-serial device.
Create virtio-serial which extends virtio-device, so it can be connectedon virtio-bus.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
acpi: move declarations from pc.h to acpi.h
Functions defined in acpi/ should be declared inacpi.h
arm: fix location of some include files
The recent rearrangement of include files had some minor errors: devices.h is not ARM specific and should not be in arm/ arm.h should be in arm/
Move these two headers to correct this.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
block: Introduce bdrv_writev_vmstate
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
savevm: Implement block_writev_buffer()
Instead of breaking up RAM state into many small chunks, pass the iovecto the block layer for better performance.
block: Introduce bdrv_pwritev() for qcow2_save_vmstate
Directly pass the QEMUIOVector on instead of linearising it.
unicode: New mod_utf8_codepoint()
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
aes: move aes.h from include/block to include/qemu
Move aes.h from include/block to include/qemu to show it can be reusedby other subsystems.
Cc: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
aes: make Td[0-5] and Te[0-5] tables non static
Remove static attribute to Td[0-5] and Te[0-5] tables so that theycan be used outside of aes.c. Change their type from u32 to uint32_t,to keep the u32 udef local to aes.c. Prefix them with AES_ so that they...
sh7750: Change cpu field type to SuperHCPU
This brings us a step closer to QOM'ified SH7750 SoC andfixes b350ab75 (target-sh4: Move PVR/PRR/CVR into SuperHCPUClass)assuming SuperHCPU type for SUPERH_CPU_GET_CLASS().
Fix Coding Style issues while at it (indentation, braces)....
hw: move timer devices to hw/timer/, configure with default-configs/
hw: move PCI bridges to hw/pci-* or hw/ARCH
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.
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.