]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agoVersion 0.15.1 stable-0.15 origin/stable-0.15 v0.15.1
Justin M. Forbes [Tue, 11 Oct 2011 14:46:03 +0000 (09:46 -0500)]
Version 0.15.1

Signed-off-by: Justin M. Forbes <jforbes@redhat.com>
12 years agoqed: fix use-after-free during l2 cache commit
Stefan Hajnoczi [Fri, 30 Sep 2011 10:39:11 +0000 (11:39 +0100)]
qed: fix use-after-free during l2 cache commit

QED's metadata caching strategy allows two parallel requests to race for
metadata lookup.  The first one to complete will populate the metadata
cache and the second one will drop the data it just read in favor of the
cached data.

There is a use-after-free in qed_read_l2_table_cb() and
qed_commit_l2_update() where l2_table->offset was used after the
l2_table may have been freed due to a metadata lookup race.  Fix this by
keeping the l2_offset in a local variable and not reaching into the
possibly freed l2_table.

Reported-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.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 agoFix termination by signal with -no-shutdown
Kevin Wolf [Wed, 14 Sep 2011 13:38:40 +0000 (15:38 +0200)]
Fix termination by signal with -no-shutdown

On signals such as SIGTERM qemu should exit instead of just stopping the VM
even with -no-shutdown.

Signed-off-by: Kevin Wolf <kwolf@redhat.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 agoCheck for presence of compiler -pthread flag.
Brad [Mon, 8 Aug 2011 00:02:11 +0000 (20:02 -0400)]
Check for presence of compiler -pthread flag.

OpenBSD / FreeBSD and some other OS's require the use of
cc -pthread to link threaded programs so have QEMU's
configure script check for the presence of the flag
and use it if so.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoAllow overriding the location of Samba's smbd.
Brad [Fri, 2 Sep 2011 20:53:28 +0000 (16:53 -0400)]
Allow overriding the location of Samba's smbd.

Allow overriding the location of Samba's smbd.

Pretty much every OS I look at has some means of
changing this path (patching) so lets just make
it easier for OS developers creating packages
and/or end users to override the location.

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix linker scripts
Gerd Hoffmann [Fri, 26 Aug 2011 09:16:10 +0000 (11:16 +0200)]
Fix linker scripts

Remove PROVIDE_HIDDEN and ONLY_IF_{RO,RW} from linker scripts to make
them work with older binutils versions.  Fixes *-bsd-user build on
OpenBSD 4.9 which ships binutils 2.15.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix install(1) usage to be compatible with OpenBSD's install(1).
Brad [Sun, 28 Aug 2011 08:01:33 +0000 (04:01 -0400)]
Fix install(1) usage to be compatible with OpenBSD's install(1).

Fix install(1) usage to be compatible with OpenBSD's install(1).

When creating a directory via the -d flag the -p flag cannot be
used at the same time. Also in the context of installing QEMU it
doesn't make sense to use the -p flag anyway so use the [default]
-c flag instead.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoFix qjson test of solidus encoding
Jan Kiszka [Fri, 26 Aug 2011 17:52:11 +0000 (19:52 +0200)]
Fix qjson test of solidus encoding

"\/" is supposed to be decoded as "/", but there is no need to encode
"/" via escape. Fix the existing test and add a second one expressing
this.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agoconfigure: Copy test data to build directory
Luiz Capitulino [Fri, 26 Aug 2011 18:00:13 +0000 (15:00 -0300)]
configure: Copy test data to build directory

The QDict unit-tests (check-qdict) will fail when ran on a different
build directory. That's, it only works when ran on the source dir.

This happens because its data file (qdict-test-data.txt) is not
copied to the build dir. Fix it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Conflicts:

configure

12 years agomonitor: fix build breakage for !CONFIG_VNC
Jamie Iles [Wed, 10 Aug 2011 14:18:42 +0000 (15:18 +0100)]
monitor: fix build breakage for !CONFIG_VNC

Commit c62f6d1 (monitor: fix build breakage with --disable-vnc)
conditionalised some VNC setup code but left an unused variable.  Move
the variable into the conditional code to fix the build breakage.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
12 years agomonitor: fix build breakage with --disable-vnc
TeLeMan [Mon, 25 Jul 2011 08:29:14 +0000 (16:29 +0800)]
monitor: fix build breakage with --disable-vnc

The breakage was introduced by the commit 13661089810d3e59931f3e80d7cb541b99af7071

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.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 agoMerge branch 'stable-0.15' of git://git.qemu.org/qemu
Justin M. Forbes [Sun, 14 Aug 2011 15:55:05 +0000 (10:55 -0500)]
Merge branch 'stable-0.15' of git://git.qemu.org/qemu

12 years agoUpdate version to 0.15.0 v0.15.0
Anthony Liguori [Mon, 8 Aug 2011 18:27:32 +0000 (13:27 -0500)]
Update version to 0.15.0

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>
(cherry picked from commit 35d7ace74bd07e3d6983c1fd7cbfab4e11175689)

12 years agoMerge branch 'stable-0.15' of git://git.qemu.org/qemu
Justin M. Forbes [Thu, 4 Aug 2011 21:40:07 +0000 (16:40 -0500)]
Merge branch 'stable-0.15' of git://git.qemu.org/qemu

12 years agoRevert "floppy: save and restore DIR register" v0.15.0-rc2
Anthony Liguori [Thu, 4 Aug 2011 20:28:01 +0000 (15:28 -0500)]
Revert "floppy: save and restore DIR register"

This reverts commit 7d905f716bea633f2836e1d661387983aacdc6d6.

The use of subsections by this commit are broken because of a fundamental
limitations of subsections in the current protocol.

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 agovhost build fix for i386
Wolfgang Mauerer [Mon, 11 Jul 2011 12:57:43 +0000 (14:57 +0200)]
vhost build fix for i386

vhost.c uses __sync_fetch_and_and(), which is only
available for -march=i486 and above (see
https://bugzilla.redhat.com/show_bug.cgi?id=624279).

Signed-off-by: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
(cherry picked from commit 023367e6cd41199521613674b44e9c703c8be1a1)

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 agouser: Restore debug usage message for '-d ?' in user mode emulation
Peter Maydell [Sat, 30 Jul 2011 12:18:35 +0000 (13:18 +0100)]
user: Restore debug usage message for '-d ?' in user mode emulation

The code which prints the debug usage message on '-d ?' for *-user
has to come before the check for "not enough arguments", so that
"qemu-foo -d ?" prints the list of possible debug log items rather than
the generic usage message. (This was inadvertently broken in commit
c235d73.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
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 agouser: Restore debug usage message for '-d ?' in user mode emulation
Peter Maydell [Sat, 30 Jul 2011 12:18:35 +0000 (13:18 +0100)]
user: Restore debug usage message for '-d ?' in user mode emulation

The code which prints the debug usage message on '-d ?' for *-user
has to come before the check for "not enough arguments", so that
"qemu-foo -d ?" prints the list of possible debug log items rather than
the generic usage message. (This was inadvertently broken in commit
c235d73.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoMakefile: add missing deps on $(GENERATED_HEADERS)
Michael Roth [Tue, 26 Jul 2011 16:39:24 +0000 (11:39 -0500)]
Makefile: add missing deps on $(GENERATED_HEADERS)

This fixes a build issue with make -j6+ due to qapi-generated files
being built before $(GENERATED_HEADERS) have been created.

Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoUpdate version to 0.15.0-rc2
Anthony Liguori [Sun, 31 Jul 2011 20:38:11 +0000 (15:38 -0500)]
Update version to 0.15.0-rc2

12 years agoBump version to 0.15.0-rc1 v0.15.0-rc1
Anthony Liguori [Fri, 29 Jul 2011 22:14:11 +0000 (17:14 -0500)]
Bump version to 0.15.0-rc1

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge branch 'for-upstream-0.15' of git://git.linaro.org/people/pmaydell/qemu-arm
Justin M. Forbes [Fri, 29 Jul 2011 15:14:01 +0000 (10:14 -0500)]
Merge branch 'for-upstream-0.15' of git://git.linaro.org/people/pmaydell/qemu-arm

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 agotarget-arm: UNDEF on a VCVTT/VCVTB UNPREDICTABLE to avoid TCG assert
Peter Maydell [Fri, 22 Jul 2011 00:51:20 +0000 (00:51 +0000)]
target-arm: UNDEF on a VCVTT/VCVTB UNPREDICTABLE to avoid TCG assert

VCVTT/VCVTB with bit 8 set is UNPREDICTABLE; we choose to UNDEF.
This avoids a TCG assert later when the VCVTT/VCVTB code tries to
use a source register that wasn't ever set up.

We pull the check for the presence of the half-precision extension
up in to this common code as well.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Handle UNDEF and UNPREDICTABLE cases for VLDM, VSTM
Peter Maydell [Fri, 22 Jul 2011 00:51:19 +0000 (00:51 +0000)]
target-arm: Handle UNDEF and UNPREDICTABLE cases for VLDM, VSTM

Handle the UNDEF and UNPREDICTABLE cases for VLDM and VSTM. In
particular, we now generate an undef exception for overlarge imm8
values rather than generating 1000+ TCG ops and hitting an assertion.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Support v6 barriers in linux-user mode
Peter Maydell [Thu, 21 Jul 2011 07:01:51 +0000 (07:01 +0000)]
target-arm: Support v6 barriers in linux-user mode

ARMv6 implemented various operations as special cases of cp15 accesses
which are true instructions in v7; this includes barriers (DMB, DSB, ISB).
Catch this special case at translate time, so that it works in linux-user
mode (which doesn't provide a functional get_cp15 helper) as well as
system mode.

Includes minor cleanup of the existing cases (single switch statement,
and doing the "OK in user mode?" test explicitly rather than hiding it in
cp15_user_ok()).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-arm: Mark 1136r1 as a v6K core
Peter Maydell [Wed, 20 Jul 2011 10:32:55 +0000 (10:32 +0000)]
target-arm: Mark 1136r1 as a v6K core

The 1136r1 is actually a v6K core (unlike the 1136r0); mark it as such,
thus enabling the TLS registers, NOP hints, CLREX, half and byte wide
exclusive load/stores, etc.

The VA-to-PA translation registers are not present on 1136r1, so
introduce a new feature flag for them, which is enabled on
11MPCore and all v7 cores.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
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 agoLet users select their pythons
Blue Swirl [Fri, 22 Jul 2011 21:08:09 +0000 (21:08 +0000)]
Let users select their pythons

Add configure check for python, exit if not found. Add switches
for specifying the path to python, use the path in Makefile.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agosimpletrace: suppress a warning from unused variable
Blue Swirl [Sat, 23 Jul 2011 21:21:14 +0000 (21:21 +0000)]
simpletrace: suppress a warning from unused variable

Avoid this warning:
  CC    simpletrace.o
/src/qemu/simpletrace.c: In function 'writeout_thread':
/src/qemu/simpletrace.c:122:12: error: variable 'unused' set but not used [-Werror=unused-but-set-variable]
by adding GCC attribute unused to the variable.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoWrap recv to avoid warnings
Blue Swirl [Sat, 23 Jul 2011 20:04:29 +0000 (20:04 +0000)]
Wrap recv to avoid warnings

Avoid warnings like these by wrapping recv():
  CC    slirp/ip_icmp.o
/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]
/usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *'

Remove also casts used to avoid warnings.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix chrdev return value conversion
Blue Swirl [Sat, 23 Jul 2011 19:26:08 +0000 (19:26 +0000)]
Fix chrdev return value conversion

6e1db57b2ac9025c2443c665a0d9e78748637b26 didn't
convert brlapi or win32 chrdevs, breaking build for those.

Fix by converting the chrdevs.

Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqemu-ga: remove dependency on gio and gthread
Anthony Liguori [Sat, 23 Jul 2011 22:57:47 +0000 (17:57 -0500)]
qemu-ga: remove dependency on gio and gthread

As far as I can tell, there isn't a dependency on gthread.  Also, the only use
of gio was to enable GSocket to accept a unix domain socket.

Since GSocket isn't available on OpenSuSE 11.1, let's just remove that
dependency.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoguest-agent: only enable FSFREEZE when it's supported by the kernel
Anthony Liguori [Sat, 23 Jul 2011 21:14:37 +0000 (16:14 -0500)]
guest-agent: only enable FSFREEZE when it's supported by the kernel

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoOpen 1.0 development branch.
Anthony Liguori [Sat, 23 Jul 2011 16:57:53 +0000 (11:57 -0500)]
Open 1.0 development branch.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoBump version to reflect v0.15.0-rc0 v0.15.0-rc0
Anthony Liguori [Sat, 23 Jul 2011 16:56:07 +0000 (11:56 -0500)]
Bump version to reflect v0.15.0-rc0

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoCorrect spelling of licensed
Matthew Fernandez [Sun, 26 Jun 2011 02:21:35 +0000 (12:21 +1000)]
Correct spelling of licensed

Correct typos of "licenced" to "licensed".

Reviewed-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Andreas F=E4rber <andreas.faerber@web.de>
Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoRegister Linux dyntick timer as per-thread signal
Jan Kiszka [Fri, 17 Jun 2011 09:25:49 +0000 (11:25 +0200)]
Register Linux dyntick timer as per-thread signal

Derived from kvm-tool patch
http://thread.gmane.org/gmane.comp.emulators.kvm.devel/74309

Ingo Molnar pointed out that sending the timer signal to the whole
process, just blocking it everywhere, is suboptimal with an increasing
number of threads. QEMU is also using this pattern so far.

Linux provides a (non-portable) way to restrict the signal to a single
thread: We can use SIGEV_THREAD_ID unless we are forced to emulate
signalfd via an additional thread. That case could theoretically be
optimized as well, but it doesn't look worth bothering.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomc146818rtc: Handle host clock resets
Jan Kiszka [Mon, 20 Jun 2011 12:06:28 +0000 (14:06 +0200)]
mc146818rtc: Handle host clock resets

Make use of the new clock reset notifier to update the RTC whenever
rtc_clock is the host clock and that happens to jump backward. This
avoids that the RTC stalls for the period the host clock was set back.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-timer: Introduce clock reset notifier
Jan Kiszka [Mon, 20 Jun 2011 12:06:27 +0000 (14:06 +0200)]
qemu-timer: Introduce clock reset notifier

QEMU_CLOCK_HOST is based on the system time which may jump backward in
case the admin or NTP adjusts it. RTC emulations and other device models
can suffer in this case as timers will stall for the period the clock
was tuned back.

This adds a detection mechanism that checks on every host clock readout
if the new time is before the last result. If that is the case a
notifier list is informed. Device models interested in this event can
register a notifier with the clock.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agonotifier: Pass data argument to callback
Jan Kiszka [Mon, 20 Jun 2011 12:06:26 +0000 (14:06 +0200)]
notifier: Pass data argument to callback

This allows to pass additional information to the notifier callback
which is useful if sender and receiver do not share any other distinct
data structure.

Will be used first for the clock reset notifier.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoide: Turn properties any IDE device must have into bus properties
Markus Armbruster [Thu, 19 May 2011 11:37:17 +0000 (13:37 +0200)]
ide: Turn properties any IDE device must have into bus properties

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovirtio-serial: Turn props any virtio-serial-bus device must have into bus props
Markus Armbruster [Thu, 19 May 2011 11:37:16 +0000 (13:37 +0200)]
virtio-serial: Turn props any virtio-serial-bus device must have into bus props

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovirtio-serial: Clean up virtser_bus_dev_print() output
Markus Armbruster [Thu, 19 May 2011 11:37:15 +0000 (13:37 +0200)]
virtio-serial: Clean up virtser_bus_dev_print() output

Old version looks like this in info qtree (last four lines):

          dev: virtconsole, id ""
            dev-prop: is_console = 1
            dev-prop: nr = 0
            dev-prop: chardev = <null>
            dev-prop: name = <null>
             dev-prop-int: id: 0
             dev-prop-int: guest_connected: 1
             dev-prop-int: host_connected: 0
             dev-prop-int: throttled: 0

Indentation is off, and "dev-prop-int" suggests these are properties
you can configure with -device, which isn't the case.  The other
buses' print_dev() callbacks don't do that.  For instance, PCI's
output looks like this:

        class Ethernet controller, addr 00:03.0, pci id 1af4:1000 (sub 1af4:0001)
        bar 0: i/o at 0xffffffffffffffff [0x1e]
        bar 1: mem at 0xffffffffffffffff [0xffe]
        bar 6: mem at 0xffffffffffffffff [0xfffe]

Change virtser_bus_dev_print() to that style.  Result:

          dev: virtconsole, id ""
            dev-prop: is_console = 1
            dev-prop: nr = 0
            dev-prop: chardev = <null>
            dev-prop: name = <null>
            port 0, guest on, host off, throttle off

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agousb-ccid: Drop unused CCIDCardInfo callback print()
Markus Armbruster [Thu, 19 May 2011 11:37:14 +0000 (13:37 +0200)]
usb-ccid: Drop unused CCIDCardInfo callback print()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoRemove unused USES_X509_AUTH macro from VNC sasl code
Daniel P. Berrange [Thu, 23 Jun 2011 12:31:43 +0000 (13:31 +0100)]
Remove unused USES_X509_AUTH macro from VNC sasl code

The USES_X509_AUTH macro is defined in several VNC files,
but not used in all of them. Remove the unused definition.

* ui/vnc-auth-sasl.c: Remove USES_X509_AUTH macro

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoIntroduce a 'client_add' monitor command accepting an open FD
Daniel P. Berrange [Thu, 23 Jun 2011 12:31:42 +0000 (13:31 +0100)]
Introduce a 'client_add' monitor command accepting an open FD

Allow client connections for VNC and socket based character
devices to be passed in over the monitor using SCM_RIGHTS.

One intended usage scenario is to start QEMU with VNC on a
UNIX domain socket. An unprivileged user which cannot access
the UNIX domain socket, can then connect to QEMU's VNC server
by passing an open FD to libvirt, which passes it onto QEMU.

 { "execute": "get_fd", "arguments": { "fdname": "myclient" } }
 { "return": {} }
 { "execute": "add_client", "arguments": { "protocol": "vnc",
                                           "fdname": "myclient",
                                           "skipauth": true } }
 { "return": {} }

In this case 'protocol' can be 'vnc' or 'spice', or the name
of a character device (eg from -chardev id=XXXX)

The 'skipauth' parameter can be used to skip any configured
VNC authentication scheme, which is useful if the mgmt layer
talking to the monitor has already authenticated the client
in another way.

* console.h: Define 'vnc_display_add_client' method
* monitor.c: Implement 'client_add' command
* qemu-char.c, qemu-char.h: Add 'qemu_char_add_client' method
* qerror.c, qerror.h: Add QERR_ADD_CLIENT_FAILED
* qmp-commands.hx: Declare 'client_add' command
* ui/vnc.c: Implement 'vnc_display_add_client' method

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoStore VNC auth scheme per-client as well as per-server
Daniel P. Berrange [Thu, 23 Jun 2011 12:31:41 +0000 (13:31 +0100)]
Store VNC auth scheme per-client as well as per-server

A future patch will introduce a situation where different
clients may have different authentication schemes set.
When a new client arrives, copy the 'auth' and 'subauth'
fields from VncDisplay into the client's VncState, and
use the latter in all authentication functions.

* ui/vnc.h: Add 'auth' and 'subauth' to VncState
* ui/vnc-auth-sasl.c, ui/vnc-auth-vencrypt.c,
  ui/vnc.c: Make auth functions pull auth scheme
  from VncState instead of VncDisplay

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agodo not reset no_shutdown after we shutdown the vm
Wen Congyang [Fri, 17 Jun 2011 02:25:22 +0000 (10:25 +0800)]
do not reset no_shutdown after we shutdown the vm

Daniel P. Berrange sent a libvirt's patch to support
reboots with the QEMU driver. He implements it in
json model like this:
1. add -no-shutdown in the qemu's option:
   qemu -no-shutdown xxxx
2. shutdown the vm by monitor command system_powerdown
3. wait for shutdown event
4. reset the vm by monitor command system_reset

no_shutdown will be reset to 0 if the vm is powered down.
We only can reboot the vm once.

If no_shutdown is not reset to 0, we can reboot the vm
many times.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovl.c: Don't limit node count by smp count
Sasha Levin [Thu, 30 Jun 2011 03:29:39 +0000 (23:29 -0400)]
vl.c: Don't limit node count by smp count

[I've sent this patch couple of months ago and noticed it
 didn't make it's way in - so I'm sending it again]

It is possible to create CPU-less NUMA nodes, node amount shouldn't be
limited by amount of CPUs.

Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Acked-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovga: Fix type of lfb/map_addr/end.
Richard Henderson [Tue, 14 Jun 2011 19:53:08 +0000 (12:53 -0700)]
vga: Fix type of lfb/map_addr/end.

These addresses have been passed through pci_to_cpu_addr,
and thus need to be full target_phys_addr_t.

Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-char: Print strerror message on failure
Kevin Wolf [Wed, 1 Jun 2011 11:29:11 +0000 (13:29 +0200)]
qemu-char: Print strerror message on failure

The only way for chardev drivers to communicate an error was to return a NULL
pointer, which resulted in an error message that said _that_ something went
wrong, but not _why_.

This patch changes the interface to return 0/-errno and updates
qemu_chr_open_opts to use strerror to display a more helpful error message.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-timer: change unix timer to dynticks
Paolo Bonzini [Thu, 9 Jun 2011 11:10:25 +0000 (13:10 +0200)]
qemu-timer: change unix timer to dynticks

A timer that wakes up every millisecond puts a lot of stress on the
iothread.  The large amount of IPIs causes very high context switch
activity, making emulation slow and the UI unusable.  This is by the
way the same reason why the Windows timers were switched to dynticks.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoiothread: replace fair_mutex with a condition variable
Paolo Bonzini [Thu, 9 Jun 2011 11:10:24 +0000 (13:10 +0200)]
iothread: replace fair_mutex with a condition variable

This conveys the intention better, and scales to more than >1
threads contending the mutex with the iothread (as long as all
of them have a "quiescent point" like the TCG thread has).

Also, on Mac OS X the fair_mutex somehow didn't work as intended
and deadlocked.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomultiboot: Support commas in module parameters
Adam Lackorzynski [Wed, 6 Jul 2011 08:03:57 +0000 (10:03 +0200)]
multiboot: Support commas in module parameters

Support commas in the parameter list of multiboot modules as well as for the
kernel command line, by using double commas (via get_opt_value()).

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoreport serial devices created with -device in the PIIX4 config space
Paolo Bonzini [Fri, 15 Jul 2011 15:10:15 +0000 (17:10 +0200)]
report serial devices created with -device in the PIIX4 config space

Serial and parallel devices created with -device are not reported in
the PIIX4 configuration space, and are hence not picked up by the DSDT.
This upsets Windows, which hides them altogether from the guest.

To avoid this, check at the end of machine initialization whether the
corresponding I/O ports have been registered.  The new function in
ioport.c does this; this also requires a tweak to isa_unassign_ioport.

I left the comment in piix4_pm_initfn since the registers I moved do
seem to match the 82371AB datasheet.  There are some quirks though.
We are setting this bit:

    "Device 8 EIO Enable (EIO_EN_DEV8)—R/W. 1=Enable PCI access to the
    device 8 enabled I/O ranges to be claimed by PIIX4 and forwarded
    to the ISA/EIO bus. 0=Disable. The LPT_MON_EN must be set to enable
    the decode."

but not LPT_MON_EN (bit 18 at 50h):

    LPT Port Enable (LPT_MON_EN)—R/W. 1=Enable accesses to parallel
    port address range (LPT_DEC_SEL) to generate a device 8 (parallel
    port) decode event. 0=Disable.

We're also setting the LPT_DEC_SEL field (that's the 0x60 written to
63h) to 11, which means reserved, rather than to 01 (378h-37Fh).

Likewise we're not setting SA_MON_EN, SB_MON_EN (respectively bit 14
and bit 16 at address 50h) for the serial ports.  However, we're setting
COMA_DEC_SEL and COMB_DEC_SEL correctly, unlike the corresponding register
for the parallel port.

All these fields are left as they are, since they are probably only
meant to be used in the DSDT.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years ago.gitignore: ignore qemu-ga and qapi-generated
Alexandre Raymond [Sat, 23 Jul 2011 05:41:57 +0000 (01:41 -0400)]
.gitignore: ignore qemu-ga and qapi-generated

Add a new binary and generation directory to the gitignore file

Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoguest agent: use QERR_UNSUPPORTED for disabled RPCs
Michael Roth [Fri, 22 Jul 2011 21:42:00 +0000 (16:42 -0500)]
guest agent: use QERR_UNSUPPORTED for disabled RPCs

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agonet: Consistently use qemu_macaddr_default_if_unset
Jan Kiszka [Wed, 20 Jul 2011 10:20:22 +0000 (12:20 +0200)]
net: Consistently use qemu_macaddr_default_if_unset

Drop the open-coded MAC assignment from net_init_nic and replace it with
standard qemu_macaddr_default_if_unset which is also used by qdev. That
avoid creating colliding MACs when instantiating NICs via different
mechanisms.

This change requires to store the MAC as MACAddr in NICInfo, and the
remaining nd_table users need to be updated.

Based on suggestion by Peter Maydell.

CC: Markus Armbruster <armbru@redhat.com>
CC: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agonet: Dump client type 'info network'
Jan Kiszka [Wed, 20 Jul 2011 10:20:21 +0000 (12:20 +0200)]
net: Dump client type 'info network'

Include the client type name into the output of 'info network'. The
result looks like this:

(qemu) info network
VLAN 0 devices:
  rtl8139.0: type=nic,model=rtl8139,macaddr=52:54:00:12:34:57
Devices not on any VLAN:
  virtio-net-pci.0: type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
   \ network1: type=tap,fd=5

CC: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agonet: Refactor net_client_types
Jan Kiszka [Wed, 20 Jul 2011 10:20:20 +0000 (12:20 +0200)]
net: Refactor net_client_types

Position entries of net_client_types according to the corresponding
values of NET_CLIENT_TYPE_*. The array size is now defined by
NET_CLIENT_TYPE_MAX. This will allow to obtain entries based on type
value in later patches.

At this chance rename NET_CLIENT_TYPE_SLIRP to NET_CLIENT_TYPE_USER for
the sake of consistency.

CC: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agonet: Improve layout of 'info network'
Jan Kiszka [Wed, 20 Jul 2011 10:20:19 +0000 (12:20 +0200)]
net: Improve layout of 'info network'

Improve the layout when listing non-vlan clients via 'info network'. The
result looks like this:

(qemu) info network
Devices not on any VLAN:
  orphan: net=10.0.2.0, restricted=n
  virtio-net-pci.0: model=virtio-net-pci,macaddr=52:54:00:12:34:56
   \ network2: fd=5
  e1000.0: model=e1000,macaddr=52:54:00:12:34:57
   \ network1: net=10.0.2.0, restricted=n
  rtl8139.0: model=rtl8139,macaddr=52:54:00:12:34:58

ie. peers are grouped, orphans are listed as before.

CC: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Forward ICMP echo requests via unprivileged sockets
Jan Kiszka [Wed, 20 Jul 2011 10:20:18 +0000 (12:20 +0200)]
slirp: Forward ICMP echo requests via unprivileged sockets

Linux 3.0 gained support for unprivileged ICMP ping sockets. Use this
feature to forward guest pings to the outer world. The host admin has to
set the ping_group_range in order to grant access to those sockets. To
allow ping for the users group (GID 100):

echo 100 100 > /proc/sys/net/ipv4/ping_group_range

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Put forked exec into separate process group
Jan Kiszka [Wed, 20 Jul 2011 10:20:17 +0000 (12:20 +0200)]
slirp: Put forked exec into separate process group

Recent smb daemons tend to terminate themselves via a process group
SIGTERM. If the daemon is still in qemu's group by that time, qemu will
die as well. Avoid this by always pushing fork_exec processes into a
group of their own, not just (unused) type 2 execs.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Replace m_freem with m_free
Jan Kiszka [Wed, 20 Jul 2011 10:20:16 +0000 (12:20 +0200)]
slirp: Replace m_freem with m_free

Remove this pointless wrapping.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Strictly associate DHCP/BOOTP and TFTP with virtual host
Jan Kiszka [Wed, 20 Jul 2011 10:20:15 +0000 (12:20 +0200)]
slirp: Strictly associate DHCP/BOOTP and TFTP with virtual host

Instead of accepting every DHCP/BOOTP and TFTP packet, only invoke the
built-in servers if the target is the virtual host.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Canonicalize restrict syntax
Jan Kiszka [Wed, 20 Jul 2011 10:20:14 +0000 (12:20 +0200)]
slirp: Canonicalize restrict syntax

All other boolean arguments accept on|off - except for slirp's restrict.
Fix that while still accepting the formerly allowed yes|y|no|n, but
reject everything else. This avoids accidentally allowing external
connections because syntax errors were so far interpreted as
'restrict=no'.

CC: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoslirp: Fix restricted mode
Jan Kiszka [Wed, 20 Jul 2011 10:20:13 +0000 (12:20 +0200)]
slirp: Fix restricted mode

This aligns the code to what the documentation claims: Allow everything
but requests that would have to be routed outside of the virtual LAN.

So we need to drop the unneeded IP-level filter, allow TFTP requests,
and add the missing protocol-level filter to ICMP.

CC: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoDeprecate -M command line options
Jan Kiszka [Sat, 23 Jul 2011 10:39:46 +0000 (12:39 +0200)]
Deprecate -M command line options

Superseded by -machine. Therefore, this patch removes -M from the help
list and pushes -machine at the same place in the output.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoGeneralize -machine command line option
Jan Kiszka [Sat, 23 Jul 2011 10:38:37 +0000 (12:38 +0200)]
Generalize -machine command line option

-machine somehow suggests that it selects the machine, but it doesn't.
Fix that before this command is set in stone.

Actually, -machine should supersede -M and allow to introduce arbitrary
per-machine options to the command line. That will change the internal
realization again, but we will be able to keep the user interface
stable.

Tested-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoguest-agent: fix build with OpenBSD
Anthony Liguori [Fri, 22 Jul 2011 19:14:17 +0000 (14:14 -0500)]
guest-agent: fix build with OpenBSD

FS-Freeze only works with Linux.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoxen: fix xen-mapcache build on non-Xen capable targets
Avi Kivity [Wed, 20 Jul 2011 09:14:06 +0000 (12:14 +0300)]
xen: fix xen-mapcache build on non-Xen capable targets

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge remote-tracking branch 'origin/master' into staging
Anthony Liguori [Fri, 22 Jul 2011 16:07:08 +0000 (11:07 -0500)]
Merge remote-tracking branch 'origin/master' into staging

12 years agotarget-sparc: Fix compiler errors (format strings)
Stefan Weil [Fri, 22 Jul 2011 05:44:27 +0000 (07:44 +0200)]
target-sparc: Fix compiler errors (format strings)

This change is needed because commit 06e12b65
now uses an unsigned long long value
(uint64_t && unsigned long long => unsigned long long).

Cc: Tsuneo Saito <tsnsaito@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge remote-tracking branch 'spice/spice.v39' into staging
Anthony Liguori [Fri, 22 Jul 2011 14:24:07 +0000 (09:24 -0500)]
Merge remote-tracking branch 'spice/spice.v39' into staging

12 years agoMerge remote-tracking branch 'qmp/for-anthony' into staging
Anthony Liguori [Fri, 22 Jul 2011 14:23:53 +0000 (09:23 -0500)]
Merge remote-tracking branch 'qmp/for-anthony' into staging

12 years agoMerge remote-tracking branch 'kraxel/usb.21' into staging
Anthony Liguori [Fri, 22 Jul 2011 14:23:49 +0000 (09:23 -0500)]
Merge remote-tracking branch 'kraxel/usb.21' into staging

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Fri, 22 Jul 2011 14:23:43 +0000 (09:23 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

12 years agoUSB: add usb network redirection support
Hans de Goede [Tue, 19 Jul 2011 09:04:10 +0000 (11:04 +0200)]
USB: add usb network redirection support

This patch adds support for a usb-redir device, which takes a chardev
as a communication channel to an actual usbdevice using the usbredir protocol.

Compiling the usb-redir device requires usbredir-0.3 to be installed for
the usbredir protocol parser, usbredir-0.3 also contains a server for
redirecting usb traffic from an actual usb device. You can get the 0.3
release of usbredir here:
http://people.fedoraproject.org/~jwrdegoede/usbredir-0.3.tar.bz2
(getting a more formal site for it is a WIP)

Example usage:
1) Start usbredirserver for a usb device:
sudo usbredirserver 045e:0772
2) Start qemu with usb2 support + a chardev talking to usbredirserver +
   a usb-redir device using this chardev:
qemu ... \
  -readconfig docs/ich9-ehci-uhci.cfg \
  -chardev socket,id=usbredirchardev,host=localhost,port=4000 \
  -device usb-redir,chardev=usbredirchardev,id=usbredirdev

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: trace: rename "next" to "nxt".
Gerd Hoffmann [Wed, 20 Jul 2011 13:44:01 +0000 (15:44 +0200)]
usb-ehci: trace: rename "next" to "nxt".

"next" is reserved in systemtap thus using this as a
trace parameter name causes trouble when trying to trace
with systemtap.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-uhci: fix irq handling on error.
Gerd Hoffmann [Fri, 8 Jul 2011 15:28:11 +0000 (17:28 +0200)]
usb-uhci: fix irq handling on error.

Spec on UHCI_STS_USBERR: "If the TD on which the error interrupt
occurred also had its IOC bit set, both this bit and Bit 0 are set."

Make UHCI emulation do that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hid: fixup changed tracking.
Gerd Hoffmann [Fri, 8 Jul 2011 11:19:01 +0000 (13:19 +0200)]
usb-hid: fixup changed tracking.

Remove leftover calls to usb_hid_changed().

Take care to update the changed flag after delivering a event via
GET_REPORT like we do when sending events via interrupt endpoint.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoSPARC64: implement addtional MMU faults related to nonfaulting load
Tsuneo Saito [Thu, 21 Jul 2011 15:16:33 +0000 (00:16 +0900)]
SPARC64: implement addtional MMU faults related to nonfaulting load

This patch implements MMU faults caused by TTE.NFO and TTE.E:
- access other than nonfaulting load to a page marked NFO should
  raise data_access_exception
- nonfaulting load to a page marked with E bit should raise
  data_access_exception

To distinguish nonfaulting loads, this patch extends (abuses?) the rw
argument of get_physical_address_data().  rw is set to 4 on nonfaulting
loads.

Signed-off-by: Tsuneo Saito <tsnsaito@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>