Remove useless NULL checks for qemu_malloc return value
Found with this Coccinelle semantic patch:@expression E;identifier ptr;identifier fn ~= "qemu_mallocz*";@
@expression E;identifier ptr;identifier fn ~= "qemu_mallocz*";
ptr = fn(E);-if (ptr == NULL) { ... }+ptr = fn(E);
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
QEMUFileBuffered: indicate that we're ready when the underlying file is ready
QEMUFileBuffered stops writing when the underlying QEMUFile is not ready,and tells its producer so. However, when the underlying QEMUFile becomesready, it neglects to pass that information along, resulting in stoppage...
rtc: Remove TARGET_I386 from qemu-config.c, enables driftfix
qemu-config.c doesn't contain any target-specific code, and theTARGET_I386 conditional code didn't get compiled as a result. Removingthis enables the driftfix parameter for rtc.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
set proper migration status on ->write error (v5)
If ->write fails, declare migration status as MIG_STATE_ERROR.
Also, in buffered_file.c, ->close the object in case of anerror.
Fixes "migrate -d "exec:dd of=file", where dd fails to open file.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>...
savevm: Reset last block info at beginning of each save
If we save more than once we need to reset the last block info or elseonly the first save has the actual block info and each subsequent savewill only use continue flags, making them unloadable independently....
sparc escc IUS improvements (SunOS 4.1.4 fix)
According to scc_escc_um.pdf: - Reset Highest IUS must update irq status to allow processing of the next priority interrupt. - rx interrupt has always higher priority than tx on same channel
The documentation only explicitly says that Reset Highest IUS...
Fix mingw32 build
Don't define qemu_chr_open_eventfd() on Windows.
win32: Avoid compiler warning (WIN32_LEAN_AND_MEAN redefined)
configure adds the macro WIN32_LEAN_AND_MEAN toQEMU_CFLAGS, and SDL_syswm.h defines it, too.
This results in a compiler warning (redefinition ofWIN32_LEAN_AND_MEAN in SDL_syswm.h. That warning prevents...
win32: Add missing function setenv
Mingw32 does not provide a declaration and implementation of functionsetenv (which is used in sdl.c), so this patch adds both.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Disable build of ivshmem on non-KVM systems
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add kvm_set_ioeventfd_mmio_long definition for non-KVM systems
TCG: Revert ppc64 tcg_out_movi32 change
3b6dac34161bc0a342336072643c2f6d17e0ec45 apparently broke the ppc64 TCG targetcompilation in the code path without guest base.
Reverting this line fixes the build.
Signed-off-by: Andreas F?rber <andreas.faerber@web.de>...
TCG: Fix Darwin/ppc calling convention recognition
5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X v10.5 ppc.Apple's GCC 4.0.1 does not define _CALL_DARWIN. Recognize APPLE again as well.
RESEND: Inter-VM shared memory PCI device
resend for bug fix related to removal of irqfd
Support an inter-vm shared memory device that maps a shared-memory object as aPCI device in the guest. This patch also supports interrupts between guest bycommunicating over a unix domain socket. This patch applies to the qemu-kvm...
Add qemu_ram_alloc_from_ptr function
Provide a function to add an allocated region of memory to the qemu RAM.
This patch is copied from Marcelo's qemu_ram_map() in qemu-kvm and given theclearer name qemu_ram_alloc_from_ptr().
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>...
Device specification for shared memory PCI device
Signed-off-by: Cam Macdonell <cam@cs.ualberta.ca>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add function to assign ioeventfd to MMIO.
Support marking a device as non-migratable
A non-migratable device should be removed before migration and re-added after.
Merge remote branch 'kwolf/for-anthony' into staging
microblaze: Fix the target version of stat64 struct
MicroBlaze needs TARGET_STAT64_HAS_BROKEN_ST_INO.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
audio/sdl: return on error
Signed-off-by: malc <av1474@comtv.ru>
mips: Add support for VInt and VEIC irq modes
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
audio/sdl: be more anal about errors
audio: make audio_pt_init block all signals
sparc32: use FW_CFG_CMDLINE_SIZE
Add support for getting kernel command line size withFW_CFG_CMDLINE_SIZE.
block: Change bdrv_commit to handle multiple sectors at once
bdrv_commit copies the image to its backing file sector by sector, whichis (surprise!) relatively slow. Let's take a larger buffer and handle moresectors at once if possible.
With a 1G qcow2 file, this brought the time bdrv_commit takes down from...
loadvm: improve tests before bdrv_snapshot_goto()
This patch improves the resilience of the load_vmstate() function, doingfurther and better ordered tests.
In load_vmstate(), if there is any error on bdrv_snapshot_goto(), except if theerror is on VM state device, load_vmstate() will return zero and the VM will be...
block migration: replace tabs by spaces.
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Fix bdrv_has_zero_init
Assuming that any image on a block device is not properly zero-initialized isactually wrong: Only raw images have this problem. Any other image formatshouldn't care about it, they initialize everything properly themselves....
block: Change bdrv_eject() not to drop the image
bdrv_eject() gets called when a device model opens or closes the tray.
If the block driver implements method bdrv_eject(), that method getscalled. Drivers host_cdrom implements it, and it opens and closes the...
ide: Avoid canceling IDE DMA
The reason for not actually canceling the I/O is because withvirtualization and lots of VM running, a guest fs may mistake aoverload of the host, as an IDE timeout. So rather than canceling theI/O, it's safer to wait I/O completion and simulate that the I/O has...
fix last cpu timer initialization
The timer #0 is the system timer, so the timer #num_cpu is thetimer of the last CPU, and it must be initialized in slavio_timer_reset.
Don't mark non-existing timers as running.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>...
Initialize a variable in all cases
Commit d167f9bc06a577d6c85b8ed6991c1efe175aae7d missed this one:/src/qemu/ui/vnc-enc-tight.c:1483: warning: 'ret' may be used uninitialized in this function
Fix uint8_t comparison with negative value
Commit 7bccf57383cca60a778d5c543ac80c9f62d89ef2 missed this one:/src/qemu/ui/vnc-enc-tight.c: In function 'send_sub_rect':/src/qemu/ui/vnc-enc-tight.c:1527: warning: comparison is always true due to limited range of data type...
Fix a warning on OpenSolaris
Add a missing #include statement to avoid a warning:/src/qemu/net/tap-solaris.c: In function 'tap_open':/src/qemu/net/tap-solaris.c:189: warning: implicit declaration of function 'error_report'
Correctly identify multiple cpus in SMP systems
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Remove unused constant
Remove unused constant MIPS_FCR0
jazz led: Fix debug prints
Add a macro to easily enable/disable debug printsAlso fix wrong printf formatters
xilinx-s3adsp: Add support for loading u-boot images.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
xilinx-s3adsp: Fix loading of raw binaries.
Set high to a word aligned address beyond loaded image.
Remove unused eventfd.h
This header is not present on my system and causes a buildfailure, but is also not used in these files, so remove it.
Signed-off-by: Mike McCormack <mikem@ring3k.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
migration: Accept 'cont' only after successful incoming migration
When a 'cont' is issued on a VM that's just waiting for an incomingmigration, the VM reboots and boots into the guest, possibly corruptingits storage since it could be shared with another VM running elsewhere....
mips64el: fulong: PCI_DEVFN() clean up.
Use PCI_DEVFN() where appropriate.The resulted stripped binary remains samewith/without thie patch.
Cc: Huacai Chen <zltjiangshi@gmail.com>Cc: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
remove pointless if from vl.c
We already set sockets to nonzero in the code above.So this if statement always evaluates true. Remove it.
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
remove dead code from hw/loader.c
Removing dead code. Above we already continued whenrom->addr + valuegreaterthan0 < addr so this condition is always false.
fix variable type in qemu-io.c
The variable len can get a negative return value from cvtnum,which we check for, but which is impossible with the currentunsigned variable type. Currently the if(len < 0) check ispointless. This patch fixes that.
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>...
savevm: Fix memory leak of compat struct
Forgot to check for and free these.
Found-by: Zachary Amsden <zamsden@redhat.com>Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
virtio-serial: Check if more max_ports specified than we can handle
Currently virtio-serial supports a maximum of 31 ports. Specifying the'max_ports' parameter to be > 31 on the cmd line causes badness.
Ensure we initialise virtio-serial only if max_ports is within the...
Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
linux-user: fix build on hosts not using guest base
Commit 68a1c816868b3e35a1da698af412b29e61b1948a broke qemu on hosts notusing guest base. It uses reserved_va unconditionally in mmap.c. Toavoid to many #ifdef #endif blocks, define RESERVED_VA as either...
linux-user: Protect against allocation failure in load_symbols.
Cc: malc <av1474@comtv.ru>Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: malc <av1474@comtv.ru>
cris: Correct settls1 testcase.
cris: Correct ADDO and ADDOQ testcases.
Verified on real HW.
linux-user: Reduce lseek+reads while loading elf files.
Define BPRM_BUF_SIZE to 1k and read that amount initially. If thedata we want from the binary is in this buffer, use it instead ofreading from the file again.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
linux-user: Define ELF_DATA generically.
The only consideration on this value is the target endianness.The existing defines were incorrect for alpha and sh4eb.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
linux-user: Clean up byte-swapping in elfload.c.
Remove ifdefs from code by defining empty inline functionswhen byte swapping isn't needed. Push loops over swappingarrays of structures into the swapping functions.
linux-user: Load symbols from the interpreter.
First, adjust load_symbols to accept a load_bias parameter. At the sametime, read the entire section header table in one go, use pread insteadf lseek+read for the symbol and string tables, and properly free...
linux-user: Improve consistency checking in elf headers.
Validate more fields of the elf header. Extract those checksinto two common functions to be used in both load_elf_interpand load_elf_binary.
linux-user: Put the stack guard page at the top.
There are no supported stack-grows-up targets. We were puttingthe guard page at the highest address, i.e. the bottom of the stack.Use the maximum of host and guest page size for the guard size.
linux-user: Remove partial support for a.out interpreters.
At the bottom of the a.out support was the unimplemented load_aout_interpfunction. There were other portions of the support that didn't lookright; when I went to look in the Linux kernel for clarification, I found...
linux-user: Extract load_elf_image from load_elf_interp.
Moving toward a single copy of the elf binary loading code.Fill in the details of the loaded image into a struct image_info.
Adjust create_elf_tables to read from such structures insteadof from a collection of passed arguments. Don't return error...
linux-user: Re-use load_elf_image for the main binary.
This requires moving the PT_INTERP extraction and GUEST_BASEhandling into load_elf_image. Key this off a non-null pointerargument to receive the interpreter name.
linux-user: Handle filesz < memsz for any PT_LOAD segment.
I caught padzero not properly initializing the .bss segmenton a statically linked Alpha program. Rather than a minimalpatch, replace the gross code with a single mmap+memset.
Share more code between load_elf_interp and load_elf_binary....
Add more DT_* and AT_* constants to qemu's copy of elf.h.
Moving some PPC AT_* constants from elfload.c at the same time.
linux-user: Reindent elfload.c.
Update version for 0.13.x
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix mingw32 build errors like/src/qemu/ui/vnc-enc-tight.c: In function 'tight_detect_smooth_image24':/src/qemu/ui/vnc-enc-tight.c:119: error: 'uint' undeclared (first use in this function)
Replace 'uint' with proper 'unsigned int'.
Fix a warning with some GCCs:/src/qemu/ui/vnc-enc-tight.c: In function `send_sub_rect_nojpeg':/src/qemu/ui/vnc-enc-tight.c:1458: warning: `ret' might be used uninitialized in this function
Fix uint8_t comparisons with negative values
Fix the following warnings:/src/qemu/hw/ide/core.c: In function `ide_drive_pio_post_load':/src/qemu/hw/ide/core.c:2767: warning: comparison is always false due to limited range of data type
/src/qemu/ui/vnc-enc-tight.c: In function `tight_detect_smooth_image':...
Update version for 0.13.0-rc0
vnc: tight: don't forget do at the last color
While using indexed colors, the last color was never added to the palette.Triggered with ubuntu livecd.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: tight: remove a memleak in send_jpeg_rect()
buf was never freed.
vnc: tight add PNG encoding
Introduce a new encoding: VNC_ENCODING_TIGHT_PNG [1] (-269) with a newtight filter VNC_TIGHT_PNG (0x0A). When the client tells it supports the Tight PNGencoding, the server will use tight, but will always send encoding pixels using...
vnc: tight: specific zlib level and filters for each compression level
Disable png filters for lower compression levels. This should lowerthe CPU consumption and reduce encoding time.
vnc: tight: stop using qdict for palette stuff
Profiling with callgrind seems to show that a lot of time is spentin the palette code (mostly due to memory allocation and qdict to intconversion).
This patch adds a VncPalette implementation. The palette is stored...
vnc: encapsulate encoding members
This will allow to implement the threaded VNC server in amore cleaner way.
vnc: fix tight png memory leak
The tight.png buffer was never released.
qemu-thread: add qemu_mutex/cond_destroy and qemu_mutex_exit
Add some missing functions in qemu-thread. Currently qemu-threadis only used for io-thread but it will used by the vnc server soonand we need those functions instead of calling pthread directly....
vnc: threaded VNC server
Implement a threaded VNC server using the producer-consumer model.The main thread will push encoding jobs (a list a rectangles to update)in a queue, and the VNC worker thread will consume that queue and sendframebuffer updates to the output buffer....
vnc: add missing lock for vnc_cursor_define()
All vnc_write() calls must be locked (except the ones present beforethe protocol initialization).
vnc: tight: fix rgb_prepare_row
rgb_prepare_row bpp depends on the server display surface, notthe client.
vnc: tight: split send_sub_rect
Split send_sub_rect in send_sub_rect_jpeg and send_sub_rect_nojpeg toremove all these #ifdef CONFIG_JPEG.
vnc: better default values for VNC options
vnc_jpeg and vnc_png are now "auto" by default, this means thatif the dependencies are installed (libjpeg or libpng), then theywill be enabled.
vnc_thread is disabled by default. It should be enabled by default...
vnc: rename vnc-encoding-* vnc-enc-*
For the same reason that we don't use vnc-authentication-sasl.c butvnc-auth-sals.c. Because it's tooooo long.
ui: move all ui components in ui/
Move sdl, vnc, curses and cocoa UI into ui/ to cleanupthe root directory. Also remove some unnecessary explicittargets from Makefile.
aliguori: fix build when srcdir != objdir
Signed-off-by: Corentin Chary <corentincj@iksaif.net>...
vnc: tight: add JPEG and gradient subencoding with smooth image detection
Add gradient filter and JPEG compression with an heuristic to detect howlossy the comppression will be. This code has been adapted fromlibvncserver/tight.c.
JPEG support can be enabled/disabled at compile time with --enable-vnc-jpeg...
vnc: JPEG should be disabled if the client don't set tight quality
Disable JPEG compression by default and only enable it if theVNC client has sent the requested quality.
vnc: add lossy option
The lossy option can be used to enable lossy compressionmethods like gradient or jpeg. This patch disable them bydefault.
Revert "ide save/restore current transfer fields"
This reverts commit 42ee76fe82093ba914f0dc83d2decbcf68866144.
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: add subsections code
This commit adds subsections for each device section.Subsections is the way to handle information that don't need to be sentto de destination of a migration because its values are not needed. It isthe way to handle optional information. Notice that only the source can...
ide: fix migration in the middle of pio operation
ide: fix migration in the middle of a bmdma transfer
It reintroduces Revert "ide save/restore pio/atapi cmd transfer fields and io buffer"
but using subsections. Added bonus is the addition of ide_dummy_transfer_stopto transfer_end_table, that was missing....
Initial documentation for migration
Revert "ide save/restore pio/atapi cmd transfer fields and io buffer"
This reverts commit ed487bb1d69040b9dac64a4fc076d8dd82b131d6.
The conflicts are due to commit 4fc8d6711aff7a9c11e402c3d77b481609f9f486that is a fix to the ide_drive_pre_save() function. It reverts both...
Merge remote branch 'mst/for_anthony' into staging
block: Use error codes from lower levels for error message
"No such file or directory" is a misleading error messagewhen a user tries to open a file with wrong permissions.
Cc: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
Fix -snapshot deleting images on disk change
Block device change command did not copy BDRV_O_SNAPSHOT flag. Thusthe new image did not have this flag and the file got deleted duringopening.
Fix by copying BDRV_O_SNAPSHOT flag.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>...
virtio-blk: Create exit function to unregister savevm
Otherwise we can't migrate after we've removed a virtio block device.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
move 'unsafe' to end of caching modes in help
Libvirt parses qemu help output to determine qemu features. In particularit probes for the following: "cache=writethrough|writeback|none". Theaddition of the unsafe cache mode was inserted within this string, as...
block: default to 0 minimal / optiomal I/O size
Currently we set them to 512 bytes unless manually specified. Unforuntalysome brain-dead partitioning tools create unaligned partitions if theyget low enough optiomal I/O size values, so don't report any at all...