]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agohw/9pfs: Add yeild support to rename coroutine
Aneesh Kumar K.V [Sat, 7 May 2011 10:39:10 +0000 (16:09 +0530)]
hw/9pfs: Add yeild support to rename coroutine

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_remove to use coroutines
Venkateswararao Jujjuri [Mon, 8 Aug 2011 18:20:20 +0000 (23:50 +0530)]
hw/9pfs: Update v9fs_remove to use coroutines

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yield support for remove
Venkateswararao Jujjuri [Mon, 8 Aug 2011 18:18:29 +0000 (23:48 +0530)]
hw/9pfs: Add yield support for remove

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update mkdir to use coroutines
Venkateswararao Jujjuri [Mon, 8 Aug 2011 18:16:14 +0000 (23:46 +0530)]
hw/9pfs: Update mkdir to use coroutines

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yield support for mkdir coroutine
Venkateswararao Jujjuri [Mon, 8 Aug 2011 18:14:24 +0000 (23:44 +0530)]
hw/9pfs: Add yield support for mkdir coroutine

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_mknod to use coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 23:06:51 +0000 (16:06 -0700)]
hw/9pfs: Update v9fs_mknod to use coroutines

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yield support to mknod coroutine
Aneesh Kumar K.V [Wed, 18 May 2011 23:06:38 +0000 (16:06 -0700)]
hw/9pfs: Add yield support to mknod coroutine

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_xattrcreate to use coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 23:06:26 +0000 (16:06 -0700)]
hw/9pfs: Update v9fs_xattrcreate to use coroutines

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_xattrwalk to coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 23:05:48 +0000 (16:05 -0700)]
hw/9pfs: Update v9fs_xattrwalk to coroutines

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yield support to xattr related coroutine
Aneesh Kumar K.V [Wed, 18 May 2011 23:05:34 +0000 (16:05 -0700)]
hw/9pfs: Add yield support to xattr related coroutine

This include llistxattr and lgetxattr.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_setattr to use coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 23:05:10 +0000 (16:05 -0700)]
hw/9pfs: Update v9fs_setattr to use coroutines

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yield support to setattr related coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 23:04:58 +0000 (16:04 -0700)]
hw/9pfs: Add yield support to setattr related coroutines

This include chmod, utimensat, chown and truncate.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_getattr to use coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 23:04:33 +0000 (16:04 -0700)]
hw/9pfs: Update v9fs_getattr to use coroutines

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yield support to lstat coroutine
Aneesh Kumar K.V [Wed, 18 May 2011 23:04:13 +0000 (16:04 -0700)]
hw/9pfs: Add yield support to lstat coroutine

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_statfs to use coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 23:04:01 +0000 (16:04 -0700)]
hw/9pfs: Update v9fs_statfs to use coroutines

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yield support to statfs coroutine
Aneesh Kumar K.V [Wed, 18 May 2011 23:03:49 +0000 (16:03 -0700)]
hw/9pfs: Add yield support to statfs coroutine

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_readdir to use coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 22:57:17 +0000 (15:57 -0700)]
hw/9pfs: Update v9fs_readdir to use coroutines

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yield support for readdir related coroutines
Aneesh Kumar K.V [Wed, 18 May 2011 22:42:42 +0000 (15:42 -0700)]
hw/9pfs: Add yield support for readdir related coroutines

This include readdir, telldir, seekdir, rewinddir.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Update v9fs_readlink to use coroutine
Venkateswararao Jujjuri [Mon, 8 Aug 2011 18:06:41 +0000 (23:36 +0530)]
hw/9pfs: Update v9fs_readlink to use coroutine

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agohw/9pfs: Add yeild support for readlink
Venkateswararao Jujjuri (JV) [Mon, 8 Aug 2011 18:03:48 +0000 (23:33 +0530)]
hw/9pfs: Add yeild support for readlink

Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years ago[virtio-9p] Change all pdu handlers to coroutines.
Venkateswararao Jujjuri (JV) [Wed, 18 May 2011 21:18:05 +0000 (14:18 -0700)]
[virtio-9p] Change all pdu handlers to coroutines.

This patch changes the top level handlers to coroutines and sets the base.
It will be followed up with series of patches to convert all filesystem
calls to threaded coroutines pushing all blocking clals in VirtFS out
of vcpu threads.

Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years ago[virtio-9p] Add infrastructure to support glib threads and coroutines.
Venkateswararao Jujjuri (JV) [Sun, 24 Apr 2011 01:40:22 +0000 (18:40 -0700)]
[virtio-9p] Add infrastructure to support glib threads and coroutines.

This patch is originally made by Arun Bharadwaj for glib support.
Later Harsh Prateek Bora added coroutines support.
This version implemented with suggestions from
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>.

Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 years agocoroutine: add gthread dependency
Stefan Hajnoczi [Mon, 8 Aug 2011 07:34:05 +0000 (13:04 +0530)]
coroutine: add gthread dependency

Commit 1fc7bd4a86a2bfeafcec29445871eb97469a2699 removed the gthread and
gio dependency since qemu-ga did not require it.  Coroutines require
gthread, so add it back in.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoFix forcing multicast msgs to loopback on OpenBSD.
Brad [Sun, 7 Aug 2011 11:06:43 +0000 (11:06 +0000)]
Fix forcing multicast msgs to loopback on OpenBSD.

Fix forcing multicast msgs to loopback on OpenBSD.
e.g.
$ sudo qemu -m 128 -no-fd-bootchk \
        -hda virtual.img -boot n -nographic \
        -net nic,vlan=0,model=rtl8139,macaddr=52:54:00:12:34:03 \
        -net user -tftp /usr/src/sys/arch/i386/compile/TEST -bootp pxeboot \
        -net nic,vlan=1,model=rtl8139,macaddr=52:54:00:23:03:01 \
        -net tap,vlan=1,script=no \
        -net nic,vlan=3,model=rtl8139,macaddr=52:54:00:23:03:03 \
        -net socket,vlan=3,mcast=230.0.0.1:10003
setsockopt(SOL_IP, IP_MULTICAST_LOOP): Invalid argument
qemu: -net socket,vlan=3,mcast=230.0.0.1:10003: Device 'socket' could not be initialized

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoUse mmap to allocate execute memory
Tobias Nygren [Sun, 7 Aug 2011 09:57:05 +0000 (09:57 +0000)]
Use mmap to allocate execute memory

Use mmap to allocate executable memory on NetBSD as well.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix network interface tap backend
Manuel Bouyer [Sun, 7 Aug 2011 09:48:59 +0000 (09:48 +0000)]
Fix network interface tap backend

Fix network interface tap backend work on NetBSD.
It uses an ioctl to get the tap name.

Signed-off-by: Christoph Egger<Christoph.Egger@amd.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agodarwin-user: Remove two unused variables
Stefan Weil [Wed, 20 Jul 2011 19:40:18 +0000 (21:40 +0200)]
darwin-user: Remove two unused variables

cppcheck report:

darwin-user/signal.c:322: style: Unused variable: i
darwin-user/signal.c:322: style:
Variable 'err' is assigned a value that is never used

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG: fix copy propagation
Blue Swirl [Sat, 6 Aug 2011 13:58:47 +0000 (13:58 +0000)]
TCG: fix copy propagation

Copy propagation introduced in 22613af4a6d9602001e6d0e7b6d98aa40aa018dc
considered only global registers. However, register temps and stack
allocated locals must be handled differently because register temps
don't survive across brcond.

Fix by propagating only within same class of temps.

Tested-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoRemove unused is_softmmu parameter from cpu_handle_mmu_fault
Blue Swirl [Mon, 1 Aug 2011 16:12:17 +0000 (16:12 +0000)]
Remove unused is_softmmu parameter from cpu_handle_mmu_fault

Parameter is_softmmu (and its evil mutant twin brother is_softmuu)
is not used in cpu_*_handle_mmu_fault() functions, remove them
and adjust callers.

Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix handling of conditional branches in delay slot of a conditional branch
Artyom Tarasenko [Sat, 6 Aug 2011 15:01:24 +0000 (17:01 +0200)]
Fix handling of conditional branches in delay slot of a conditional branch

Check whether dc->npc is dynamic before using its value for branch.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Fri, 5 Aug 2011 17:17:04 +0000 (12:17 -0500)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

12 years agowhen overriding default tool names don't add cross-prefix
Stuart Yoder [Thu, 4 Aug 2011 22:10:08 +0000 (17:10 -0500)]
when overriding default tool names don't add cross-prefix

When overriding a tool name via a shell variable, don't
tack on the cross-prefix.  This specifically allows the
pkg-config command to be overridden and work where it
does not exist in some cross build environments.

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoReorganize and fix monitor resume after migration
Jan Kiszka [Fri, 5 Aug 2011 07:11:26 +0000 (09:11 +0200)]
Reorganize and fix monitor resume after migration

If migration failed in migrate_fd_put_buffer, the monitor may have been
resumed not only in the error path of that function but also once again
in migrate_fd_put_ready which is called unconditionally by
migrate_fd_connect.

Fix this by establishing a cleaner policy: the monitor shall be resumed
when the migration file is closed, either via callback
(migrate_fd_close) or in migrate_fd_cleanup if no file is open (i.e. no
callback invoked).

Reported-By: Michael Tokarev <mjt@tls.msk.ru>
Tested-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: Eliminate duplicate reset
Isaku Yamahata [Tue, 2 Aug 2011 01:59:13 +0000 (10:59 +0900)]
qdev: Eliminate duplicate reset

qbus_reset_all_fn was registered twice, so a lot of device reset
functions were also called twice when QEMU started.
Which was introduced by 80376c3fc2c38fdd45354e4b0eb45031f35587ed
This patch fixes it by making the main_system_bus creation not register
reset handler.

Cc: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Tested-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoAvoid allocating TCG resources in non-TCG mode
Jan Kiszka [Tue, 2 Aug 2011 14:10:21 +0000 (16:10 +0200)]
Avoid allocating TCG resources in non-TCG mode

Do not allocate TCG-only resources like the translation buffer when
running over KVM or XEN. Saves a "few" bytes in the qemu address space
and is also conceptually cleaner.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomemory: use signed arithmetic
Avi Kivity [Wed, 3 Aug 2011 08:56:14 +0000 (11:56 +0300)]
memory: use signed arithmetic

When trying to map an alias of a ram region, where the alias starts at
address A and we map it into address B, and A > B, we had an arithmetic
underflow.  Because we use unsigned arithmetic, the underflow converted
into a large number which failed addrrange_intersects() tests.

The concrete example which triggered this was cirrus vga mapping
the framebuffer at offsets 0xc0000-0xc7fff (relative to the start of
the framebuffer) into offsets 0xa0000 (relative to system addres space
start).

With our favorite analogy of a windowing system, this is equivalent to
dragging a subwindow off the left edge of the screen, and failing to clip
it into its parent window which is on screen.

Fix by switching to signed arithmetic.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomemory: synchronize dirty bitmap before unmapping a range
Avi Kivity [Sun, 31 Jul 2011 19:47:58 +0000 (22:47 +0300)]
memory: synchronize dirty bitmap before unmapping a range

When a range is being unmapped, ask accelerators (e.g. kvm) to synchronize the
dirty bitmap to avoid losing information forever.

Fixes grub2 screen update.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Refactor sdl_send_mouse_event
Jan Kiszka [Sat, 30 Jul 2011 09:39:18 +0000 (11:39 +0200)]
sdl: Refactor sdl_send_mouse_event

Replace width/height globals with the identical values from real_screen,
refactor the function according to our coding style.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Factor out event handlers from sdl_refresh
Jan Kiszka [Sat, 30 Jul 2011 09:39:17 +0000 (11:39 +0200)]
sdl: Factor out event handlers from sdl_refresh

No functional changes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Add zoom hot keys
Jan Kiszka [Sat, 30 Jul 2011 09:39:16 +0000 (11:39 +0200)]
sdl: Add zoom hot keys

Allow to enlarge or shrink the screen via CTRL-ALT-+/-. In contrast to
scaling the window, these controls always preserve the aspect ratio of
the current console.

CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Dynamically grab input in absolute mouse mode
Jan Kiszka [Sat, 30 Jul 2011 09:39:15 +0000 (11:39 +0200)]
sdl: Dynamically grab input in absolute mouse mode

Not grabbing the input means that special keys like ALT+TAB are still
handled by the host. Improve the usability by grabbing input once the
mouse is inside the guest screen, provided the SDL window has the input
focus. Release it again when the mouse is moved to any border. Also grab
the input when we gain the input focus and the mouse is within the
screen limits.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Fix cursor handling when switching consoles in absolute mouse mode
Jan Kiszka [Sat, 30 Jul 2011 09:39:14 +0000 (11:39 +0200)]
sdl: Fix cursor handling when switching consoles in absolute mouse mode

Restore the cursor when switching from graphic to text console while the
mouse is in absolute mode. Disable it again when returning.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Never release input while in full screen mode
Jan Kiszka [Sat, 30 Jul 2011 09:39:13 +0000 (11:39 +0200)]
sdl: Never release input while in full screen mode

It's confusing to suddenly find two mice in full screen mode when
switching consoles or accidentally hitting the grab hot keys.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Consistently avoid grabbing input for text consoles
Jan Kiszka [Sat, 30 Jul 2011 09:39:12 +0000 (11:39 +0200)]
sdl: Consistently avoid grabbing input for text consoles

There were some preexisting bits that released the input when switching
to text console. This patch spreads this logic consistently and also
avoids grabbing the input while a text console is active.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Initialize gui_fullscreen earlier during setup
Jan Kiszka [Sat, 30 Jul 2011 09:39:11 +0000 (11:39 +0200)]
sdl: Initialize gui_fullscreen earlier during setup

This ensures that we actually enter full screen on startup when e.g.
'-vga none -full-screen' was specified.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Drop bogus gui_fullscreen_initial_grab
Jan Kiszka [Sat, 30 Jul 2011 09:39:10 +0000 (11:39 +0200)]
sdl: Drop bogus gui_fullscreen_initial_grab

There must be no difference between initial -full-screen and switching
to this mode via the hot key.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Restore scaling mode on return from full screen
Jan Kiszka [Sat, 30 Jul 2011 09:39:09 +0000 (11:39 +0200)]
sdl: Restore scaling mode on return from full screen

Save the scaling mode and its geometry when going full screen, restore
it when returning to windowed mode.

CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Fix full screen toggling from scaled mode
Jan Kiszka [Sat, 30 Jul 2011 09:39:08 +0000 (11:39 +0200)]
sdl: Fix full screen toggling from scaled mode

When switching to full screen mode from a scaled window, we need to
resize to DisplayState's dimension, not the scaled "real" screen size.
Moreover, scaling mode may have manipulated the bpp. So we need to
restore it from the DisplayState as well.

CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Properly mark modifier+u as hotkey
Jan Kiszka [Sat, 30 Jul 2011 09:39:07 +0000 (11:39 +0200)]
sdl: Properly mark modifier+u as hotkey

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Avoid redundant scaling deactivation
Jan Kiszka [Sat, 30 Jul 2011 09:39:06 +0000 (11:39 +0200)]
sdl: Avoid redundant scaling deactivation

Prevents screen flickering.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Do not make full screen mode resizable
Jan Kiszka [Sat, 30 Jul 2011 09:39:05 +0000 (11:39 +0200)]
sdl: Do not make full screen mode resizable

This prevents continuous resizing events and improper screen setups when
going full screen.

CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosdl: Fix termination in -no-shutdown mode
Jan Kiszka [Sat, 30 Jul 2011 09:39:04 +0000 (11:39 +0200)]
sdl: Fix termination in -no-shutdown mode

Just like the monitor does, we need to clear no_shutdown before calling
qemu_system_shutdown_request on quit requests. Otherwise, QEMU just
stops the VM.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoCheck fread() results to avoid gcc 4.6 warnings
David Gibson [Mon, 1 Aug 2011 06:49:59 +0000 (16:49 +1000)]
Check fread() results to avoid gcc 4.6 warnings

When compiling with gcc 4.6, some code in fw_cfg.c complains that fop_ret
is assigned but not used (which is true).  However, it looks like the
meaningless assignments to fop_ret were done to suppress other gcc warnings
due to the fact that fread() is labelled as warn_unused_result in glibc.

This patch avoids both errors, by actually checking the fread() result code
and dropping out with an error message if it fails.

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMAINTAINERS: add entry for Xen
Stefano Stabellini [Fri, 29 Jul 2011 15:05:13 +0000 (16:05 +0100)]
MAINTAINERS: add entry for Xen

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqcow2: Fix L1 table size after bdrv_snapshot_goto
Kevin Wolf [Fri, 5 Aug 2011 10:06:11 +0000 (12:06 +0200)]
qcow2: Fix L1 table size after bdrv_snapshot_goto

When loading an internal snapshot whose L1 table is smaller than the current L1
table, the size of the current L1 would be shrunk to the snapshot's L1 size in
memory, but not on disk. This lead to incorrect refcount updates and eventuelly
to image corruption.

Instead of writing the new L1 size to disk, this simply retains the bigger L1
size that is currently in use and makes sure that the unused part is zeroed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Philipp Hahn <hahn@univention.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Only start packet expiration for delayed ones
Jan Kiszka [Fri, 5 Aug 2011 12:05:53 +0000 (14:05 +0200)]
slirp: Only start packet expiration for delayed ones

The expiration timeout must only affect packets that are queued due to
pending ARP resolutions. The old version broke ping e.g.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: Read current time only once per if_start call
Jan Kiszka [Fri, 5 Aug 2011 12:04:00 +0000 (14:04 +0200)]
slirp: Read current time only once per if_start call

No need to update the current time for each packet we send from the
queue. Processing time is comparably short.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: Fix types of IP address parameters
Jan Kiszka [Fri, 5 Aug 2011 10:51:11 +0000 (12:51 +0200)]
slirp: Fix types of IP address parameters

Should be uint32_t for IPv4, not int. Also avoid in_addr_t without
proper includes. Fixes build regression on mingw32.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoMerge remote-tracking branch 'mst/for_anthony' into staging
Anthony Liguori [Thu, 4 Aug 2011 22:15:22 +0000 (17:15 -0500)]
Merge remote-tracking branch 'mst/for_anthony' into staging

12 years agoMerge remote-tracking branch 'alon/pull-libcacard.data' into staging
Anthony Liguori [Thu, 4 Aug 2011 22:14:49 +0000 (17:14 -0500)]
Merge remote-tracking branch 'alon/pull-libcacard.data' into staging

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Thu, 4 Aug 2011 22:14:01 +0000 (17:14 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

12 years agoMerge remote-tracking branch 'spice/spice.v40' into staging
Anthony Liguori [Thu, 4 Aug 2011 22:13:26 +0000 (17:13 -0500)]
Merge remote-tracking branch 'spice/spice.v40' into staging

12 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Thu, 4 Aug 2011 22:12:34 +0000 (17:12 -0500)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

12 years agoMerge remote-tracking branch 'kraxel/usb.22' into staging
Anthony Liguori [Thu, 4 Aug 2011 22:10:36 +0000 (17:10 -0500)]
Merge remote-tracking branch 'kraxel/usb.22' into staging

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Thu, 4 Aug 2011 21:45:17 +0000 (16:45 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

12 years agoguest agent: add --enable-guest-agent config option
Michael Roth [Mon, 1 Aug 2011 19:52:57 +0000 (14:52 -0500)]
guest agent: add --enable-guest-agent config option

QAPI will require glib/python, but for now the guest agent is the only
user. For now, make these dependencies an explicit guest agent one, and
give users the option to disable it if need be.

Once QAPI is adopted in core QEMU code, we would basically revert this
patch.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoAdd support for finding libpng via pkg-config.
Brad [Sat, 30 Jul 2011 05:45:55 +0000 (01:45 -0400)]
Add support for finding libpng via pkg-config.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoalpha-softmmu: Disable for the 0.15 release branch.
Richard Henderson [Sun, 31 Jul 2011 23:47:20 +0000 (16:47 -0700)]
alpha-softmmu: Disable for the 0.15 release branch.

The system emulation code was not merged before the branch.
Let's leave that work for the next release.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoconfigure: Fix bad shell expression for non-Linux hosts
Stefan Weil [Fri, 29 Jul 2011 20:40:45 +0000 (22:40 +0200)]
configure: Fix bad shell expression for non-Linux hosts

With vhost_net="" (most non-Linux hosts), configure prints an
error message:

test: 2551: =: unexpected operator

Fix this and similar code by adding the missing "".

Cc: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovirtio-balloon: Unregister savevm section on device unplug
Amit Shah [Thu, 28 Jul 2011 06:06:26 +0000 (11:36 +0530)]
virtio-balloon: Unregister savevm section on device unplug

Migrating after unplugging a virtio-balloon device resulted in an error
message on the destination:

Unknown savevm section or instance '0000:00:04.0/virtio-balloon' 0
load of migration failed

Fix this by unregistering the section on device unplug.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
12 years agovirtio-balloon: Add exit handler, fix memleaks
Amit Shah [Wed, 27 Jul 2011 08:20:41 +0000 (13:50 +0530)]
virtio-balloon: Add exit handler, fix memleaks

Add an exit handler that will free up RAM after a virtio-balloon device
is unplugged.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
12 years agoballoon: Reject negative balloon values
Amit Shah [Wed, 27 Jul 2011 11:20:54 +0000 (16:50 +0530)]
balloon: Reject negative balloon values

Negative balloon values don't make sense, reject them and throw a qerror
with QERR_INVALID_PARAMETER_VALUE.

Reported-by: Mike Cao <bcao@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
12 years agovirtio-balloon: Check if balloon registration failed
Amit Shah [Wed, 27 Jul 2011 06:59:33 +0000 (12:29 +0530)]
virtio-balloon: Check if balloon registration failed

Multiple balloon registrations are not allowed; check if the
registration with the qemu balloon api succeeded.  If not, fail the
device init.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
12 years agoballoon: Don't allow multiple balloon handler registrations
Amit Shah [Wed, 27 Jul 2011 06:58:19 +0000 (12:28 +0530)]
balloon: Don't allow multiple balloon handler registrations

Multiple balloon devices don't make sense; disallow more than one
registration attempt to register handlers.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
12 years agovirtio-balloon: Fix header comment; add Copyright
Amit Shah [Wed, 20 Jul 2011 08:07:01 +0000 (13:37 +0530)]
virtio-balloon: Fix header comment; add Copyright

Signed-off-by: Amit Shah <amit.shah@redhat.com>
12 years agoballoon: Fix header comment; add Copyright
Amit Shah [Wed, 20 Jul 2011 08:05:30 +0000 (13:35 +0530)]
balloon: Fix header comment; add Copyright

Signed-off-by: Amit Shah <amit.shah@redhat.com>
12 years agoballoon: Separate out stat and balloon handling
Amit Shah [Wed, 20 Jul 2011 08:00:56 +0000 (13:30 +0530)]
balloon: Separate out stat and balloon handling

Passing on '0' as ballooning target to indicate retrieval of stats is
bad API.  It also makes 'balloon 0' in the monitor cause a segfault.
Have two different functions handle the different functionality instead.

Detailed explanation from Markus's review:

1. do_info_balloon() is an info_async() method.  It receives a callback
   with argument, to be called exactly once (callback frees the
   argument).  It passes the callback via qemu_balloon_status() and
   indirectly through qemu_balloon_event to virtio_balloon_to_target().

   virtio_balloon_to_target() executes its balloon stats half.  It
   stores the callback in the device state.

   If it can't send a stats request, it resets stats and calls the
   callback right away.

   Else, it sends a stats request.  The device model runs the callback
   when it receives the answer.

   Works.

2. do_balloon() is a cmd_async() method.  It receives a callback with
   argument, to be called when the command completes.  do_balloon()
   calls it right before it succeeds.  Odd, but should work.

   Nevertheless, it passes the callback on via qemu_ballon() and
   indirectly through qemu_balloon_event to virtio_balloon_to_target().

   a. If the argument is non-zero, virtio_balloon_to_target() executes
      its balloon half, which doesn't use the callback in any way.

      Odd, but works.

   b. If the argument is zero, virtio_balloon_to_target() executes its
      balloon stats half, just like in 1.  It either calls the callback
      right away, or arranges for it to be called later.

      Thus, the callback runs twice: use after free and double free.

Test case: start with -S -device virtio-balloon, execute "balloon 0" in
human monitor.  Runs the callback first from virtio_balloon_to_target(),
then again from do_balloon().

Reported-by: Mike Cao <bcao@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
12 years agovirtio-balloon: Separate status handling into separate function
Amit Shah [Wed, 20 Jul 2011 07:49:07 +0000 (13:19 +0530)]
virtio-balloon: Separate status handling into separate function

Separate out the code to retrieve balloon info from the code that sets
balloon values.

This will be used to separate the two callbacks from balloon.c and help
cope with 'balloon 0' on the monitor.  Currently, 'balloon 0' causes a
segfault in monitor_resume().

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
12 years agoballoon: Simplify code flow
Amit Shah [Wed, 20 Jul 2011 07:44:12 +0000 (13:14 +0530)]
balloon: Simplify code flow

Replace:
  if (foo) {
    ...
  } else {
    return 0;
  }

by

  if (!foo) {
    return 0;
  }
  ...

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
12 years agoballoon: Add braces around if statements
Amit Shah [Wed, 20 Jul 2011 07:42:15 +0000 (13:12 +0530)]
balloon: Add braces around if statements

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
12 years agoballoon: Make functions, local vars static
Amit Shah [Wed, 20 Jul 2011 07:38:46 +0000 (13:08 +0530)]
balloon: Make functions, local vars static

balloon.h had function declarations for a couple of functions that are
local to balloon.c.  Make them static.

Drop the 'qemu_' prefix for balloon.c-local variables, and make them
static.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
12 years agobluetooth: kill dummy usb device, use hid code directly.
Gerd Hoffmann [Fri, 15 Jul 2011 14:14:59 +0000 (16:14 +0200)]
bluetooth: kill dummy usb device, use hid code directly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agohid: move idle+protocol from usb-hid to hid too.
Gerd Hoffmann [Fri, 15 Jul 2011 13:52:33 +0000 (15:52 +0200)]
hid: move idle+protocol from usb-hid to hid too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hid: split hid code to hw/hid.[ch]
Gerd Hoffmann [Fri, 15 Jul 2011 13:08:01 +0000 (15:08 +0200)]
usb-hid: split hid code to hw/hid.[ch]

Almost pure code motion.  Unstatic hid interface functions and add
them to the header file.  Some renames.  Some code style cleanups.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hid: add hid_has_events()
Gerd Hoffmann [Fri, 15 Jul 2011 12:46:39 +0000 (14:46 +0200)]
usb-hid: add hid_has_events()

Add hid_has_events function, use it to figure whenever there are pending
events instead of checking and updating USBHIDState->changed.

Setting ->changed to 1 on init is removed, that should have absolutely
no effect as the initial state of ->idle is 0 so we report hid state
anyway until the guest configures some idle time.  Also should clear
->idle on reset.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hid: add event callback
Gerd Hoffmann [Fri, 15 Jul 2011 12:37:15 +0000 (14:37 +0200)]
usb-hid: add event callback

Add callback for event notification, which allows to un-usbify more
functions.  Also split separate hid_* functions for reset and release.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hid: create & use HIDState
Gerd Hoffmann [Fri, 15 Jul 2011 11:12:44 +0000 (13:12 +0200)]
usb-hid: create & use HIDState

First step in separating out the HID emulation code from usb-hid, so it
can be reused without creating a dummy usb device like bluetooth does.

This creates a HIDState struct, moves the non-usbish fields from
USBHIDStruct there.  Renames non-usbish structs, defines and functions
from usb* to hid*.  Adapts the code to that.

Also cleans up a bunch of code style issues along the way.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoehci: iovec support, remove buffer
Gerd Hoffmann [Wed, 13 Jul 2011 15:36:46 +0000 (17:36 +0200)]
ehci: iovec support, remove buffer

Map guest memory and pass on a direct pointer instead of copying
the bits to a indirect buffer.  EHCI transfer descriptors can
reference multiple (physical guest) pages so we'll actually start
seeing usb packets wich carry iovec with more than one element.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agouhci: remove buffer
Gerd Hoffmann [Wed, 13 Jul 2011 13:37:29 +0000 (15:37 +0200)]
uhci: remove buffer

Map guest memory and pass on a direct pointer instead of copying
the bits to a indirect buffer.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-storage: iovec support
Gerd Hoffmann [Wed, 13 Jul 2011 10:32:06 +0000 (12:32 +0200)]
usb-storage: iovec support

Add full iovec support to usb-storage.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-host: iovec support
Gerd Hoffmann [Wed, 13 Jul 2011 09:28:17 +0000 (11:28 +0200)]
usb-host: iovec support

Add full support for iovecs to usb-host.  The code can split large
transfers into smaller ones already, we are using this to also split
requests at iovec borders.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-serial: iovec support
Gerd Hoffmann [Wed, 13 Jul 2011 08:53:23 +0000 (10:53 +0200)]
usb-serial: iovec support

Add full support for iovecs to usb-serial.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: use iovecs in USBPacket
Gerd Hoffmann [Tue, 12 Jul 2011 13:22:25 +0000 (15:22 +0200)]
usb: use iovecs in USBPacket

Zap data pointer from USBPacket, add a QEMUIOVector instead.
Add a bunch of helper functions to manage USBPacket data.
Switch over users to the new interface.

Note that USBPacket->len was used for two purposes:  First to
pass in the buffer size and second to return the number of
transfered bytes or the status code on async transfers.  There
is a new result variable for the latter.  A new status code
was added to catch uninitialized result.

Nobody creates iovecs with more than one element (yet).
Some users are (temporarely) limited to iovecs with a single
element to keep the patch size as small as possible.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agomove QEMUSGList typedef
Gerd Hoffmann [Tue, 12 Jul 2011 11:36:23 +0000 (13:36 +0200)]
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>
12 years agoAdd iov_clear()
Gerd Hoffmann [Wed, 13 Jul 2011 13:16:08 +0000 (15:16 +0200)]
Add iov_clear()

Fill the spefified area with zeros.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoAdd iov_hexdump()
Gerd Hoffmann [Tue, 12 Jul 2011 11:35:10 +0000 (13:35 +0200)]
Add iov_hexdump()

Useful for debugging purposes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agore-activate usb-host for bsd
Gerd Hoffmann [Thu, 4 Aug 2011 12:54:19 +0000 (14:54 +0200)]
re-activate usb-host for bsd

A bunch of code was disabled via #if 0, for a quite long time (since
Sept 2009).  Surprisingly the code builds just fine when they are
removed (tested on OpenBSD).  /me wonders nevertheless whenever there
are any users of those bits when this went unnoticed for almost two
years ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoblock: Use bdrv_co_* instead of synchronous versions in coroutines
Kevin Wolf [Fri, 15 Jul 2011 14:05:00 +0000 (16:05 +0200)]
block: Use bdrv_co_* instead of synchronous versions in coroutines

If we're already in a coroutine, there is no reason to use the synchronous
version of block layer functions when a coroutine one exists. This makes
bdrv_read/write/flush use bdrv_co_* when used inside a coroutine.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agolm32: softusb: claim to support full speed
Michael Walle [Thu, 21 Jul 2011 18:52:24 +0000 (20:52 +0200)]
lm32: softusb: claim to support full speed

The QEMU keyboard and mouse reports themselves as full speed devices,
though they are actually low speed devices. Until this is fixed, claim that
we are supporting full speed devices.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
12 years agovhost: remove an incorrect assert
Michael S. Tsirkin [Wed, 3 Aug 2011 12:24:41 +0000 (15:24 +0300)]
vhost: remove an incorrect assert

The 'to' can go negative when the first region gets removed
(it gets incremented by to 0 immediately afterward), which
makes the assertion fail. Nothing breaks if
to < 0 here so just remove the assert.

Tested-by: David Ahern <daahern@cisco.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>