]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
11 years agoblockdev: Rename BlockdevAction -> TransactionAction
Kevin Wolf [Mon, 13 May 2013 08:43:43 +0000 (10:43 +0200)]
blockdev: Rename BlockdevAction -> TransactionAction

There's no reason to restrict transactions to operations related to
block devices, so rename the type now before schema introspection stops
us from doing so.

Also change the schema documentation of 'transaction' to not refer to
block devices or snapshots any more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: make all steps in qmp_transaction() as callback
Wenchao Xia [Wed, 8 May 2013 10:25:16 +0000 (18:25 +0800)]
block: make all steps in qmp_transaction() as callback

Make it easier to add other operations to qmp_transaction() by using
callbacks, with external snapshots serving as an example implementation
of the callbacks.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: package rollback code in qmp_transaction()
Wenchao Xia [Wed, 8 May 2013 10:25:15 +0000 (18:25 +0800)]
block: package rollback code in qmp_transaction()

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: package committing code in qmp_transaction()
Wenchao Xia [Wed, 8 May 2013 10:25:14 +0000 (18:25 +0800)]
block: package committing code in qmp_transaction()

The code is simply moved into a separate function.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: move input parsing code in qmp_transaction()
Wenchao Xia [Wed, 8 May 2013 10:25:13 +0000 (18:25 +0800)]
block: move input parsing code in qmp_transaction()

The code is moved into preparation function, and changed
a bit to tip more clearly what it is doing.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: package preparation code in qmp_transaction()
Wenchao Xia [Wed, 8 May 2013 10:25:12 +0000 (18:25 +0800)]
block: package preparation code in qmp_transaction()

The code before really committing is moved into a function. Most
code is simply moved from qmp_transaction(), except that on fail it
just returns now. Other code such as input parsing is not touched,
to make it easier in review.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Thu, 23 May 2013 19:16:34 +0000 (14:16 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Michael Roth (10) and others
# Via Luiz Capitulino
* luiz/queue/qmp:
  monitor: allow to disable the default monitor
  ui/input.c: replace magic numbers with macros
  qapi: add native list coverage for QMP input visitor tests
  qapi: add native list coverage for QMP output visitor tests
  qapi: add native list coverage for visitor serialization tests
  qapi: fix visitor serialization tests for numbers/doubles
  qapi: add QMP input test for large integers
  json-parser: fix handling of large whole number values
  qapi: enable generation of native list code
  qapi: qapi-visit.py, native list support
  qapi: qapi-visit.py, fix list handling for union types
  qapi: qapi-types.py, native list support

Message-id: 1369333232-24145-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomonitor: allow to disable the default monitor
Luiz Capitulino [Thu, 16 May 2013 16:02:55 +0000 (12:02 -0400)]
monitor: allow to disable the default monitor

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoui/input.c: replace magic numbers with macros
Amos Kong [Thu, 16 May 2013 05:19:47 +0000 (13:19 +0800)]
ui/input.c: replace magic numbers with macros

It's clearer to use defined macros than magic numbers.

Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Lei Li <lilei@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: add native list coverage for QMP input visitor tests
Michael Roth [Fri, 10 May 2013 22:46:10 +0000 (17:46 -0500)]
qapi: add native list coverage for QMP input visitor tests

This exercises schema-generated visitors for native list types and does
some sanity checking on validity of deserialized data.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: add native list coverage for QMP output visitor tests
Michael Roth [Fri, 10 May 2013 22:46:09 +0000 (17:46 -0500)]
qapi: add native list coverage for QMP output visitor tests

This exercises schema-generated visitors for native list types and does
some sanity checking on validity of serialized data.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: add native list coverage for visitor serialization tests
Michael Roth [Fri, 10 May 2013 22:46:08 +0000 (17:46 -0500)]
qapi: add native list coverage for visitor serialization tests

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: fix visitor serialization tests for numbers/doubles
Michael Roth [Fri, 10 May 2013 22:46:07 +0000 (17:46 -0500)]
qapi: fix visitor serialization tests for numbers/doubles

We never actually stored the stringified double values into the strings
before we did the comparisons. This left number/double values completely
uncovered in test-visitor-serialization tests.

Fixing this exposed a bug in our handling of large whole number values
in QEMU's JSON parser which is now fixed.

Simplify the code while we're at it by dropping the
calc_float_string_storage() craziness in favor of GStrings.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: add QMP input test for large integers
Michael Roth [Fri, 10 May 2013 22:46:06 +0000 (17:46 -0500)]
qapi: add QMP input test for large integers

Large integers previously got capped to LLONG_MAX/LLONG_MIN so we could
store them as int64_t. This could lead to silent errors occuring.

Now, we use a double to handle these cases.

Add a test to confirm that QMPInputVisitor handles this as expected if
we're expected an integer value: errors for out of range integer values
that got promoted to doubles in this fashion.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agojson-parser: fix handling of large whole number values
Michael Roth [Fri, 10 May 2013 22:46:05 +0000 (17:46 -0500)]
json-parser: fix handling of large whole number values

Currently our JSON parser assumes that numbers lacking a fractional
value are integers and attempts to store them as QInt/int64 values. This
breaks in the case where the number overflows/underflows int64 values (which
is still valid JSON)

Fix this by detecting such cases and using a QFloat to store the value
instead.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: enable generation of native list code
Michael Roth [Fri, 10 May 2013 22:46:03 +0000 (17:46 -0500)]
qapi: enable generation of native list code

Also, fix a dependency issue with libqemuutil: qemu-sockets.c needs
qapi-types.c/qapi-visit.c

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: qapi-visit.py, native list support
Michael Roth [Fri, 10 May 2013 22:46:02 +0000 (17:46 -0500)]
qapi: qapi-visit.py, native list support

Teach visitor generators about native types so they can generate the
appropriate visitor routines.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: qapi-visit.py, fix list handling for union types
Michael Roth [Fri, 10 May 2013 22:46:01 +0000 (17:46 -0500)]
qapi: qapi-visit.py, fix list handling for union types

Currently we assume non-list types when generating visitor routines for
union types. This is broken, since values like ['Type'] need to mapped
to 'TypeList'.

We already have a type_name() function to handle this that we use for
generating struct visitors, so use that here as well.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: qapi-types.py, native list support
Michael Roth [Fri, 10 May 2013 22:46:00 +0000 (17:46 -0500)]
qapi: qapi-types.py, native list support

Teach type generators about native types so they can generate the
appropriate linked list types.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoMerge remote-tracking branch 'mjt/trivial-patches' into staging
Anthony Liguori [Wed, 22 May 2013 13:22:36 +0000 (08:22 -0500)]
Merge remote-tracking branch 'mjt/trivial-patches' into staging

# By Christophe Lyon (1) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  target-moxie: replace target_phys_addr_t with hwaddr
  Rename hexdump to avoid FreeBSD libutil conflict
  remove some double-includes
  translate: remove redundantly included qemu/timer.h
  Remove twice include of qemu-common.h
  fix /proc/self/maps output

Message-id: 51977B44.1000302@msgid.tls.msk.ru
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopci-assign: Add MSI affinity support
Alex Williamson [Mon, 13 May 2013 20:20:02 +0000 (14:20 -0600)]
pci-assign: Add MSI affinity support

To support guest MSI affinity changes update the MSI message any time
the guest writes to the address or data fields.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20130513201840.5430.86331.stgit@bling.home
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-net: dynamic network offloads configuration
Dmitry Fleytman [Mon, 20 May 2013 08:18:14 +0000 (11:18 +0300)]
virtio-net: dynamic network offloads configuration

Virtio-net driver currently negotiates network offloads
on startup via features mechanism and have no ability to
disable and re-enable offloads later.
This patch introduced a new control command that allows
to configure device network offloads state dynamically.
The patch also introduces a new feature flag
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20130520081814.GA8162@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agochardev: Get filename for new qapi backend
Lei Li [Tue, 21 May 2013 10:27:59 +0000 (18:27 +0800)]
chardev: Get filename for new qapi backend

This patch sets the filename when the new qapi backend
init from opts.

The previous patch and discussions as link below:

http://patchwork.ozlabs.org/patch/243896/

If anyone who have better idea to fix this please let
me know your suggestions.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Message-id: 1369132079-11377-3-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agochardev: Make the name of memory device consistent
Lei Li [Tue, 21 May 2013 10:27:58 +0000 (18:27 +0800)]
chardev: Make the name of memory device consistent

Now we have memory char device, but the backend name of it
is a little confusion. We actually register it by 'memory', but
the description in qemu-option, the name of open functions
and the new api backend called it 'ringbuf'. It should keep
consistent. This patch named it all to 'memory'.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1369132079-11377-2-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoui/gtk.c: Fix *BSD build of Gtk+ UI
Brad Smith [Tue, 21 May 2013 16:14:24 +0000 (12:14 -0400)]
ui/gtk.c: Fix *BSD build of Gtk+ UI

Fix the build of the Gtk+ UI on *BSD systems.

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 20130521161324.GA29977@rox.home.comstyle.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom/object: Don't poll cast cache for NULL objects
Peter Crosthwaite [Wed, 22 May 2013 01:19:16 +0000 (11:19 +1000)]
qom/object: Don't poll cast cache for NULL objects

object_dynamic_cast_assert used to be tolerant of NULL objects and not
assert. It's clear from the implementation that this is the expected
behavior.

The preceding check of the cast cache dereferences obj however causing
a segfault. Fix by conditionalizing the cast cache logic on obj being
non-null.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 8e2bef6a55753869c50bfa32226f7fcf0439ca62.1369183592.git.peter.crosthwaite@xilinx.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoglib: Fix some misuses of gsize/size_t types
Peter Crosthwaite [Wed, 22 May 2013 03:01:43 +0000 (13:01 +1000)]
glib: Fix some misuses of gsize/size_t types

This unbreaks cross compile builds:

configure --target-list="i386-softmmu" --cpu=i386

When building on a 64bit machine.

Reported-by: David Holsgrove <david.holsgrove@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 926326e96fd8685d74e9d5bf430fe4ad97a55289.1369191585.git.peter.crosthwaite@xilinx.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolinux-user: Save the correct resume address for MIPS signal handling
Kwok Cheung Yeung [Fri, 17 May 2013 21:51:21 +0000 (14:51 -0700)]
linux-user: Save the correct resume address for MIPS signal handling

The current ISA mode needs to be saved in bit 0 of the resume address.
If the current instruction happens to be in a branch delay slot, then
the address of the preceding jump instruction should be stored instead.
exception_resume_pc already does both of these tasks, so it is
made available and reused.

MIPS_HFLAG_BMASK in hflags is cleared, otherwise QEMU may treat the
first instruction of the signal handler as a delay slot instruction.

Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agolinux-user: Fix MIPS ISA transitions during signal handling
Kwok Cheung Yeung [Fri, 17 May 2013 21:51:20 +0000 (14:51 -0700)]
linux-user: Fix MIPS ISA transitions during signal handling

Processors supporting the MIPS16 or microMIPS ISAs set bit 0 in target
addresses to indicate that the target is written using a compressed ISA.

During signal handling, when jumping to or returning from a signal
handler, bit 0 of the destination PC is inspected and MIPS_HFLAG_M16 in
hflags cleared or set accordingly.  Bit 0 of the PC is then cleared.

Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: clean-up in BIT_INSV
Petar Jovanovic [Mon, 13 May 2013 01:35:37 +0000 (03:35 +0200)]
target-mips: clean-up in BIT_INSV

This is a small follow-up change to "fix incorrect behaviour for INSV".

It includes two minor modifications:

- sizefilter is constant so it can be moved inside of the block,
- several lines of the code are replaced with a call to deposit64.

No functional change.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoOpen up 1.6 development
Anthony Liguori [Mon, 20 May 2013 15:55:18 +0000 (10:55 -0500)]
Open up 1.6 development

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoUpdate version for 1.5.0 release.
Anthony Liguori [Mon, 20 May 2013 12:22:02 +0000 (07:22 -0500)]
Update version for 1.5.0 release.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoosdep: fix qemu_anon_ram_free trace (+ fix compilation on 32 bit hosts)
Hervé Poussineau [Mon, 20 May 2013 10:33:08 +0000 (12:33 +0200)]
osdep: fix qemu_anon_ram_free trace (+ fix compilation on 32 bit hosts)

Commit e7a09b92b70786f9e8c5fbf787e0248c6ebbe707 added a trace at each
memory freeing, but unfortunately inverted size and pointer when printing
them. Fix trace.

This also led to a compilation error on 32 bit hosts:
In file included from include/trace.h:4:0,
                 from trace/generated-events.c:3:
./trace/generated-tracers.h: In function ‘trace_qemu_anon_ram_free’:
./trace/generated-tracers.h:64:9: error: format ‘%zu’ expects argument of type
‘size_t’, but argument 3 has type ‘void *’ [-Werror=format]
./trace/generated-tracers.h:64:9: error: format ‘%p’ expects argument of type
‘void *’, but argument 4 has type ‘size_t’ [-Werror=format]

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Message-id: 1369045989-14016-1-git-send-email-hpoussin@reactos.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoRename hexdump to avoid FreeBSD libutil conflict
Ed Maste [Thu, 16 May 2013 15:32:28 +0000 (11:32 -0400)]
Rename hexdump to avoid FreeBSD libutil conflict

On FreeBSD libutil is used for openpty(), but it also provides a hexdump()
which conflicts with QEMU's.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368718348-15199-1-git-send-email-emaste@freebsd.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovl: new runstate transition: RUN_STATE_GUEST_PANICKED -> RUN_STATE_FINISH_MIGRATE
Hu Tao [Mon, 20 May 2013 10:46:20 +0000 (12:46 +0200)]
vl: new runstate transition: RUN_STATE_GUEST_PANICKED -> RUN_STATE_FINISH_MIGRATE

This fixes a problem that after guest panic happens, virsh dump without
--memory-only fails:

ERROR: invalid runstate transition: 'guest-panicked' -> 'finish-migrate'

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1369046780-17498-1-git-send-email-pbonzini@redhat.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agochardev: Make consistent with udp device for new qapi backend
Lei Li [Mon, 20 May 2013 06:51:03 +0000 (14:51 +0800)]
chardev: Make consistent with udp device for new qapi backend

When register and open a chardev udp, the backend name should be udp
not dgram, and we do not have backend dgram in the chardev list. This
patch makes the new qapi udp backend consistent with the original
udp device.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Message-id: 1369032665-18159-2-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoide/macio: fix wrong opaque with TRIM support
Aurelien Jarno [Sun, 19 May 2013 11:22:11 +0000 (13:22 +0200)]
ide/macio: fix wrong opaque with TRIM support

Commit 215e47b9 enabled TRIM by default, which revealed a bug in TRIM
support for the IDE macio emulation driver, introduced in d353fb72.

The call to dma_bdrv_io() is using a wrong opaque of type IDEState
instead of DBDMA_io. This patch fixes that.

Fixes LP#1179104

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: set carry bit correctly in DSPControl register
Petar Jovanovic [Mon, 13 May 2013 15:14:35 +0000 (17:14 +0200)]
target-mips: set carry bit correctly in DSPControl register

First we need to clear the bit and then we set the given value.
Instruction ADDSC sets the bit and instruction ADDWC uses this bit.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: fix EXTPDP and setting up pos field in the DSPControl reg
Petar Jovanovic [Sat, 18 May 2013 01:53:41 +0000 (03:53 +0200)]
target-mips: fix EXTPDP and setting up pos field in the DSPControl reg

This change makes sure that modifications of pos field in the DSPControl
register do not trash other bits in the register. This bug can be triggered
with the additional test case in mips32-dsp/extpdp.c in this commit.

In addition to this, this change corrects incorrect calculation of the mask
for EXTPDP.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-moxie: replace target_phys_addr_t with hwaddr
Hu Tao [Wed, 15 May 2013 06:04:29 +0000 (14:04 +0800)]
target-moxie: replace target_phys_addr_t with hwaddr

target_phys_addr_t has been already replaced by hwaddr, but this
one is introduced after.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoRename hexdump to avoid FreeBSD libutil conflict
Ed Maste [Thu, 16 May 2013 15:32:28 +0000 (11:32 -0400)]
Rename hexdump to avoid FreeBSD libutil conflict

On FreeBSD libutil is used for openpty(), but it also provides a hexdump()
which conflicts with QEMU's.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoremove some double-includes
Michael Tokarev [Tue, 14 May 2013 10:55:17 +0000 (14:55 +0400)]
remove some double-includes

Some source files #include the same header more than
once for no good reason.  Remove second #includes in
such cases.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agotranslate: remove redundantly included qemu/timer.h
liguang [Tue, 30 Apr 2013 02:59:50 +0000 (10:59 +0800)]
translate: remove redundantly included qemu/timer.h

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Reviewed-By: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoRemove twice include of qemu-common.h
Qiao Nuohan [Wed, 8 May 2013 04:39:01 +0000 (12:39 +0800)]
Remove twice include of qemu-common.h

This patch is used to remove twice include of "qemu-common.h" in
block/win32-aio.c

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agofix /proc/self/maps output
Christophe Lyon [Tue, 2 Apr 2013 12:03:38 +0000 (14:03 +0200)]
fix /proc/self/maps output

Add a space at end of line when there is no filename to print, to
conform to linux kernel format (see show_map_vma() in
fs/proc/task_mmu.c).

Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agotarget-mips: fix incorrect behaviour for EXTP
Petar Jovanovic [Mon, 13 May 2013 13:20:26 +0000 (15:20 +0200)]
target-mips: fix incorrect behaviour for EXTP

The mask for EXTP instruction when size=31 has not been correctly
calculated.

The test (mips32-dsp/extp.c) has been extended to include the case that
triggers the issue.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoUpdate version for 1.5.0-rc3 release
Anthony Liguori [Fri, 17 May 2013 15:01:00 +0000 (10:01 -0500)]
Update version for 1.5.0-rc3 release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'mdroth/qga-pull-2013-05-13' into staging
Anthony Liguori [Fri, 17 May 2013 15:00:30 +0000 (10:00 -0500)]
Merge remote-tracking branch 'mdroth/qga-pull-2013-05-13' into staging

* mdroth/qga-pull-2013-05-13:
  qga: unlink just created guest-file if fchmod() or fdopen() fails on it
  qga: distinguish binary modes in "guest_file_open_modes" map

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoRevert "migration: don't account sleep time for calculating bandwidth"
Michael Roth [Thu, 16 May 2013 21:25:44 +0000 (16:25 -0500)]
Revert "migration: don't account sleep time for calculating bandwidth"

This reverts commit 7161082c8d8cf167c508976887a0a63f4db92b51.

Reverting this patch fixes a divide-by-zero error in qemu that can be
fairly reliably triggered by doing block migration. In this case, the
configuration/error was:

source: temp/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -L temp-bios
-M pc-i440fx-1.4 -m 512M -kernel boot/vmlinuz-x86_64 -initrd
boot/test-initramfs-x86_64.img.gz -vga std -append seed=1234 -drive
file=disk1.img,if=virtio -drive file=disk2.img,if=virtio -device
virtio-net-pci,netdev=net0 -netdev user,id=net0 -monitor
unix:/tmp/vm-hmp.sock,server,nowait -qmp
unix:/tmp/vm-qmp.sock,server,nowait -vnc :100

16837 Floating point exception(core dumped)

target: temp/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -L temp-bios
-M pc-i440fx-1.4 -m 512M -kernel boot/vmlinuz-x86_64 -initrd
boot/test-initramfs-x86_64.img.gz -vga std -append seed=1234 -drive
file=target_disk1.img,if=virtio -drive file=target_disk2.img,if=virtio
-device virtio-net-pci,netdev=net0 -netdev user,id=net0 -incoming
unix:/tmp/migrate.sock -monitor
unix:/tmp/vm-hmp-incoming.sock,server,nowait -qmp
unix:/tmp/vm-qmp-incoming.sock,server,nowait -vnc :101

Receiving block device images
20 %
21 %
load of migration failed

This revert potentially re-introduces a bug that was present in 1.4,
but fixes a prevalent issue with block migration so we should revert
it for now and take an updated patch later.

Conflicts:

migration.c

* fixed up to remove logic introduced in 7161082c while leaving
  changes in HEAD intact

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Message-id: 1368739544-31021-1-git-send-email-mdroth@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomain-loop: partial revert of 5e3bc73
Stefan Hajnoczi [Thu, 16 May 2013 15:36:01 +0000 (17:36 +0200)]
main-loop: partial revert of 5e3bc73

This patch reverts part of 5e3bc735d93dd23f074b5116fd11e1ad8cd4962f.

Paolo Bonzini wrote this patch and commented:

"WSAEventSelect is edge-triggered and the event will not be signaled if
the socket handler does not consume all the data in the socket buffer."

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368718561-7816-3-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomain-loop: narrow win32 pollfds_fill() event bitmasks
Stefan Hajnoczi [Thu, 16 May 2013 15:36:00 +0000 (17:36 +0200)]
main-loop: narrow win32 pollfds_fill() event bitmasks

pollfds_fill() and pollfds_poll() translate GPollFD to rfds/wfds/xfds
for sockets on win32.  select(2) is the underlying system call which is
used to monitor sockets for activity.

Currently file descriptors that monitor G_IO_ERR will be included in
both rfds and wfds.  As a result, select(2) will report writability on
file descriptors where we only really wanted to monitor readability
(with errors).

slirp_pollfds_poll() hit this issue: UDP sockets are blocking sockets so
we hang in sorecvfrom() when G_IO_ERR is set due to the socket being
writable (we only wanted to check for readability).

This patch fixes the slirp_pollfds_poll() hang.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1368718561-7816-2-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio: add virtio_bus_get_dev_path.
KONRAD Frederic [Thu, 16 May 2013 17:06:07 +0000 (19:06 +0200)]
virtio: add virtio_bus_get_dev_path.

This adds virtio_bus_get_dev_path to fix migration id string which is wrong
since the virtio refactoring.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368723967-21050-1-git-send-email-fred.konrad@greensocs.com
Cc: mdroth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoUpdate version for 1.5.0-rc2 release
Anthony Liguori [Wed, 15 May 2013 21:38:35 +0000 (16:38 -0500)]
Update version for 1.5.0-rc2 release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Wed, 15 May 2013 19:57:30 +0000 (14:57 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Michael Roth (1) and Zhangleiqiang (1)
# Via Luiz Capitulino
* luiz/queue/qmp:
  qapi: fix leak in unit tests
  qmp: fix handling of cmd with Equals in qmp-shell

Message-id: 1368625179-27962-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqemu-common: Resolve vector build breakes for AltiVec
Paolo Bonzini [Wed, 15 May 2013 15:46:11 +0000 (17:46 +0200)]
qemu-common: Resolve vector build breakes for AltiVec

On Mac OS X ppc, altivec.h defines "vector", leading to build breakage
when used as variable name, e.g. in tracing code.
Fix this by undefining identifiers after altivec.h inclusion.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Message-id: 1368632771-4328-1-git-send-email-andreas.faerber@web.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoide-test: Fix endianness problems
Kevin Wolf [Wed, 15 May 2013 13:00:39 +0000 (15:00 +0200)]
ide-test: Fix endianness problems

The test case passes on big endian hosts now (tested on ppc64)

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1368622839-7084-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohw/pci-host/versatile.c: Provide property for forcing broken IRQ mapping
Peter Maydell [Tue, 14 May 2013 15:33:36 +0000 (16:33 +0100)]
hw/pci-host/versatile.c: Provide property for forcing broken IRQ mapping

Although we try our best to automatically detect broken versions
of Linux which assume the old broken IRQ mapping we used to implement
for our model of the Versatile PCI controller, it turns out that
some particularly new kernels manage to outwit the autodetection.

We therefore provide a property for enabling the old broken IRQ
mapping, so that if users happen to have such a kernel they can
work around its deficiencies with the command line option:
  -global versatile_pci.broken-irq-mapping=1

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1368545616-22344-4-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohw/pci-host/versatile.c: Update autodetect to detect newer kernels
Peter Maydell [Tue, 14 May 2013 15:33:35 +0000 (16:33 +0100)]
hw/pci-host/versatile.c: Update autodetect to detect newer kernels

Newer versatilepb kernels still don't get the IRQ mapping right
for the PCI controller, but they get it differently wrong (they add
a fixed +64 offset to everything they write to PCI_INTERRUPT_LINE).
Update the autodetection to handle these too, and include a more
detailed comment on the various different behaviours that might
be present.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1368545616-22344-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoRevert "versatile_pci: Put the host bridge PCI device at slot 29"
Peter Maydell [Tue, 14 May 2013 15:33:34 +0000 (16:33 +0100)]
Revert "versatile_pci: Put the host bridge PCI device at slot 29"

This reverts commit 5f37ef92b7690423ac6311d3c597e182fc5f8fe6.
It turns out that some kernels incorrectly depend on the
old QEMU behaviour of not putting the host PCI bridge device
where the hardware puts it, because they use a swizzling IRQ
mapping which is incorrect but happens to match up with old
broken QEMU when the slot number mod 4 is zero. Since we
start PCI devices at 11, if we put the host bridge at 29
then the first real PCI device goes at 11 and doesn't work.
Not putting the host bridge at 29 means it defaults to 11,
so the first real PCI device is at 12 and works.

Since continuing with the old behaviour doesn't cause problems
for kernels which do work with hardware, the simplest fix for
this is to revert the change.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1368545616-22344-2-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agow32: Fix configure test for -march=i486
Stefan Weil [Sat, 11 May 2013 19:46:58 +0000 (21:46 +0200)]
w32: Fix configure test for -march=i486

The latest version of MinGW needs a test for __sync_val_compare_and_swap
to fix a missing symbol linker error.

Reported-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1368301619-32097-2-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoconfigure: Detect uuid on MacOSX (fixes compile failure)
Peter Maydell [Tue, 14 May 2013 20:36:39 +0000 (21:36 +0100)]
configure: Detect uuid on MacOSX (fixes compile failure)

Commit 7791dba3ec broke compilation on MacOSX, because it introduced
a new include of util.h. On MacOSX this includes pwd.h which in turn
includes the system uuid/uuid.h, which causes a compile failure if
QEMU was configured without CONFIG_UUID due to a conflict between
the system header and our fallback versions:
  block/vdi.c:124:20: error: static declaration of 'uuid_generate'
  follows non-static declaration
  static inline void uuid_generate(uuid_t out)
                     ^
  /usr/include/uuid/uuid.h:63:6: note: previous declaration is here
  void uuid_generate(uuid_t out);
       ^

Fix this breakage by improving configure's check for uuid to work on
MacOSX (where there is no need to link in a separate libuuid).

Note that if the user explicitly runs configure with '--disable-uuid'
on MacOSX then QEMU will fail to compile.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1368563799-22755-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovnc: Make ledstate comparison before modifiers updated
Lei Li [Wed, 15 May 2013 08:20:40 +0000 (16:20 +0800)]
vnc: Make ledstate comparison before modifiers updated

The ledstate should be compared before modifiers updated,
otherwise the ledstate would be the same as current_led_state.

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1368606040-11950-1-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-net-x: forward the netclient name and type.
KONRAD Frederic [Wed, 15 May 2013 12:12:50 +0000 (14:12 +0200)]
virtio-net-x: forward the netclient name and type.

This forwards the name and the type of virtio-net-x to fix the bad
behaviour of "info network" command.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1368619970-23892-3-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-net: add virtio_net_set_netclient_name.
KONRAD Frederic [Wed, 15 May 2013 12:12:49 +0000 (14:12 +0200)]
virtio-net: add virtio_net_set_netclient_name.

This adds virtio_net_set_netclient_name, which is used to set the
name and type shown in "info network" command.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1368619970-23892-2-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi: fix leak in unit tests
Michael Roth [Fri, 10 May 2013 02:20:57 +0000 (21:20 -0500)]
qapi: fix leak in unit tests

qmp_output_get_qobject() increments the qobject's reference count. Since
we currently pass this straight into qobject_to_json() so we can feed
the data into a QMP input visitor, we never actually free the underlying
qobject when qmp_output_visitor_cleanup() is called. This causes leaks
on all of the QMP serialization tests.

Fix this by holding a pointer to the qobject and decref'ing it before
returning from qmp_deserialize().

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqmp: fix handling of cmd with Equals in qmp-shell
Zhangleiqiang [Mon, 6 May 2013 08:31:23 +0000 (08:31 +0000)]
qmp: fix handling of cmd with Equals in qmp-shell

qmp: fix handling of cmd with equal mark in qmp-shell

    qmp-shell splits the argument and value of input command
by equal mark("="). But there are commands whose values
include equal mark themselves, and the json built by
qmp-shell will not correct. For example, when using NBD as
the target of block-backup command, the input
"block-backup target=nbd+unix:///drive0?socket=/tmp/nbd.sock"
will fail, because the json built will be as follows:

    {
"execute":"block-backup",
"arguments":{"target":"nbd+unix:///drive0?socket"}
}

    Fix it by joining the sections split by equal mark excluding the
first section in __build_cmd function when the length of sections
is larger than two.

Signed-off-by: zhangleiqiang <zhangleiqiang@huawei.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Tue, 14 May 2013 15:24:37 +0000 (10:24 -0500)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Kevin Wolf
# Via Stefan Hajnoczi
* stefanha/block:
  block: Add hint to -EFBIG error message
  qcow2: Catch some L1 table index overflows

Message-id: 1368543269-29784-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoblock: Add hint to -EFBIG error message
Kevin Wolf [Tue, 14 May 2013 14:14:34 +0000 (16:14 +0200)]
block: Add hint to -EFBIG error message

The limit of qcow2 files at least depends on the cluster size. If the
image format has a cluster_size option, suggest to increase it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqcow2: Catch some L1 table index overflows
Kevin Wolf [Tue, 14 May 2013 14:14:33 +0000 (16:14 +0200)]
qcow2: Catch some L1 table index overflows

This catches the situation that is described in the bug report at
https://bugs.launchpad.net/qemu/+bug/865518 and goes like this:

    $ qemu-img create -f qcow2 huge.qcow2 $((1024*1024))T
    Formatting 'huge.qcow2', fmt=qcow2 size=1152921504606846976 encryption=off cluster_size=65536 lazy_refcounts=off
    $ qemu-io /tmp/huge.qcow2 -c "write $((1024*1024*1024*1024*1024*1024 - 1024)) 512"
    Segmentation fault

With this patch applied the segfault will be avoided, however the case
will still fail, though gracefully:

    $ qemu-img create -f qcow2 /tmp/huge.qcow2 $((1024*1024))T
    Formatting 'huge.qcow2', fmt=qcow2 size=1152921504606846976 encryption=off cluster_size=65536 lazy_refcounts=off
    qemu-img: The image size is too large for file format 'qcow2'

Note that even long before these overflow checks kick in, you get
insanely high memory usage (up to INT_MAX * sizeof(uint64_t) = 16 GB for
the L1 table), so with somewhat smaller image sizes you'll probably see
qemu aborting for a failed g_malloc().

If you need huge image sizes, you should increase the cluster size to
the maximum of 2 MB in order to get higher limits.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoosdep: introduce qemu_anon_ram_free to free qemu_anon_ram_alloc-ed memory
Paolo Bonzini [Mon, 13 May 2013 14:19:56 +0000 (16:19 +0200)]
osdep: introduce qemu_anon_ram_free to free qemu_anon_ram_alloc-ed memory

We switched from qemu_memalign to mmap() but then we don't modify
qemu_vfree() to do a munmap() over free().  Which we cannot do
because qemu_vfree() frees memory allocated by qemu_{mem,block}align.

Introduce a new function that does the munmap(), luckily the size is
available in the RAMBlock.

Reported-by: Amos Kong <akong@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Message-id: 1368454796-14989-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoosdep, kvm: rename low-level RAM allocation functions
Paolo Bonzini [Mon, 13 May 2013 14:19:55 +0000 (16:19 +0200)]
osdep, kvm: rename low-level RAM allocation functions

This is preparatory to the introduction of a separate freeing API.

Reported-by: Amos Kong <akong@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Message-id: 1368454796-14989-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoreadline: Handle xterm escape sequences for Home/End keys
Kevin Wolf [Tue, 14 May 2013 10:15:54 +0000 (12:15 +0200)]
readline: Handle xterm escape sequences for Home/End keys

This fixes the Home/End keys in the monitor using the GTK frontend.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 1368526554-15866-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoportability: pty.h is glibc-specific
Paolo Bonzini [Tue, 14 May 2013 12:05:21 +0000 (14:05 +0200)]
portability: pty.h is glibc-specific

This should fix building the GTK+ front-end on BSDs.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368533121-30796-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agospitz: fix compilation failure due to pty.h namespace pollution
Paolo Bonzini [Tue, 14 May 2013 12:12:25 +0000 (14:12 +0200)]
spitz: fix compilation failure due to pty.h namespace pollution

pty.h is polluting the global namespace with a CTRL macro.  spitz
thus fails compilation with the patch at
http://article.gmane.org/gmane.comp.emulators.qemu/211337 and
this patch fixes it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368533545-650-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoacpi: add dummy write function for acpi timer
Gerd Hoffmann [Tue, 14 May 2013 12:29:04 +0000 (14:29 +0200)]
acpi: add dummy write function for acpi timer

Otherwise the guest can crash qemu (NULL pointer dereference).

https://bugzilla.redhat.com/show_bug.cgi?id=947691

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1368534544-11826-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: aggressively optimize qom casting
Anthony Liguori [Mon, 13 May 2013 20:22:24 +0000 (15:22 -0500)]
qom: aggressively optimize qom casting

This patch adds a small typename cache to ObjectClass.  This allows
caching positive casts within each ObjectClass.  Benchmarking a
PPC workload provided by Aurelien, this patch eliminates every
single g_hash_table_lookup() happening during the benchmark (which
was about 2 million per-second).

With this patch applied, I get exactly the same performance (within
the margin of error) as with --disable-qom-cast-debug.

N.B. it's safe to cache typenames only from the _assert() macros
because they are always called with string literals.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoui/gtk.c: do not use gdk_display_warp_pointer when GTK ver >3.0
Igor Mitsyanko [Fri, 10 May 2013 14:59:45 +0000 (18:59 +0400)]
ui/gtk.c: do not use gdk_display_warp_pointer when GTK ver >3.0

Commit 9697f5d2d38e5dd1e64e8e0d64436e6d44e7b1fe "gtk: custom cursor support"
introduced unconditional usage of gdk_display_warp_pointer(). This function
is marked as deprecated since GTK-3.0, and triggers warning (error with -Werror)
during compilation.
Conditionally change gdk_display_warp_pointer() method usage to gdk_device_warp
usage, as suggested by compiler.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
Message-id: 1368197985-44608-1-git-send-email-i.mitsyanko@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoRevert "pc: Kill the "use flash device for BIOS unless KVM" misfeature"
Paolo Bonzini [Fri, 10 May 2013 12:38:03 +0000 (14:38 +0200)]
Revert "pc: Kill the "use flash device for BIOS unless KVM" misfeature"

This reverts commit 9953f8822cc316eec9962f0a2858c3439a80adec.
While Markus's analysis is entirely correct, there are 1.6 patches
that fix the bug for real and without requiring machine type hacks.
Let's think of the children who will have to read this code, and
avoid a complicated mess of semantics that differ between <1.5,
1.5, and >1.5.

Conflicts:
hw/i386/pc_piix.c
hw/i386/pc_q35.c
include/hw/i386/pc.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1368189483-7915-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: allow turning cast debugging off
Paolo Bonzini [Fri, 10 May 2013 12:16:40 +0000 (14:16 +0200)]
qom: allow turning cast debugging off

Cast debugging can have a substantial cost (20% or more).  Instead of adding
special-cased "fast casts" in the hot paths, we can just disable it in
releases.  The tracing facilities we just added make it easier to analyze
those problems that cast debugging would reveal.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368188203-3407-7-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: trace asserting casts
Paolo Bonzini [Fri, 10 May 2013 12:16:39 +0000 (14:16 +0200)]
qom: trace asserting casts

This provides a way to detect the cast that leads to a (reproducible)
crash even when QOM cast debugging is disabled.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368188203-3407-6-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: pass file/line/function to asserting casts
Paolo Bonzini [Fri, 10 May 2013 12:16:38 +0000 (14:16 +0200)]
qom: pass file/line/function to asserting casts

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368188203-3407-5-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: add a fast path to object_class_dynamic_cast
Paolo Bonzini [Fri, 10 May 2013 12:16:37 +0000 (14:16 +0200)]
qom: add a fast path to object_class_dynamic_cast

For leaf classes, in many cases the callbacks will simply downcast
the object back to the original class.  Add this fast path to
object_class_dynamic_cast, object_dynamic_cast will inherit it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368188203-3407-4-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: allow casting of a NULL class
Paolo Bonzini [Fri, 10 May 2013 12:16:36 +0000 (14:16 +0200)]
qom: allow casting of a NULL class

This mimics what we do in object_dynamic_cast_assert.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368188203-3407-3-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: improve documentation of cast functions
Paolo Bonzini [Fri, 10 May 2013 12:16:35 +0000 (14:16 +0200)]
qom: improve documentation of cast functions

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368188203-3407-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqga: unlink just created guest-file if fchmod() or fdopen() fails on it
Laszlo Ersek [Wed, 8 May 2013 15:31:36 +0000 (17:31 +0200)]
qga: unlink just created guest-file if fchmod() or fdopen() fails on it

We shouldn't allow guest filesystem pollution on error paths.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
11 years agoqga: distinguish binary modes in "guest_file_open_modes" map
Laszlo Ersek [Wed, 8 May 2013 15:31:35 +0000 (17:31 +0200)]
qga: distinguish binary modes in "guest_file_open_modes" map

In Windows guests this may make a difference.

Since the original patch (commit c689b4f1) sought to be pedantic and to
consider theoretical corner cases of portability, we should fix it up
where it failed to come through in that pursuit.

Suggested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
11 years agoMerge remote-tracking branch 'mjt/trivial-patches-next' into staging
Anthony Liguori [Mon, 13 May 2013 14:44:25 +0000 (09:44 -0500)]
Merge remote-tracking branch 'mjt/trivial-patches-next' into staging

# By Dong Xu Wang (2) and others
# Via Michael Tokarev
* mjt/trivial-patches-next:
  osdep.h: include sys/types.h for ssize_t definition
  remove double semicolons
  clean unnecessary code: don't check g_strdup arg for NULL
  docs: mention AddressSpaces in docs/memory.txt
  audio: update documentation after removing --audio-card-list option
  m25p80.c: Sync Flash chip list with Linux
  bsd-user: OS-agnostic 64-bit SYSCTL types

Message-id: 518F61B9.9050803@msgid.tls.msk.ru
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'spice/spice.v70' into staging
Anthony Liguori [Mon, 13 May 2013 14:44:04 +0000 (09:44 -0500)]
Merge remote-tracking branch 'spice/spice.v70' into staging

# By Hans de Goede
# Via Gerd Hoffmann
* spice/spice.v70:
  qxl: Call spice_qxl_driver_unload from qxl_enter_vga_mode

Message-id: 1368093776-8949-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoosdep.h: include sys/types.h for ssize_t definition
Igor Mitsyanko [Fri, 10 May 2013 19:58:21 +0000 (23:58 +0400)]
osdep.h: include sys/types.h for ssize_t definition

sys/types.h is taken out from "ifdef __OpenBSD__" guard. It should be
safe for other systems, according to following survey:
http://hacks.owlfolio.org/header-survey/

This fixes build for CONFIG_IOVEC-less systems (mingw).

Signed-off-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoremove double semicolons
Dong Xu Wang [Thu, 9 May 2013 07:53:50 +0000 (15:53 +0800)]
remove double semicolons

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoclean unnecessary code: don't check g_strdup arg for NULL
Dong Xu Wang [Thu, 9 May 2013 07:53:49 +0000 (15:53 +0800)]
clean unnecessary code: don't check g_strdup arg for NULL

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agodocs: mention AddressSpaces in docs/memory.txt
Paolo Bonzini [Mon, 6 May 2013 16:23:38 +0000 (18:23 +0200)]
docs: mention AddressSpaces in docs/memory.txt

Reported-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoaudio: update documentation after removing --audio-card-list option
Hervé Poussineau [Sat, 4 May 2013 14:17:37 +0000 (16:17 +0200)]
audio: update documentation after removing --audio-card-list option

Commit 98af93fde2e37b5b0c8cee9036e028fe6df6446c removed the
--audio-card-list option in configure, and commit
8f3b664f6cc4153cc73941c941d54c4e499b7537 always compiled in
the adlib, gus and cs4231a audio cards.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agom25p80.c: Sync Flash chip list with Linux
Ed Maste [Wed, 1 May 2013 14:40:53 +0000 (10:40 -0400)]
m25p80.c: Sync Flash chip list with Linux

Add new devices for various manufacturers, and re-sort Spansion list to
match the order in Linux, which requires chips with a non-zero extended ID
to come first.

With this commit the outstanding differences to Linux rev 55bf75b are:

- Erase size flag differences in s25sl032p, s25sl064p, s25fl016k, s25fl064k
  (These devices have only some blocks that support small erase sizes.)
- Linux lacks n25q128
- Devices without a Jedec ID have been excluded

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agobsd-user: OS-agnostic 64-bit SYSCTL types
Ed Maste [Tue, 30 Apr 2013 13:29:32 +0000 (09:29 -0400)]
bsd-user: OS-agnostic 64-bit SYSCTL types

Use existence of type as #ifdef condition rather than FreeBSD-specific
version check, as suggested by Patrick Welche.

Also handle the signed (CTLTYPE_S64) case identically to the unsigned
(CTLTYPE_U64) case, per later patches in the FreeBSD ports tree
(emulators/qemu-devel/files/patch-z-arm-bsd-user-001).

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agotarget-i386: ROR r8/r16 imm instruction fix
Aurelien Jarno [Thu, 9 May 2013 17:36:41 +0000 (19:36 +0200)]
target-i386: ROR r8/r16 imm instruction fix

Fix EFLAGS corruption by ROR r8/r16 imm instruction located at the end
of the TB, similarly to commit 089305ac for the non-immediate case.

Reported-by: Hervé Poussineau <hpoussin@reactos.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg/optimize: fix setcond2 optimization
Aurelien Jarno [Wed, 8 May 2013 20:36:39 +0000 (22:36 +0200)]
tcg/optimize: fix setcond2 optimization

When setcond2 is rewritten into setcond, the state of the destination
temp should be reset, so that a copy of the previous value is not
used instead of the result.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoqxl: Call spice_qxl_driver_unload from qxl_enter_vga_mode
Hans de Goede [Tue, 23 Apr 2013 08:18:16 +0000 (10:18 +0200)]
qxl: Call spice_qxl_driver_unload from qxl_enter_vga_mode

With a SPICE_DISPLAY_CAP_MONITORS_CONFIG capable client, the client needs to
know what part of the primary to use for each monitor. If the guest driver
does not support this, the server sends messages to the client for a
single monitor spanning the entire primary.

As soon as the guest calls spice_qxl_monitors_config_async once, the server
sets the red_worker driver_has_monitors_config flag and stops doing this.

This is a problem when the driver gets unloaded, for example after a reboot
or when switching to a text vc with usermode mode-setting under Linux.

To reproduce this start a multi-mon capable Linux guest which uses
usermode mode-setting and then once X has started switch to a text vc. Note
how the client window does not only not resize, if you try to resize it
manually you always keep blackborders since the aspect is wrong.

This patch calls a new spice-server method called spice_qxl_driver_unload
which clears the driver_has_monitors_config flag inside the server, thereby
fixing this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoUpdate version for 1.5.0-rc1
Anthony Liguori [Wed, 8 May 2013 20:54:47 +0000 (15:54 -0500)]
Update version for 1.5.0-rc1

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Wed, 8 May 2013 20:54:36 +0000 (15:54 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

# By Kevin Wolf (7) and Fam Zheng (3)
# Via Kevin Wolf
* kwolf/for-anthony:
  qemu-iotests: fix 017 018 for vmdk
  qemu-iotests: exclude vmdk and qcow from 043
  qemu-iotests: exclude vmdk for test 042
  qtest/ide-test: Test short and long PRDTs
  qtest/ide-test: Add simple DMA read/write test case
  qtest: Add IDE test case
  libqos/pci: Enable bus mastering
  ide: Reset BMIDEA bit when the bus master is stopped
  de_DE.po: Add missing leading spaces
  ahci: Don't allow creating slave drives

Message-id: 1368023344-29731-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>