summaryrefslogtreecommitdiffstats
path: root/qemu-common.h
Commit message (Collapse)AuthorAgeFilesLines
* Make strtosz() return int64_t instead of ssize_tJes Sorensen2011-01-241-2/+2
| | | | | | | | | strtosz() needs to return a 64 bit type even on 32 bit architectures. Otherwise qemu-img will fail to create disk images >= 2GB Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Delete useless 'extern' qualifiers for functionsBlue Swirl2011-01-231-1/+1
| | | | | | | 'extern' qualifier is useless for function declarations. Delete them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge branch 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemuAurelien Jarno2010-12-271-0/+3
|\ | | | | | | | | | | | | | | | | | | | | * 'spice.v23.pull' of git://anongit.freedesktop.org/spice/qemu: vnc/spice: add set_passwd monitor command. vnc: support password expire vnc: auth reject cleanup spice: add qmp 'query-spice' and hmp 'info spice' commands. spice: connection events. spice: add qxl device spice: add qxl vgabios binary.
| * vnc: support password expireGerd Hoffmann2010-12-091-0/+3
| | | | | | | | | | | | | | | | This patch adds support for expiring passwords to vnc. It adds a new vnc_display_pw_expire() function which specifies the time when the password will expire. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Introduce strtosz_suffix()Jes Sorensen2010-12-171-0/+7
|/ | | | | | | | | | | | This introduces strtosz_suffix() which allows the caller to specify a default suffix in case the non default of MB is wanted. strtosz() is kept as a wrapper for strtosz_suffix() which keeps it's current default of MB. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* pcie/aer: helper functions for pcie aer capabilityIsaku Yamahata2010-11-221-0/+3
| | | | | | | | This patch implements helper functions for pcie aer capability which 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.Jes Sorensen2010-11-031-0/+1
| | | | | | | | | | | | | | | | | strtosz() returns -1 on error. It now supports human unit formats in eg. 1.0G, with better error handling. The following suffixes are supported: B/b = bytes K/k = KB M/m = MB G/g = GB T/t = TB This patch changes -numa and -m input to use strtosz(). Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori2010-11-011-0/+4
|\
| * Merge branch 'pci' into for_anthonyMichael S. Tsirkin2010-10-271-0/+4
| |\
| | * pcie port: define struct PCIEPort/PCIESlot and helper functionsIsaku Yamahata2010-10-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | define struct PCIEPort which represents common part of pci express port.(root, upstream and downstream.) add a helper function for pcie port which can be used commonly by root/upstream/downstream port. define struct PCIESlot which represents common part of pcie slot.(root and downstream.) and helper functions for it. helper functions for chassis, slot -> PCIESlot conversion. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| | * pcie: helper functions for pcie capability and extended capabilityIsaku Yamahata2010-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements helper functions for pci express capability and pci express extended capability allocation. NOTE: presence detection depends on pci_qdev_init() change. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| | * pci_bridge: introduce pci bridge library.Isaku Yamahata2010-09-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | | Consolidate oom_check() functionsJes Sorensen2010-10-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This consolidates the duplicated oom_check() functions, as well as splitting them into OS dependant versions to avoid the #ifdef grossness that was present in the old osdep.c version. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | Move qemu_gettimeofday() to OS specific filesJes Sorensen2010-10-301-0/+5
| | | | | | | | | | | | | | | 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 functionsStefan Weil2010-10-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This kind of function pointers is used very often in qemu. The new data type uses format checking with GCC_FMT_ATTR and will be used in later patches. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | Mov muldiv64 to qemu-common.h (Thus unbreaking gus)malc2010-10-301-0/+24
|/ / | | | | | | Signed-off-by: malc <av1474@comtv.ru>
* | qemu-timer: move commonly used timer code to qemu-timer-commonBlue Swirl2010-10-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move timer init functions to a new file, qemu-timer-common.c. Make other critical timer functions inlined to preserve performance in qemu-timer.c, also move muldiv64() (used by the inline functions) to qemu-timer.h. Adjust block/raw-posix.c and simpletrace.c to use get_clock() directly. Remove a similar/duplicate definition in qemu-tool.c. Adjust hw/omap_clk.c to include qemu-timer.h because muldiv64() is used there. After this change, tracing can be used also for user code and simpletrace on Win32. Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Remove special handling of system include files (no longer needed)Stefan Weil2010-10-221-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The formerly used dyngen code did not work with system include files like stdio.h. Tests with Linux, OSX and Win32 show that this restriction is no longer needed. So we hopefully can remove that special piece of code. This results in cleaner code and allows better use of the new GCC_FMT_ATTR macro. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil2010-10-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)) because QEMU always uses standard format strings (even with mingw32). The patch replaces format attribute printf / __printf__ by macro GCC_FMT_ATTR which uses gnu_printf if supported. It also removes an #ifdef __GNUC__ (not needed any longer). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Move macros GCC_ATTR and GCC_FMT_ATTR to common header fileStefan Weil2010-09-221-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By moving the definition of GCC_ATTR and GCC_FMT_ATTR from audio_int.h to qemu-common.h these macros are now generally available for further patches which add the gcc format attribute. Newer gcc versions support format gnu_printf which is better suited for use in QEMU than format printf (QEMU always uses standard format strings (even with mingw32)). V2: Use correct operator '==' (instead of '=') Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | cutils: qemu_iovec_copy and qemu_iovec_memsetKevin Wolf2010-09-211-0/+3
| | | | | | | | | | | | | | This adds two functions that work on QEMUIOVectors and will be used by the next qcow2 patches. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Rearrange block headersBlue Swirl2010-08-241-0/+7
|/ | | | | | | | | Changing block.h or blockdev.h resulted in recompiling most objects. Move DriveInfo typedef and BlockInterfaceType enum definitions to qemu-common.h and rearrange blockdev.h use to decrease churn. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* apic: qdev conversion cleanupBlue Swirl2010-06-191-1/+1
| | | | | | | | | Make APICState completely private to apic.c by using DeviceState in external APIs. Move apic_init() to pc.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* cow: stop using mmapChristoph Hellwig2010-06-151-3/+0
| | | | | | | | | | | | | We don't have an equivalent to mmap in the qemu block API, so read and write the bitmap directly. At least in the dumb implementation added in this patch this is a lot less efficient, but it means cow can also work on windows, and over nbd or curl. And it fixes qemu-iotests testcase 012 which did not work properly due to issues with read-only mmap access. In addition we can also get rid of the now unused get_mmap_addr function. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Move stdbool.hPaul Brook2010-06-131-0/+1
| | | | | | | Move inclusion of stdbool.h to common header files, instead of including in an ad-hoc manner. Signed-off-by: Paul Brook <paul@codesourcery.com>
* port qemu-kvm's on_vcpu codeMarcelo Tosatti2010-05-111-0/+8
| | | | | | | 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>
* virtio: move typedef to qemu-commonMichael S. Tsirkin2010-04-011-0/+1
| | | | | | | | 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>
* notifier: event notifier implementationMichael S. Tsirkin2010-04-011-0/+1
| | | | | | | | | | | | | event notifiers are slightly generalized eventfd descriptors. Current implementation depends on eventfd because vhost is the only user, and vhost depends on eventfd anyway, but a stub is provided for non-eventfd case. We'll be able to further generalize this when another user comes along and we see how to best do this. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Compile qemu-timer only onceBlue Swirl2010-03-291-4/+4
| | | | | | | | | Arrange various declarations so that also non-CPU code can access them, adjust users. Move CPU specific code to cpus.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move cpu_exec_init_all() declaration to qemu-common.hBlue Swirl2010-03-291-0/+2
| | | | | | Let cpu_exec_init_all() be called from non-CPU code. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* rename IOCanRWHandler to IOCanReadHandlerJuan Quintela2010-03-191-1/+1
| | | | | | | 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.cPaolo Bonzini2010-03-171-0/+1
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'qemu-kvm/uq/master' into stagingAnthony Liguori2010-02-221-0/+1
|\
| * use eventfd for iothreadPaolo Bonzini2010-02-171-0/+1
| | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* | Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori2010-02-191-0/+2
|\ \
| * | pci: move pcibus_t to qemu-commonMichael S. Tsirkin2010-02-141-0/+2
| |/ | | | | | | | | | | move pcibus_t to qemu-common.h to simplify header dependencies. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | get rid of hostregs_helper.hPaolo Bonzini2010-02-181-0/+2
|/ | | | | | | | | Since b567b38 (target-arm: remove T0 and T1, 2009-10-16) the only global register that is used is AREG0, so the complexity of hostregs_helper.h is unused. Use regular assignments and a compiler optimization barrier. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* block: avoid creating too large iovecs in multiwrite_mergeChristoph Hellwig2010-01-261-0/+4
| | | | | | | | | | | | | If we go over the maximum number of iovecs support by syscall we get back 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 the same 1024 define that's used on Linux and various other platforms, but until the windows block backend implements some kind of vectored I/O it doesn't matter. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* force to test result for qemu_write_full()Juan Quintela2010-01-261-1/+2
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce qemu_write_full()Kirill A. Shutemov2010-01-261-0/+1
| | | | | | | | 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>
* Fix QEMU_WARN_UNUSED_RESULTKevin Wolf2010-01-191-1/+2
| | | | | | | | | | | | Since commit 747bbdf7 QEMU_WARN_UNUSED_RESULT is never defined as it is conditional 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 results. These calls are changed to qdev_init_nofail to avoid build failures. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Don't leak file descriptorsKevin Wolf2009-12-031-0/+7
| | | | | | | | We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors 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.Isaku Yamahata2009-12-011-0/+2
| | | | | | | | | This patch moves two typedefs, PCIHostState and PCIExpressHost to qemu-common.h for consistency as PCIBus and PCIDevice are typedefed in qemu-common.h. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* BCD cleanupPaul Brook2009-11-221-0/+11
| | | | | | Combine multiple BCD implementations. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Introduce contexts for asynchronous callbacksKevin Wolf2009-10-271-0/+4
| | | | | | | | | Add the possibility to use AIO and BHs without allowing foreign callbacks to be run. Basically, you put your own AIOs and BHs in a separate context. For details see the comments in the source. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Split out bottom halvesKevin Wolf2009-10-271-0/+1
| | | | | | | | Instead of putting more and more stuff into vl.c, let's have the generic functions that deal with asynchronous callbacks in their own file. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: add macaddr type.Gerd Hoffmann2009-10-271-0/+1
| | | | | | | | | | Add new type for mac addresses. Add function which sets the qemu default mac address if it finds the mac address 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 directiveBlue Swirl2009-10-181-0/+5
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* net: refactor packet queueing codeMark McLoughlin2009-10-151-0/+1
| | | | | | | | | | The packet queue code is fairly standalone, has some complex details and easily reusable. It makes sense to split it out on its own. This patch doesn't contain any functional changes. Patchworks-ID: 35511 Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* unlock iothread mutex before running kvm ioctlGlauber Costa2009-10-121-0/+3
| | | | | | | | | 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: 35359 Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud