summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-09-21cutils: qemu_iovec_copy and qemu_iovec_memsetKevin Wolf2-9/+44
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>
2010-09-21ide: propagate the required alignmentChristoph Hellwig1-1/+3
IDE is a bit ugly in this respect. For one it doesn't really keep track of a sector size - most of the protocol is in units of 512 bytes, and we assume 2048 bytes for CDROMs which is correct most of the time. Second IDE allocates an I/O buffer long before we know if we're dealing with a CDROM or not, so increase the alignment for the io_buffer unconditionally. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21scsi-disk: propagate the required alignmentChristoph Hellwig1-0/+1
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21virtio-blk: propagate the required alignmentChristoph Hellwig1-0/+1
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Get rid of additional sync on COWKevin Wolf1-2/+8
We always have a sync for the refcount update when a new cluster is allocated. If we move this past the COW, we can save an additional sync. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Move sync out of qcow2_alloc_clustersKevin Wolf3-2/+7
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Move sync out of update_refcountKevin Wolf1-2/+11
Note that the flush is omitted intentionally in qcow2_free_clusters. If anything, we can leak clusters here if we lose the writes. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21qcow2: Move sync out of write_refcount_block_entriesKevin Wolf1-1/+3
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21nbd: correctly manage default portLaurent Vivier2-5/+3
block/nbd.c: use default port number when none is specified qemu-nbd.c: use IANA-assigned port number: 10809 Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21Improve qemu-nbd performance by 4400 %Laurent Vivier1-7/+18
This patch allows to reduce the boot time from an NBD server from 225 seconds to 5 seconds (time between the "boot cd:0" and the kernel init) for the following command lines: ./qemu-nbd -t ../ISO/debian-500-powerpc-netinst.iso and ./ppc-softmmu/qemu-system-ppc -cdrom nbd:localhost:1024 This patch combines the reply header and payload send operation. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21raw-posix: handle > 512 byte alignment correctlyChristoph Hellwig1-33/+46
Replace the hardcoded handling of 512 byte alignment with bs->buffer_alignment to handle larger sector size devices correctly. Note that we can not rely on it to be initialize in bdrv_open, so deal with the worst case there. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21use qemu_blockalign consistentlyChristoph Hellwig5-8/+9
Use qemu_blockalign for all allocations in the block layer. This allows increasing the required alignment, which is need to support O_DIRECT on devices with large block sizes. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-09-21vvfat: Use cache=unsafeKevin Wolf1-4/+10
The qcow file used for write support in vvfat is a temporary file, so we can use cache=unsafe there. Without this, write support is just too slow to be of any use. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
2010-09-21vvfat: Fix double free for opening the image rwKevin Wolf1-3/+4
Allocation and deallocation of bs->opaque is not in the control of a block driver. Therefore it should not set bs->opaque to a data structure used by another bs, or closing the image will lead to a double free. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
2010-09-21vvfat: Fix segfault on write to read-only diskKevin Wolf1-0/+5
vvfat tries to set the readonly flag in its open function, but nowadays this is overwritted with the readonly=... command line option. Check in bdrv_write if the vvfat was opened read-only and return an error in this case. Without this check, vvfat tries to access the qcow bs, which is NULL without enabled write support. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
2010-09-20Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori2-1/+11
2010-09-20e1000: Pad short frames to minimum size (60 bytes)Stefan Hajnoczi1-0/+10
The OpenIndiana (Solaris) e1000g driver drops frames that are too long or too short. It expects to receive frames of at least the Ethernet minimum size. ARP requests in particular are small and will be dropped if they are not padded appropriately, preventing a Solaris VM from becoming visible on the network. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-19mingw: use ASLR, no-SEH and DEP if availableBlue Swirl1-0/+9
If the linker supports the flags --dynamicbase, --no-seh, or --nxcompat, use them. Tested on Windows Vista: Process Explorer reports that ASLR and DEP are in use. No effect seen on Wine or Windows XP. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-19cris: Fix watchdog resetsEdgar E. Iglesias1-2/+3
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-18cris: Fix TLB exec bit protectionEdgar E. Iglesias2-2/+2
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-18Use gcc warning flag -Wnested-externsBlue Swirl4-3/+4
If the compiler supports the warning flag -Wnested-externs, use it. Avoid the only warning by moving the declaration of xml_builtin to a more proper place. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18Use gcc warning flag -Wempty-bodyBlue Swirl6-10/+14
If the compiler supports the warning flag -Wempty-body, use it. Adjust the code to avoid the warnings. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18Use a few more gcc warning flagsBlue Swirl1-1/+4
If the compiler supports the following warning flags, use them: -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wmissing-include-dirs Currently, these flags don't produce any warnings. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18Use gcc warning flag -Wtype-limitsBlue Swirl1-1/+1
If the compiler supports the warning flag -Wtype-limits, use it. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18pxa2xx: fix SSSR TFN logicBlue Swirl1-4/+4
Fix SSSR TFN logic: TX FIFO is never filled, so it is always in underrun condition if SSP is enabled. This also avoids a gcc warning with -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18MIPS: fix yield handlingBlue Swirl1-1/+3
The parameter for yield should be handled as a signed integer for the comparisons to have any effect. This also avoids a gcc warning with -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18PPC: Suppress gcc warnings with -Wtype-limitsBlue Swirl1-25/+25
The hack added by c5b76b381081680633e2e0a91216507430409fb2 was not enough to avoid warnings with gcc flag -Wtype-limits. Add a new macro to fix both problems. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18blkdebug: fix enum comparisonBlue Swirl1-3/+1
The signedness of enum types depend on the compiler implementation. Therefore the check for negative values may or may not be meaningful. Fix by explicitly casting to a signed integer. Since the values are also checked earlier against event_names table, this is an internal error. Change the 'if' to 'assert'. This also avoids a warning with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18pxa2xx: remove useless checksBlue Swirl1-1/+1
Remove checks which were made useless by r5849, 8da3ff180974732fc4272cb4433fef85c1822961. This also avoids a warning with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18Use range_covers_byteBlue Swirl2-8/+11
Use range_covers_byte() instead of comparisons. This avoids some warnings with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18Introduce range.hBlue Swirl7-31/+34
Extract range functions from pci.h. These will be used by later patches by non-PCI devices. Adjust current users. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18linux-user: improve flatload error checkingBlue Swirl1-1/+2
Because of the use of unsigned type, possible errors during load were ignored. Fix by using a signed type. This also avoids a warning with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18linux-user: fix types in a comparisonBlue Swirl1-1/+1
-1ul is unsigned long, which does not necessarily match abi_ulong type. Fix by using abi_long instead. This also avoids a warning with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18linux-user: fix socklen_t comparisonsBlue Swirl1-7/+13
On many systems, socklen_t is defined as unsigned. This means that checks for negative values are not meaningful. Fix by explicitly casting to a signed integer. This also avoids some warnings with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-18Check for errors during BIOS or kernel loadBlue Swirl4-13/+18
Because of the use of unsigned types, possible errors during BIOS or kernel load were ignored. Fix by using a signed type. This also avoids some warnings with GCC flag -Wtype-limits. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-17Make ARP replies at least 64 bytes longHervé Poussineau1-1/+2
IEEE 802.3 standard requires Ethernet frames to be at least 64 bytes long. If it is not the case, they will be considered as runt frames, and may be ignored by netcard and/or OS Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-17Accept packets with TTL=1Hervé Poussineau1-1/+1
Packets with TTL=1 may be directed to local network (DHCP/DNS servers for example), so don't discard them This is required by old versions of NetBSD which send DHCP DISCOVER packets with TTL=1 Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-16cris: Avoid spurios hw_abort on recursive bus faultsEdgar E. Iglesias1-1/+7
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-15PPC: Redesign interrupt trigger pathAlexander Graf1-51/+29
According to the Book3S spec, the interrupt context starts with an MSR value that is rather simple. If we leave out the HV case, it's almost always 0. To reflect this, let's redesign the way that MSR value gets calculated. Using this, we also squash the bug where MSR_POW can slip through into the interrupt handler MSR. Reported-by: Thomas Monjalon <thomas.monjalon@openwide.fr> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-15PPC: Enable hint bits for lwarx/ldarxAlexander Graf1-2/+2
The lwarx and ldarx instructions have a bit to give some hint to the CPU which is safe to ignore. We currently refuse to accept any instruction with that bit set, as it used to be declared MBZ. Let's remove the reserved bit and make the instruction work as expected. This fixes Linux boot for ppc64. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-15serial: Update parameters after loadMichal Novotny1-0/+1
This is the patch to update serial port parameters after guest is already loaded. Signed-off-by: Michal Novotny <minovotn@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-14vhost: fix infinite loop on error pathMichael S. Tsirkin1-1/+1
file.index is unsigned, hence 'while (--file.index >= 0)' will loop > forever. Change to while (file.index-- > 0). Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-14Remove wrong semicolon in macro definitionStefan Weil2-3/+3
Macros normally should not end with a semicolon, otherwise their usage results in two statements where only one statement was expected. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-13serial: Wrap debug prints around a DPRINTF macroMichal Novotny1-12/+13
Signed-off-by: Michal Novotny <minovotn@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-11ESP: fix ESP DMA access when DMA is not enabledBlue Swirl5-18/+88
Sending ESP a command caused it to trigger DMA immediately even if DMA was not enabled at the DMA controller. Add a signal from DMA controller to ESP to tell ESP about changes in DMA enable bit. Also use the correct function for setting up GPIO outputs. This fixes NetBSD 1.6.1 through 3.0 boot. Thanks to Artyom Tarasenko for extensive debugging of the problem. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-11powerpc: Avoid TLB related log spammingEdgar E. Iglesias1-1/+0
Invalid TLB entries are normal and should not spam the log. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2010-09-11trace: fix a regex portability problemBlue Swirl1-1/+1
The /bin/sh in Milax has problems with the regex: Error: invalid trace backend Please choose a supported trace backend. Fix it by escaping ')' like the regexes with '('. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-10trace: fix a typoBlue Swirl1-1/+1
There is no qemu_valloc() but qemu_vmalloc(). Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-10HACKING: add rules for printf-like functionsBlue Swirl1-0/+13
Add rules for printf-like functions, based on libvirt HACKING. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-09-10HACKING: add string management rulesBlue Swirl1-0/+24
Add string management rules, somewhat like libvirt HACKING. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>