History | View | Annotate | Download (11.2 kB)
w64: Don't redefine lseek, ftruncate
MinGW-w64 already defines lseek and ftruncate (and uses the 64 bitvariants). The conditional compilation avoids redefinitions(which would be wrong) and compiler warnings.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
Move definition of HOST_LONG_BITS to qemu-common.h
Like the related macro TCG_TARGET_LONG, HOST_LONG_BITS can be determinedby the C preprocessor. It is also not used in Makefiles.
So there is no need to calculate it in configure, and it can be definedin qemu-common.h....
cutils: extract buffer_is_zero() from qemu-img.c
The qemu-img.c:is_not_zero() function checks if a buffer contains allzeroes. This function will come in handy for zero-detection in theblock layer, so clean it up and move it to cutils.c.
Note that the function now returns true if the buffer is all zeroes....
qdev: remove print/parse methods from LostTickPolicy properties
Also generalize the code so that we can have more enum propertiesin the future.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qdev: Introduce lost tick policy property
Potentially tick-generating timer devices will gain a common property:lock_tick_policy. It allows to encode 4 different ways how to deal withtick events the guest did not process in time:
discard - ignore lost ticks (e.g. if the guest compensates for them...
sheepdog: move coroutine send/recv function to generic code
Outside coroutines, avoid busy waiting on EAGAIN by temporarilymaking the socket blocking.
The API of qemu_recvv/qemu_sendv is slightly different fromdo_readv/do_writev because they do not handle coroutines. It...
add qemu_send_full and qemu_recv_full
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() functions
NULL is a valid bus/device, so there is no change in behaviour.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-common: add QEMU_ALIGN_DOWN() and QEMU_ALIGN_UP() macros
Add macros for aligning a number to a multiple, for example:
QEMU_ALIGN_DOWN(500, 2000) = 0QEMU_ALIGN_UP(500, 2000) = 2000
Since ALIGN_UP() is a common macro name use the QEMU_* namespace prefix....
Move filedescriptor parsing code from net.c into qemu_parse_fd()
Move the parsing of a filedescriptor into a common functionqemu_parse_fd() so others can use it as well. Have net.c call thisfunction.
v2: - moving qemu_parse_fd into cutils.c
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>...
qemu-timer: move icount to cpus.c
None of this is needed by tools, and most of it can even be made staticinside cpus.c.
main-loop: create main-loop.h
main-loop: create main-loop.c
core: remove qemu_service_io
qemu_service_io was mainly an alias to qemu_notify_event,currently used only by PPC for timer hack, so callqemu_notify_event directly.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove qemu_malloc/qemu_free
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Make glib mandatory and fixup utils appropriately
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Avoid allocating TCG resources in non-TCG mode
Do not allocate TCG-only resources like the translation buffer whenrunning over KVM or XEN. Saves a "few" bytes in the qemu address spaceand is also conceptually cleaner.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
qemu: Add strtosz_suffix_unit function
This function does the same as the strtosz_suffix functionexcept that it allows to specify the unit to which thek/M/B/T suffixes apply. This function will be used later toparse the tsc-frequency from the command-line....
Merge remote-tracking branch 'kraxel/usb.22' into staging
move QEMUSGList typedef
Move the QEMUSGList typedef to qemu-common so it can easily be used.The actual struct definition stays in dma.h.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
async: Remove AsyncContext
The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancyduring an emulated bdrv_read/write (which includes a qemu_aio_wait() call andcan run AIO callbacks of different requests if it weren't for AsyncContexts)....
move WORDS_ALIGNED to qemu-common.h
This is not a CPU interface, and a configure test would not be tooprecise. So just add it to qemu-common.h.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Wrap recv to avoid warnings
Avoid warnings like these by wrapping recv(): CC slirp/ip_icmp.o/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]...
Introduce compiler.h header file
This moves compiler related macros from qemu-common.h to compiler.h.
The reason for this change is that there are simple header files thatdepend only on the compiler macros, so including qemu-common.h is overkill.
Besides, qemu-common.h is bloated and will benefit from some splitting....
Remove unneeded setjmp.h (fix compilation on Debian "lenny")
Some versions of png.h cannot be included after setjmp.h,even when PNG_SKIP_SETJMP_CHECK was defined.
setjmp.h was included from qemu-common.h and is not needed there.Removing the include statement fixes compilation of ui/vnc-enc-tight.c...
w32: Remove redundant definitions of PRI*64
The PRI*64 macros are defined in MinGW's inttypes.h since 2002,so they are not needed in qemu-common.h (which includes inttypes.h).
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
cocoa: Provide central qemu_main() prototype
This fixes a missing prototype warning in vl.c and obsoletesthe prototype in cocoa.m. Adjust callers in cocoa.m to supplythird argument, which is currently only used on Linux/ppc.
The prototype is designed so that it could be shared with SDL...
Fix compilation warning due to missing header for sigaction
Fix the following warning by including signal.h directly in qemu-common.h----8<----iohandler.c: In function ‘qemu_init_child_watch’:iohandler.c:172: warning: implicit declaration of function ‘sigaction’...
Add documentation for qemu_progress_{init,print}()
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
w32: Fix missing declaration of ffs()
target-ppc/cpu.h now needs ffs(), too, so ffs() must be declaredbefore this file is included.
Moving the declaration from qemu-common.h to qemu-os-win32.h(which is included in qemu-common.h early) fixes the compiler...
Move generic or OS function declarations to qemu-common.h
Move generic or OS related function declarations and macroTFR to qemu-common.h.
Move win32 include directives to qemu-os-win32.h. While moving,also add #include <winsock2.h> to fix a recent mingw32...
enable vm_clock to "warp" in the iothread+icount case
The previous patch however is not enough, because if the virtual CPUgoes to sleep waiting for a future timer interrupt to wake it up, qemudeadlocks. The timer interrupt never comes because time is driven by...
qemu-img: Initial progress printing support
This adds the basic infrastructure for supporting progress outputon the command line, as well as progress support for qemu-img commands'rebase' and 'convert'.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
add a service to reap zombies, use it in SLIRP
SLIRP -smb support wants to fork a process and forget about reaping it.To please it, add a generic service to register a process id and letQEMU reap it. In the future it could be enhanced to pass a status,...
extract I/O handler lists to iohandler.c
x86: Refine error reporting of MCE injection services
As this service is used by the human monitor, make sure that errors getreported to the right channel, and also raise the verbosity.
This requires to move Monitor typedef in qemu-common.h to resolve the...
Refactor thread retrieval and check
We have qemu_cpu_self and qemu_thread_self. The latter is retrieving thecurrent thread, the former is checking for equality (using CPUState). Wealso have qemu_thread_equal which is only used like qemu_cpu_self.
This refactors the interfaces, creating qemu_cpu_is_self and...
WIN32: Add missing include for 'struct timeval', used in vnc.h
Signed-off-by: Herv Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote branch 'kwolf/for-anthony' into staging
Introduce VCPU self-signaling service
Introduce qemu_cpu_kick_self to send SIG_IPI to the calling VCPUcontext. First user will be kvm.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
QCOW2: bug fix - read base image beyond its size
This patch fixes the following bug in QCOW2. For a QCOW2 image that is largerthan its base image, when handling a read request straddling over the end of thebase image, the QCOW2 driver attempts to read beyond the end of the base image...
blockdev: Move BlockInterfaceType from qemu-common.h to blockdev.h
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Add documentation for STRTOSZ_DEFSUFFIX_ macros
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Acked-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Make strtosz() return int64_t instead of ssize_t
strtosz() needs to return a 64 bit type even on 32 bitarchitectures. Otherwise qemu-img will fail to create diskimages >= 2GB
Delete useless 'extern' qualifiers for functions
'extern' qualifier is useless for function declarations. Deletethem.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu
Introduce strtosz_suffix()
This introduces strtosz_suffix() which allows the caller to specify adefault suffix in case the non default of MB is wanted.
strtosz() is kept as a wrapper for strtosz_suffix() which keeps it'scurrent default of MB.
vnc: support password expire
This patch adds support for expiring passwords to vnc. It adds a newvnc_display_pw_expire() function which specifies the time when thepassword will expire.
pcie/aer: helper functions for pcie aer capability
This patch implements helper functions for pcie aer capabilitywhich will be used later.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Introduce strtosz() library function to convert a string to a byte count.
strtosz() returns -1 on error. It now supports human unit formats ineg. 1.0G, with better error handling.
The following suffixes are supported:B/b = bytesK/k = KBM/m = MBG/g = GB...
Merge remote branch 'mst/for_anthony' into staging
Consolidate oom_check() functions
This consolidates the duplicated oom_check() functions, as well assplitting them into OS dependant versions to avoid the #ifdefgrossness that was present in the old osdep.c version.
Move qemu_gettimeofday() to OS specific files
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add fprintf_function for function pointers to fprintf-like functions
This kind of function pointers is used very often in qemu.
The new data type uses format checking with GCC_FMT_ATTRand will be used in later patches.
Cc: Blue Swirl <blauwirbel@gmail.com>...
Mov muldiv64 to qemu-common.h (Thus unbreaking gus)
Signed-off-by: malc <av1474@comtv.ru>
Merge branch 'pci' into for_anthony
qemu-timer: move commonly used timer code to qemu-timer-common
Move timer init functions to a new file, qemu-timer-common.c. Make othercritical timer functions inlined to preserve performance inqemu-timer.c, also move muldiv64() (used by the inline functions)...
Remove special handling of system include files (no longer needed)
The formerly used dyngen code did not work withsystem include files like stdio.h.
Tests with Linux, OSX and Win32 show that thisrestriction is no longer needed.
So we hopefully can remove that special piece of code....
pcie port: define struct PCIEPort/PCIESlot and helper functions
define struct PCIEPort which represents common partof pci express port.(root, upstream and downstream.)add a helper function for pcie port which can be used commonly byroot/upstream/downstream port....
pcie: helper functions for pcie capability and extended capability
This patch implements helper functions for pci express capabilityand pci express extended capability allocation.NOTE: presence detection depends on pci_qdev_init() change.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)
Since version 4.4.x, gcc supports additional format attributes. attribute ((format (gnu_printf, 1, 2)))should be used instead of attribute ((format (printf, 1, 2))...
Move macros GCC_ATTR and GCC_FMT_ATTR to common header file
By moving the definition of GCC_ATTR and GCC_FMT_ATTRfrom audio_int.h to qemu-common.h these macros arenow generally available for further patches which addthe gcc format attribute.
Newer gcc versions support format gnu_printf which is...
cutils: qemu_iovec_copy and qemu_iovec_memset
This adds two functions that work on QEMUIOVectors and will be used by the nextqcow2 patches.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
pci_bridge: introduce pci bridge library.
introduce pci bridge library.convert apb bridge and dec p2p bridge to use new pci bridge library.save/restore is supported as a side effect.This is also preparation for pci express root/upstream/downstream port....
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
apic: qdev conversion cleanup
Make APICState completely private to apic.c by using DeviceStatein external APIs.
Move apic_init() to pc.c.
cow: stop using mmap
We don't have an equivalent to mmap in the qemu block API, so read andwrite the bitmap directly. At least in the dumb implementation addedin this patch this is a lot less efficient, but it means cow can alsowork on windows, and over nbd or curl. And it fixes qemu-iotests testcase...
Move stdbool.h
Move inclusion of stdbool.h to common header files, instead of includingin an ad-hoc manner.
Signed-off-by: Paul Brook <paul@codesourcery.com>
port qemu-kvm's on_vcpu code
run_on_cpu allows to execute work on a given CPUState context.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
notifier: event notifier implementation
event notifiers are slightly generalized eventfd descriptors. Currentimplementation depends on eventfd because vhost is the only user, andvhost depends on eventfd anyway, but a stub is provided for non-eventfdcase....
virtio: move typedef to qemu-common
make it possible to use type without header include,simplifying header dependencies.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Compile qemu-timer only once
Arrange various declarations so that also non-CPU code can accessthem, adjust users.
Move CPU specific code to cpus.c.
Move cpu_exec_init_all() declaration to qemu-common.h
Let cpu_exec_init_all() be called from non-CPU code.
rename IOCanRWHandler to IOCanReadHandler
It was always only used for reads
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
split out qemu-timer.c
Merge remote branch 'qemu-kvm/uq/master' into staging
get rid of hostregs_helper.h
Since b567b38 (target-arm: remove T0 and T1, 2009-10-16) the only globalregister that is used is AREG0, so the complexity of hostregs_helper.his unused. Use regular assignments and a compiler optimization barrier.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
use eventfd for iothread
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
pci: move pcibus_t to qemu-common
move pcibus_t to qemu-common.h to simplify header dependencies.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
block: avoid creating too large iovecs in multiwrite_merge
If we go over the maximum number of iovecs support by syscall we getback EINVAL from the kernel which translate to I/O errors for the guest.
Add a MAX_IOV defintion for platforms that don't have it. For now we use...
Introduce qemu_write_full()
A variant of write(2) which handles partial write.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
force to test result for qemu_write_full()
Fix QEMU_WARN_UNUSED_RESULT
Since commit 747bbdf7 QEMU_WARN_UNUSED_RESULT is never defined as it isconditional on a define from config-host.h which is included only later.Include that file earlier to get the warnings back.
Reactivating it unfortunately leads to some warnings about unused qdev_init...
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on filedescriptors that don't need to be passed to children to stop this misbehaviour.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: move typedef, PCIHostState, PCIExpressHost to qemu-common.h.
This patch moves two typedefs, PCIHostState and PCIExpressHost toqemu-common.h for consistency as PCIBus and PCIDevice are typedefedin qemu-common.h.
BCD cleanup
Combine multiple BCD implementations.
Split out bottom halves
Instead of putting more and more stuff into vl.c, let's have the genericfunctions that deal with asynchronous callbacks in their own file.
Introduce contexts for asynchronous callbacks
Add the possibility to use AIO and BHs without allowing foreign callbacks to berun. Basically, you put your own AIOs and BHs in a separate context. Fordetails see the comments in the source.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
net: add macaddr type.
Add new type for mac addresses.
Add function which sets the qemu default mac address if it finds the macaddress uninitialized (i.e. all zeros).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Suppress warnings about 'warn_unused_result' attribute directive
net: refactor packet queueing code
The packet queue code is fairly standalone, has some complex details andeasily reusable. It makes sense to split it out on its own. This patchdoesn't contain any functional changes.
Patchworks-ID: 35511Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
unlock iothread mutex before running kvm ioctl
Without this, kvm will hold the mutex while it issues its run ioctl,and never be able to step out of it, causing a deadlock.
Patchworks-ID: 35359Signed-off-by: Glauber Costa <glommer@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: use fdatasync instead of fsync if possible
If we are flushing the caches for our image files we only care about thedata (including the metadata required for accessing it) but not thingslike timestamp updates. So try to use fdatasync instead of fsync to...
Add bdrv_aio_multiwrite
One performance problem of qcow2 during the initial image growth aresequential writes that are not cluster aligned. In this case, when a firstrequests requires to allocate a new cluster but writes only to the firstcouple of sectors in that cluster, the rest of the cluster is zeroed - just...
user: compile path.c only once
Also merge bsd-user/path.c and linux-user/path.c.
Define ENOTSUP anywhere it isn't defined
I confused ENOTSUP with ENOTSUPP. Juan's original patch was correct.
define ENOTSUP the same that the other errors
aliguori: ENOTSUP is not 4096 universally, only on OpenBSD
rename HAVE_IOVEC to CONFIG_IOVEC