History | View | Annotate | Download (12.8 kB)
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....
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...
qiov: prevent double free or use-after-free
qemu_iovec_destroy does not clear the QEMUIOVector fully, and the datacould thus be used after free or freed again. While I do not know anyexample in the tree, I observed this using virtio-scsi (and SCSIscatter/gather) when canceling DMA requests....
cutils: Drop broken support for zero strtosz default_suffix
Commit 9f9b17a4's strtosz() defaults a missing suffix to 'M', exceptit rejects fractions then (switch case 0).
When commit d8427002 introduced strtosz_suffix(), that changed:fractions are no longer rejected, because we go to switch case 'M' on...
cutils: Make strtosz & friends leave follow set to callers
strtosz() & friends require the size to be at the end of the string,or be followed by whitespace or ','. I find this surprising, becausethe name suggests it works like strtol().
The check simplifies callers that accept exactly that follow set...
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>...
Fix up some style nits of last uq/master merge
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.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....
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...
strtosz() use qemu_toupper() to simplify switch statement
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
strtosz(): Fix name confusion in use of modf()
strtosz(): Use suffix macros in switch() statement
strtosz(): use unsigned char and switch to qemu_isspace()
isspace() behavior is undefined for signed char.
Bug pointed out by Eric Blake, thanks!
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
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.
Signed-off-by: Jes Sorensen <Jes.Sorensen@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...
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>
split out qemu-timer.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Probe for fdatasync()
Signed-off-by: Blue Swirl <blauwirbel@gmail.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...
Revert "support colon in filenames"
This reverts commit 707c0dbc97cddfe8d2441b8259c6c526d99f2dd8.
Fix missing strnlen problems
Fix missing strnlen (a GNU extension) problems by using qemu_strnlenused for user emulators also for system emulators.
support colon in filenames
Problem: It is impossible to feed filenames with the character colon becauseqemu interprets such names as a protocol. For example filename scsi:0, isinterpreted as a protocol by name "scsi".
This patch allows user to espace colon characters. For example the above...
Include assert.h from qemu-common.h
Include assert.h from qemu-common.h and remove other direct uses.cpu-all.h still need to include it because of the dyngen-exec.h hacks
Signed-off-by: Paul Brook <paul@codesourcery.com>
add qemu_iovec_init_external (Christoph Hellwig)
Allow to initialize a QEMUIOVector from an externally allocated iovec.qiov->nalloc is initialized to 1 to indicate external storage for qiov>iovand all functions dealing with memory management assert on the iovec beeing...
Add qemu_iovec_reset() (Avi Kivity)
Add a helper to zero out an existing iovec. Removes the need to deallocateand reallocate it.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6523 c046a42c-6fe2-441c-8c8c-71466251a162
qemu iovec: keep track of total size, allow partial copies (Gerd Hoffman)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6448 c046a42c-6fe2-441c-8c8c-71466251a162
I/O vector helpers (Avi Kivity)
In general, it is not possible to predict the size of of an I/O vector sincea contiguous guest region may map to a disconiguous host region. Add somehelpers to manage I/O vector growth.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Rename fls to qemu_fls
Fix compiler warning on OSX, reported by Andreas Faerber.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5982 c046a42c-6fe2-441c-8c8c-71466251a162
Define fls() in terms of clz32().
As suggested by Laurent Desnogues.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5872 c046a42c-6fe2-441c-8c8c-71466251a162
Introduce fls() helper
This is needed for virtio. The implementation is originally fromMarcelo Tosatti.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5868 c046a42c-6fe2-441c-8c8c-71466251a162
Attached patch fixes a series of this warningwhen compiling on NetBSD:
warning: array subscript has type 'char'
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5727 c046a42c-6fe2-441c-8c8c-71466251a162
Revert r5532, r5536 and a piece of r5531.
The use of strncat and strndup was correct, pstrcpy and pstrdup wasn't.I'll try to restore building on non-gnu OSes in a later commit.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5651 c046a42c-6fe2-441c-8c8c-71466251a162
Replace uses of strndup (a GNU extension) with Qemu pstrdup
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5532 c046a42c-6fe2-441c-8c8c-71466251a162
Prevent guest reusing host memory allocations.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4710 c046a42c-6fe2-441c-8c8c-71466251a162
Remove osdep.c/qemu-img code duplication
(Kevin Wolf)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4191 c046a42c-6fe2-441c-8c8c-71466251a162
Split block API from vl.h.Remove QEMU_TOOL. Replace with QEMU_IMG and NEED_CPU_H.Avoid linking qemu-img against whole system emulatior.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3578 c046a42c-6fe2-441c-8c8c-71466251a162
always use mktimegm
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3570 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
added cutils.c
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2310 c046a42c-6fe2-441c-8c8c-71466251a162