sdk/emulator/qemu.git
14 years agotarget-arm: refactor cp15.c13 register access
Riku Voipio [Mon, 25 Jan 2010 13:17:32 +0000 (15:17 +0200)]
target-arm: refactor cp15.c13 register access

Access the cp15.c13 TLS registers directly with TCG ops instead of with
a slow helper. If the the cp15 read/write was not TLS register access,
fall back to the cp15 helper.

This makes accessing __thread variables in linux-user when apps are compiled
with -mtp=cp15 possible. legal cp15 register to acces from linux-user are
already checked in cp15_user_ok.

While at it, make the cp15.c13 Thread ID registers available only on
ARMv6K and newer.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
14 years agolinux-user: remove signal handler before calling abort()
Riku Voipio [Mon, 25 Jan 2010 12:30:49 +0000 (14:30 +0200)]
linux-user: remove signal handler before calling abort()

Qemu may hang in host_signal_handler after qemu has done a
seppuku with cpu_abort(). But at this stage we are not really
interested in target process coredump anymore, so unregister
host_signal_handler to die grafefully.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
14 years agofix locking error with current_tb
Riku Voipio [Wed, 20 Jan 2010 10:56:27 +0000 (12:56 +0200)]
fix locking error with current_tb

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
14 years agolinux-user: adapt uname machine to emulated CPU
Loïc Minier [Tue, 29 Dec 2009 21:06:13 +0000 (22:06 +0100)]
linux-user: adapt uname machine to emulated CPU

This patch for linux-user adapts the output of the emulated uname()
syscall to match the configured CPU.  Tested with x86, x86-64 and arm
emulation.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Loïc Minier <lool@dooz.org>
14 years agotarget-ppc: change DCR helpers to target_long arguments
Aurelien Jarno [Sat, 6 Feb 2010 15:59:11 +0000 (16:59 +0100)]
target-ppc: change DCR helpers to target_long arguments

The recent transition to always have the DCR helper functions take 32 bit
values broke the PPC64 target, as target_long became 64 bits there.

This patch changes DCR helpers to target_long arguments, and cast the values
to 32 bit when needed.

Fixes PPC64 build with --enable-debug-tcg

Based on a patch from Alexander Graf <agraf@suse.de>
Reported-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-x86_64: implement setcond
Richard Henderson [Wed, 20 Jan 2010 17:16:49 +0000 (09:16 -0800)]
tcg-x86_64: implement setcond

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: add tcg_invert_cond
Richard Henderson [Thu, 7 Jan 2010 18:15:20 +0000 (10:15 -0800)]
tcg: add tcg_invert_cond

It is very handy to have a reliable mapping of a condition to its inverse.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: generic support for conditional set
Richard Henderson [Thu, 7 Jan 2010 18:13:31 +0000 (10:13 -0800)]
tcg: generic support for conditional set

Defines setcond_{i32,i64} and setcond2_i32 for 64-on-32-bit.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: document double-word support opcodes.
Richard Henderson [Thu, 7 Jan 2010 18:07:35 +0000 (10:07 -0800)]
tcg: document double-word support opcodes.

The internal opcodes brcond2, add2, sub2, mulu2 were undocumented.
Place these in a new section that clearly indicates that they are
not to be emitted by translators.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agousb-linux: increase buffer for USB control requests
Christian Krause [Sun, 24 Jan 2010 16:34:52 +0000 (17:34 +0100)]
usb-linux: increase buffer for USB control requests

The WLAN USB stick ZyXEL NWD271N (0586:3417) uses very large
usb control transfers of more than 2048 bytes which won't fit
into the buffer of the ctrl_struct. This results in an error message
"husb: ctrl buffer too small" and a non-working device.
Increasing the buffer size to 8192 seems to be a safe choice.

Signed-off-by: Christian Krause <chkr@plauener.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agomips/malta: fix typo
Aurelien Jarno [Sat, 30 Jan 2010 20:27:54 +0000 (21:27 +0100)]
mips/malta: fix typo

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoPCI: show also host bridge data in "info pci" output
Blue Swirl [Sat, 6 Feb 2010 14:57:04 +0000 (14:57 +0000)]
PCI: show also host bridge data in "info pci" output

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoPCI: fix multiple bridge problems
Blue Swirl [Sat, 6 Feb 2010 09:20:13 +0000 (09:20 +0000)]
PCI: fix multiple bridge problems

When several PCI bridges were in use, monitor command "info pci" would
enter into infinite loop. Buses behind the bridge were not discoverable
because secondary and subordinate bus numbers were not used properly.
Other buses were not found because bus search terminated on first miss.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoRefactor DEC 21154 PCI bridge
Blue Swirl [Fri, 5 Feb 2010 18:48:36 +0000 (18:48 +0000)]
Refactor DEC 21154 PCI bridge

It's currently not used by PPC machines. Refactor so that also Sparc64
machines can use it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agousb-linux.c: remove write-only variable
Paolo Bonzini [Thu, 4 Feb 2010 13:31:53 +0000 (14:31 +0100)]
usb-linux.c: remove write-only variable

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovnc.c: remove dead code
Paolo Bonzini [Thu, 4 Feb 2010 13:31:52 +0000 (14:31 +0100)]
vnc.c: remove dead code

to= is handled in qemu-sockets.c inet_listen.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoremove two dead assignments in target-i386/translate.c
Paolo Bonzini [Thu, 4 Feb 2010 13:31:49 +0000 (14:31 +0100)]
remove two dead assignments in target-i386/translate.c

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoexec.c: dead assignments
Paolo Bonzini [Thu, 4 Feb 2010 13:31:51 +0000 (14:31 +0100)]
exec.c: dead assignments

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agofix undefined shifts by >32
Paolo Bonzini [Thu, 4 Feb 2010 13:31:50 +0000 (14:31 +0100)]
fix undefined shifts by >32

This one is for 0.12 too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoqdev: Add rudimentary help for property value
Markus Armbruster [Fri, 29 Jan 2010 18:49:02 +0000 (19:49 +0100)]
qdev: Add rudimentary help for property value

This provides the same information as reverted commit 2ba6edf0.  Not
much, just better than nothing.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: update help on -device
Markus Armbruster [Fri, 29 Jan 2010 18:49:01 +0000 (19:49 +0100)]
qdev: update help on -device

While there, use "property" rather than "option", for consistency with
-global.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: Add help for device properties
Markus Armbruster [Fri, 29 Jan 2010 18:49:00 +0000 (19:49 +0100)]
qdev: Add help for device properties

Option "-device DRIVER,?" and monitor command "device_add DRIVER,?"
print the supported properties instead of creating a device.  The
former also terminates the program.

This is commit 2ba6edf0 (just reverted) done right.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRevert "qdev: Add help for device properties"
Markus Armbruster [Fri, 29 Jan 2010 18:48:59 +0000 (19:48 +0100)]
Revert "qdev: Add help for device properties"

This reverts commit 2ba6edf0dd740166632df80caa85992b20791a68.

The commit has two issues:

* When it runs from the monitor, e.g. "device_add e1000,?", it prints
  to stderr instead of the monitor.

* Help looks to callers just like failed device creation.  This makes
  main() exit unsuccessfully on "-device e1000,?".

We need to do this differently.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRevert "qdev: Add help for property value"
Markus Armbruster [Fri, 29 Jan 2010 18:48:58 +0000 (19:48 +0100)]
Revert "qdev: Add help for property value"

This reverts commit 922910ce42d15bdb7c2347436b1b5798b5401de4.

The commit has four issues:

* When it runs from the monitor, e.g. "device_add e1000,mac=?", it
  prints to stderr instead of the monitor.

* Help looks to callers just like failed device creation.  This makes
  main() exit unsuccessfully on "-device e1000,mac=?".

* It has an undocumented side effect on -global: "-global e1000.mac=?"
  prints help, but only when we actually add an e1000 device.

* It does not work for properties that accept the value "?".

We need to do this differently.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: Fix exit code for -device ?
Markus Armbruster [Fri, 29 Jan 2010 18:48:57 +0000 (19:48 +0100)]
qdev: Fix exit code for -device ?

Help was shoehorned into device creation, qdev_device_add().  Since
help doesn't create a device, it returns NULL, which looks to callers
just like failed device creation.  Monitor handler do_device_add()
doesn't care, but main() exits unsuccessfully.

Move help out of device creation, into new qdev_device_help().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqemu-option: Make qemu_opts_foreach() accumulate return values
Markus Armbruster [Fri, 29 Jan 2010 18:48:56 +0000 (19:48 +0100)]
qemu-option: Make qemu_opts_foreach() accumulate return values

Return the bitwise inclusive or of all return values instead of the
last call's value.  This lets you find out whether any of the calls
returned a non-zero value.

No functional change, as existing users either don't care for the
value, or pass non-zero abort_on_failure, which breaks the loop on the
first non-zero return value.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRevert "QError: New QERR_INVALID_CPU_INDEX"
Markus Armbruster [Fri, 29 Jan 2010 09:34:01 +0000 (10:34 +0100)]
Revert "QError: New QERR_INVALID_CPU_INDEX"

This reverts commit 64a34bb14c0e358a6b2f14805e59ef25bf62d6d5.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Use QERR_INVALID_PARAMETER instead of QERR_INVALID_CPU_INDEX
Markus Armbruster [Fri, 29 Jan 2010 09:34:00 +0000 (10:34 +0100)]
monitor: Use QERR_INVALID_PARAMETER instead of QERR_INVALID_CPU_INDEX

This changes the error message from "Invalid CPU index" to "Invalid
parameter index" in the human monitor.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: convert do_migrate_set_downtime() to QObject
Markus Armbruster [Mon, 25 Jan 2010 13:23:08 +0000 (14:23 +0100)]
monitor: convert do_migrate_set_downtime() to QObject

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Use argument type 'T' for migrate_set_downtime
Markus Armbruster [Mon, 25 Jan 2010 13:23:07 +0000 (14:23 +0100)]
monitor: Use argument type 'T' for migrate_set_downtime

Before, it used type 's', which strips quotes and interprets escapes,
and is quite inappropriate for QMP.

Negative arguments are no flushed to zero.  Before, they were cast to
uint32_t, which wrecked the sign.

Ridiculously large arguments including infinities are now rejected.
Before, they were interpreted as zero.  Same for NaN.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: New argument type 'T'
Markus Armbruster [Mon, 25 Jan 2010 13:23:06 +0000 (14:23 +0100)]
monitor: New argument type 'T'

This is a double value with optional suffixes ms, us, ns.  We'll need
this to get migrate_set_downtime() QMP-ready.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: convert do_migrate_set_speed() to QObject
Markus Armbruster [Mon, 25 Jan 2010 13:23:05 +0000 (14:23 +0100)]
monitor: convert do_migrate_set_speed() to QObject

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Use argument type 'b' for migrate_set_speed
Markus Armbruster [Mon, 25 Jan 2010 13:23:04 +0000 (14:23 +0100)]
monitor: Use argument type 'b' for migrate_set_speed

Before, it used type 's', which strips quotes and interprets escapes,
and is quite inappropriate for QMP.

Negative arguments are no flushed to zero.  Before, they were cast to
uint32_t, which wrecked the sign.

Ridiculously large arguments including infinities are now rejected.
Before, they were interpreted as zero.  Same for NaN.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: New argument type 'b'
Markus Armbruster [Mon, 25 Jan 2010 13:23:03 +0000 (14:23 +0100)]
monitor: New argument type 'b'

This is a double value with optional suffixes G, g, M, m, K, k.  We'll
need this to get migrate_set_speed() QMP-ready.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQDict: New qdict_get_double()
Markus Armbruster [Wed, 27 Jan 2010 16:16:38 +0000 (17:16 +0100)]
QDict: New qdict_get_double()

Helper function just like qdict_get_int(), just for QFloat/double.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor: Document argument type 'M'
Markus Armbruster [Mon, 25 Jan 2010 13:23:01 +0000 (14:23 +0100)]
monitor: Document argument type 'M'

Was forgotten in commit b6e098d7.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoseabios: use correct submodule hash
Anthony Liguori [Mon, 1 Feb 2010 20:15:37 +0000 (14:15 -0600)]
seabios: use correct submodule hash

Commit 392ecf543dd2b219828374850d833296a55567ea introduced an accidental change
to the roms/seabios submodule.  This commit partially reverts that commit to
ensure the seabios module points to the right commit.

Reported-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agobsd/darwin-user: mmap_frag() users only check for -1 error
Blue Swirl [Sun, 31 Jan 2010 13:41:07 +0000 (13:41 +0000)]
bsd/darwin-user: mmap_frag() users only check for -1 error

See also ee636500d6eab44b83f09cb730b67226b70423b1.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agocris: Prettify register dumps.
Edgar E. Iglesias [Sun, 31 Jan 2010 10:26:54 +0000 (11:26 +0100)]
cris: Prettify register dumps.

Use friendly names for registers in the dumps.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agosparc32 don't mark page dirty when failing
Artyom Tarasenko [Sun, 31 Jan 2010 02:27:36 +0000 (03:27 +0100)]
sparc32 don't mark page dirty when failing

if the access check fails, the page can not be modified
and shouldn't be marked dirty.
The patch fixes the "hsfs_putpage: dirty HSFS page"
error in Solaris guests.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: implement basic IOMMU/interrupt handling
Blue Swirl [Sat, 30 Jan 2010 19:48:12 +0000 (19:48 +0000)]
sparc64: implement basic IOMMU/interrupt handling

Also add reset control.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoSparc64: byte swap IO port access
Blue Swirl [Fri, 29 Jan 2010 18:15:21 +0000 (18:15 +0000)]
Sparc64: byte swap IO port access

This requires an updated OpenBIOS image.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agovirtio-blk: Fix error cases which ignored rerror/werror
Kevin Wolf [Wed, 27 Jan 2010 12:12:36 +0000 (13:12 +0100)]
virtio-blk: Fix error cases which ignored rerror/werror

If an I/O request fails right away instead of getting an error only in the
callback, we still need to consider rerror/werror.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-blk: Fix restart after read error
Kevin Wolf [Wed, 27 Jan 2010 12:12:35 +0000 (13:12 +0100)]
virtio-blk: Fix restart after read error

Current code assumes that only write requests are ever going to be restarted.
This is wrong since rerror=stop exists. Instead of directly starting writes,
use the same request processing as used for new requests.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio_blk: Factor virtio_blk_handle_request out
Kevin Wolf [Wed, 27 Jan 2010 12:12:34 +0000 (13:12 +0100)]
virtio_blk: Factor virtio_blk_handle_request out

We need a function that handles a single request. Create one by splitting out
code from virtio_blk_handle_output.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agocirrus: Properly re-register cirrus_linear_io_addr on vram unmap
Jan Kiszka [Fri, 29 Jan 2010 14:12:48 +0000 (15:12 +0100)]
cirrus: Properly re-register cirrus_linear_io_addr on vram unmap

This fixes CONFIG_FB_CIRRUS for Linux guests and probably much more:

When switching away from linearly mapped vram, we also have to restore
the I/O handlers for the LFB.

This regression was once introduced by commit 2bec46dc97.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-serial-bus: Fix bus initialisation and allow for bus identification
Amit Shah [Wed, 27 Jan 2010 16:22:19 +0000 (21:52 +0530)]
virtio-serial-bus: Fix bus initialisation and allow for bus identification

This commit enables one to use multiple virtio-serial devices and to
assign ports to arbitrary devices like this:

  -device virtio-serial,id=foo -device virtio-serial,id=bar \
  -device virtserialport,bus=foo.0,name=foo \
  -device virtserialport,bus=bar.0,name=bar

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agosoftmmu: Dont clobber retaddr in slow_ldx().
Edgar E. Iglesias [Tue, 26 Jan 2010 12:55:55 +0000 (13:55 +0100)]
softmmu: Dont clobber retaddr in slow_ldx().

When splitting up unaligned IO accesses, ld calls slow_ld which was
clobbering retaddr.

AFAIK the problem only shows up when running emulations with -icount
that may abort TB execution on IO accesses.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
14 years agoSolaris: test for presence of commands with has()
Loïc Minier [Wed, 20 Jan 2010 10:35:54 +0000 (11:35 +0100)]
Solaris: test for presence of commands with has()

Signed-off-by: Loïc Minier <lool@dooz.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoAdd and use has() and path_of() funcs
Loïc Minier [Thu, 28 Jan 2010 21:26:51 +0000 (21:26 +0000)]
Add and use has() and path_of() funcs

Add has() and path_of() funcs and use them across configure; has()
will test whether a command or builtin is available; path_of() will
search the PATH for executables and return the full pathname if found.

Signed-off-by: Loïc Minier <lool@dooz.org
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCheck for sdl-config before calling it
Loïc Minier [Thu, 28 Jan 2010 21:15:18 +0000 (21:15 +0000)]
Check for sdl-config before calling it

Check whether sdl-config is available before calling it, otherwise
./configure triggers a warning:
    ./configure: 957: sdl-config: not found

If neither the .pc file not sdl-config are present, disable SDL support.

Signed-off-by: Loïc Minier <lool@dooz.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoMonitor: Fix command execution regression
Luiz Capitulino [Wed, 27 Jan 2010 20:01:17 +0000 (18:01 -0200)]
Monitor: Fix command execution regression

Function is_async_return() added by commit 940cc30d0d4 assumes
that 'data', which is returned by handlers, is always a QDict.

This is not true, as QLists can also be returned, in this case
we'll get a segfault.

Fix that by checking if 'data' is a QDict.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: reimplement tick timers v4
Igor V. Kovalenko [Wed, 27 Jan 2010 21:00:53 +0000 (00:00 +0300)]
sparc64: reimplement tick timers v4

sparc64 timer has tick counter which can be set and read,
and tick compare value used as deadline to fire timer interrupt.
The timer is not used as periodic timer, instead deadline
is set each time new timer interrupt is needed.

v3 -> v4:
- coding style

v2 -> v3:
- added missing timer debug output macro
- CPUTimer struct and typedef moved to cpu.h
- change CPU_SAVE_VERSION to 6, older save formats not supported

v1 -> v2:
- new conversion helpers cpu_to_timer_ticks and timer_to_cpu_ticks
- save offset from clock source to implement cpu_tick_set_count
- renamed struct sun4u_timer to CPUTimer
- load and save cpu timers

v0 -> v1:
- coding style

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agosparc64: correct write extra bits to cwp
Igor V. Kovalenko [Wed, 27 Jan 2010 17:47:48 +0000 (17:47 +0000)]
sparc64: correct write extra bits to cwp

- correctly fit to cwp if provided window number is out of range

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix BSD build
Blue Swirl [Wed, 27 Jan 2010 17:47:33 +0000 (17:47 +0000)]
Fix BSD build

<sys/wait.h> must be included in order to use WIF* macros.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix regression in option parsing
Anthony Liguori [Wed, 27 Jan 2010 16:46:00 +0000 (10:46 -0600)]
Fix regression in option parsing

Commit ec229bbe7 broke invocation without a specific -hda.  IOW, qemu foo.img.
The lack of an optind update caused an infinite loop.

Reported-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agopflash: Buffer block writes
Edgar E. Iglesias [Sun, 24 Jan 2010 19:38:29 +0000 (20:38 +0100)]
pflash: Buffer block writes

Buffer block writes to avoid flushing every word access onto backing
storage device. This significantly speeds up flash emulation for flashes
connected through an 8 or 16-bit bus combined with backing storage (-pflash).

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
14 years agovirtio: Add memory statistics reporting to the balloon driver
Adam Litke [Tue, 26 Jan 2010 20:17:35 +0000 (14:17 -0600)]
virtio: Add memory statistics reporting to the balloon driver

When using ballooning to manage overcommitted memory on a host, a system for
guests to communicate their memory usage to the host can provide information
that will minimize the impact of ballooning on the guests.  The current method
employs a daemon running in each guest that communicates memory statistics to a
host daemon at a specified time interval.  The host daemon aggregates this
information and inflates and/or deflates balloons according to the level of
host memory pressure.  This approach is effective but overly complex since a
daemon must be installed inside each guest and coordinated to communicate with
the host.  A simpler approach is to collect memory statistics in the virtio
balloon driver and communicate them directly to the hypervisor.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoNew API for asynchronous monitor commands
Adam Litke [Mon, 25 Jan 2010 18:18:44 +0000 (12:18 -0600)]
New API for asynchronous monitor commands

Qemu has a number of commands that can operate asynchronously (savevm, migrate,
etc) and it will be getting more.  For these commands, the user monitor needs
to be suspended, but QMP monitors could continue to to accept other commands.
This patch introduces a new command API that isolates the details of handling
different monitor types from the actual command execution.

A monitor command can use this API by implementing the mhandler.cmd_async
handler (or info_async if appropriate).  This function is responsible for
submitting the command and does not return any data although it may raise
errors.  When the command completes, the QMPCompletion callback should be
invoked with its opaque data and the command result.

The process for submitting and completing an asynchronous command is different
for QMP and user monitors.  A user monitor must be suspended at submit time and
resumed at completion time.  The user_print() function must be passed to the
QMPCompletion callback so the result can be displayed properly.  QMP monitors
are simpler.  No submit time setup is required.  When the command completes,
monitor_protocol_emitter() writes the result in JSON format.

This API can also be used to implement synchronous commands.  In this case, the
cmd_async handler should immediately call the QMPCompletion callback.  It is my
hope that this new interface will work for all commands, leading to a
drastically simplified monitor.c once all commands are ported.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock: avoid creating too large iovecs in multiwrite_merge
Christoph Hellwig [Tue, 26 Jan 2010 13:49:08 +0000 (14:49 +0100)]
block: avoid creating too large iovecs in multiwrite_merge

If we go over the maximum number of iovecs support by syscall we get
back EINVAL from the kernel which translate to I/O errors for the guest.

Add a MAX_IOV defintion for platforms that don't have it.  For now we use
the same 1024 define that's used on Linux and various other platforms,
but until the windows block backend implements some kind of vectored I/O
it doesn't matter.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovnc_refresh: calling vnc_update_client might free vs
Stefano Stabellini [Mon, 25 Jan 2010 12:54:57 +0000 (12:54 +0000)]
vnc_refresh: calling vnc_update_client might free vs

Hi all,
this patch fixes another bug in vnc_refresh: calling vnc_update_client
might cause vs to be free()ed, in this case we cannot access vs->next
right after to examine the next item on the list.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock/raw-posix: Abort on pread beyond end of non-growable file
Kevin Wolf [Fri, 22 Jan 2010 13:26:38 +0000 (14:26 +0100)]
block/raw-posix: Abort on pread beyond end of non-growable file

This shouldn't happen under any normal circumstances. However, it looks like
it's possible to achieve this with corrupted images. Without this patch
raw_pread is hanging in an endless loop in such cases.

The patch is not affecting growable files, for which such reads happen in
normal use cases. raw_pread_aligned already handles these cases and won't
return zero in the first place.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agowin32: pair qemu_memalign() with qemu_vfree()
Herve Poussineau [Sun, 24 Jan 2010 21:23:56 +0000 (21:23 +0000)]
win32: pair qemu_memalign() with qemu_vfree()

Win32 suffers from a very big memory leak when dealing with SCSI devices.
Each read/write request allocates memory with qemu_memalign (ie
VirtualAlloc) but frees it with qemu_free (ie free).
Pair all qemu_memalign() calls with qemu_vfree() to prevent such leaks.

Signed-off-by: Herve Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agowin32/sdl: Fix toggle full screen
Herve Poussineau [Sun, 24 Jan 2010 21:18:36 +0000 (21:18 +0000)]
win32/sdl: Fix toggle full screen

Toggle full screen on Win32/SDL 1.2.13 was broken by commit
c18a2c360e3100bbd71162cf922dcd8c429a8b71. Re-add the call to
do_sdl_resize() which was removed in this revision

Signed-off-by: Herve Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoTell users about out-of-memory errors
Stefan Weil [Thu, 21 Jan 2010 21:24:58 +0000 (22:24 +0100)]
Tell users about out-of-memory errors

Aborting without an error message when memory is short
is not helpful, so print the reason for the abort.

Try
qemu -m 1000000
or
qemu -m 2000 (win32)

to force an out-of-memory error.

v2:
* Fix error message for win32.
* Fix error message for posix_memalign.

Thanks to malc for the hints.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoPCI: fix bridge configuration
Blue Swirl [Tue, 26 Jan 2010 21:59:57 +0000 (21:59 +0000)]
PCI: fix bridge configuration

PCI bridges' qdev info structures must indicate bridge header type,
otherwise critical bridge registers (esp. PCI_PRIMARY_BUS,
PCI_SECONDARY_BUS, PCI_SUBORDINATE_BUS) will not be writable.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agofix savevm command without id or tag
Marcelo Tosatti [Wed, 20 Jan 2010 16:26:34 +0000 (14:26 -0200)]
fix savevm command without id or tag

savevm without id or tag segfaults in:

(gdb) bt
#0  0x00007f600a83bf8a in __strcmp_sse42 () from /lib64/libc.so.6
#1  0x00000000004745b6 in bdrv_snapshot_find (bs=<value optimized out>,
    sn_info=0x7fff996be280, name=0x0) at savevm.c:1631
#2  0x0000000000475c80 in del_existing_snapshots (name=<value optimized out>,
    mon=<value optimized out>) at savevm.c:1654
#3  do_savevm (name=<value optimized out>, mon=<value optimized out>)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqcow2: rename two QCowAIOCB members
Christoph Hellwig [Thu, 21 Jan 2010 15:12:09 +0000 (16:12 +0100)]
qcow2: rename two QCowAIOCB members

The n member is not very descriptive and very hard to grep, rename it to
cur_nr_sectors to better indicate what it is used for.  Also rename
nb_sectors to remaining_sectors as that is what it is used for.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock: kill BDRV_O_CREAT
Christoph Hellwig [Wed, 20 Jan 2010 17:13:42 +0000 (18:13 +0100)]
block: kill BDRV_O_CREAT

The BDRV_O_CREAT option is unused inside qemu and partially duplicates
the bdrv_create method.  Remove it, and the -C option to qemu-io which
isn't used in qemu-iotests anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock: clean up bdrv_open2 structure a bit
Christoph Hellwig [Wed, 20 Jan 2010 17:13:25 +0000 (18:13 +0100)]
block: clean up bdrv_open2 structure a bit

Check the whitelist as early as possible instead of continuing the
setup, and move all the error handling code to the end of the
function.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-console: Automatically use virtio-serial-bus for the older -virtioconsole...
Amit Shah [Thu, 21 Jan 2010 10:49:23 +0000 (16:19 +0530)]
virtio-console: Automatically use virtio-serial-bus for the older -virtioconsole invocation

These hunks got dropped off mysteriously during the rebasing of my
virtio-serial series. Thanks go to Markus for noticing it.

Without these fixes, -virtioconsole doesn't actually have any effect.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-console: Rename virtio-serial.c back to virtio-console.c
Amit Shah [Thu, 21 Jan 2010 10:13:26 +0000 (15:43 +0530)]
virtio-console: Rename virtio-serial.c back to virtio-console.c

This file was renamed to ease the reviews of the recent changes
that went in.

Now that the changes are done, rename the file back to its original
name.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix generation of config-host.h
Juan Quintela [Wed, 20 Jan 2010 19:54:18 +0000 (20:54 +0100)]
Fix generation of config-host.h

This patch improves Anthony patch a6a853c86275efd89996ce59612a000c5873db5d

Once there, it improves handling of object files for qemu tools

cc: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoide save/restore current transfer fields
Marcelo Tosatti [Wed, 20 Jan 2010 17:01:49 +0000 (18:01 +0100)]
ide save/restore current transfer fields

If migration takes place between write of the bmdma address register and
write of the command register (to initiate DMA), the destination will
not properly start the DMA op, hanging the guest:

ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
ata1.00: cmd c8/00:16:41:00:00/00:00:00:00:00/e0 tag 0 dma 11264 in
         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata1.00: status: { DRDY }

Fix by sending current transfer information in the migration data.

We need to update ide version to 4 for this to work.  As we don't
have subsectios, we need to chain the update increase until
vmstate_ide_pci (quintela)

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoPCI: do_pci_info(): PCI bridge devices support
Luiz Capitulino [Thu, 21 Jan 2010 21:15:41 +0000 (19:15 -0200)]
PCI: do_pci_info(): PCI bridge devices support

This commit completes the do_pci_info() conversion to
QObject by adding support to PCI bridge devices.

This is done by recursively adding devices in the
"pci_bridge" key.

IMPORTANT: This code is being added separately because I could
NOT test it properly. According to Michael Tsirkin, it depends
on ultrasparc and it would take time to do the proper setup.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoPCI: Convert pci_info() to QObject
Luiz Capitulino [Thu, 21 Jan 2010 21:15:40 +0000 (19:15 -0200)]
PCI: Convert pci_info() to QObject

The returned QObject is a QList of all buses. Each bus is
represented by a QDict, which has a key with a QList of all
PCI devices attached to it. Each device is represented by
a QDict.

As has happended to other complex conversions, it's hard to
split this commit as part of it are new functions which are
called by each other.

IMPORTANT: support for printing PCI bridge attached devices
is NOT part of this commit, it's going to be added by the
next commit, as it's untested.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQDict: Introduce qdict_get_qdict()
Luiz Capitulino [Thu, 21 Jan 2010 21:15:39 +0000 (19:15 -0200)]
QDict: Introduce qdict_get_qdict()

A helper to retrieve a QDict from a QDict.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoQList: Introduce QLIST_FOREACH_ENTRY()
Luiz Capitulino [Thu, 21 Jan 2010 21:15:38 +0000 (19:15 -0200)]
QList: Introduce QLIST_FOREACH_ENTRY()

Iterate over QList entries, it's needed to call qlist_entry_obj()
to retrieve the stored QObject.

I'm not sure if it's ok to have this, because it's not as easy as
qlist_iter() and the QListEntry data type is now exposed to the
users, which means we have one more struct to be maintained when
we have libqmp.

Adding anyway, as it's more compact and people are asking for it.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRead-only device changed to opens it's file for read-only.
Naphtali Sprei [Thu, 21 Jan 2010 12:40:41 +0000 (14:40 +0200)]
Read-only device changed to opens it's file for read-only.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAsk for read-write permissions when opening files
Naphtali Sprei [Thu, 21 Jan 2010 12:40:39 +0000 (14:40 +0200)]
Ask for read-write permissions when opening files

Found some places that seems needs this explicitly, now that
read-write is not the default.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoNo need anymoe for bdrv_set_read_only
Naphtali Sprei [Thu, 21 Jan 2010 12:40:37 +0000 (14:40 +0200)]
No need anymoe for bdrv_set_read_only

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDocumentation: Add missing texi description for command line options
Stefan Weil [Wed, 20 Jan 2010 21:25:27 +0000 (22:25 +0100)]
Documentation: Add missing texi description for command line options

Some more command line options had entries for command line help,
but documentation for texi and derived formats (man, html, info)
was missing.

For conditional options, the texi documentation was added
unconditionally.

This seems reasonable because typically man pages are
shared, and html users expect to see one documentation
(not several nearly identical documents for the different
systems).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDocumentation: Improve command line help for -device option
Stefan Weil [Wed, 20 Jan 2010 21:58:35 +0000 (22:58 +0100)]
Documentation: Improve command line help for -device option

* Fix column for help text.

* Give some more help, especially for the new '?' parameters.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: Add help for property value
Stefan Weil [Wed, 20 Jan 2010 21:58:34 +0000 (22:58 +0100)]
qdev: Add help for property value

When called with property value "?",
a help text will be printed (instead of an error message).

This is useful for command lines like
     qemu -device e1000,mac=?
and is already standard for other command line options.

A better help text could be provided by extending
the Property structure with a desc field.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoqdev: Add help for device properties
Stefan Weil [Wed, 20 Jan 2010 21:58:33 +0000 (22:58 +0100)]
qdev: Add help for device properties

When called with property "?", a list of supported
properties will be printed (instead of an error message).

This is useful for command lines like
qemu -device e1000,?
and was already standard for other options like model=?

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agommap_frag() users only check for -1 error
Juan Quintela [Tue, 19 Jan 2010 23:56:24 +0000 (00:56 +0100)]
mmap_frag() users only check for -1 error

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoCheck availavility of -fstack-protector-all
Juan Quintela [Tue, 19 Jan 2010 23:56:23 +0000 (00:56 +0100)]
Check availavility of -fstack-protector-all

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoEnable _FORTIFY_SOURCE=2
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:22 +0000 (00:56 +0100)]
Enable _FORTIFY_SOURCE=2

_FORTIFY_SOURCE is a Glibc feature which adds memory and string function
protection.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agocheck pipe() return value
Juan Quintela [Tue, 19 Jan 2010 23:56:21 +0000 (00:56 +0100)]
check pipe() return value

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agolinux-user/mmap.c: fix warnings with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:20 +0000 (00:56 +0100)]
linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE

CC    i386-linux-user/mmap.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'mmap_frag':
/usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:253: error: ignoring return value of 'pread', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'target_mmap':
/usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:477: error: ignoring return value of 'pread', declared with attribute warn_unused_result
make[1]: *** [mmap.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agomonitor.c: fix warnings with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:19 +0000 (00:56 +0100)]
monitor.c: fix warnings with _FORTIFY_SOURCE

CC    i386-softmmu/monitor.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_memory_save':
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1318: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_physical_memory_save':
/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1345: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result
make[1]: *** [monitor.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovl.c: fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:18 +0000 (00:56 +0100)]
vl.c: fix warning with _FORTIFY_SOURCE

CC    i386-softmmu/vl.o
cc1: warnings being treated as errors
/usr/src/RPM/BUILD/qemu-0.11.92/vl.c: In function 'qemu_event_increment':
/usr/src/RPM/BUILD/qemu-0.11.92/vl.c:3404: error: ignoring return value of 'write', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/vl.c: In function 'main':
/usr/src/RPM/BUILD/qemu-0.11.92/vl.c:5774: error: ignoring return value of 'write', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/vl.c:6064: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
/usr/src/RPM/BUILD/qemu-0.11.92/vl.c:6083: error: ignoring return value of 'chdir', declared with attribute warn_unused_result
make[1]: *** [vl.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agousb-linux.c: fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:17 +0000 (00:56 +0100)]
usb-linux.c: fix warning with _FORTIFY_SOURCE

CC    usb-linux.o
cc1: warnings being treated as errors
usb-linux.c: In function 'usb_host_read_file':
usb-linux.c:1204: error: ignoring return value of 'fgets', declared with attribute warn_unused_result
make: *** [usb-linux.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agonet/slirp.c: fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:16 +0000 (00:56 +0100)]
net/slirp.c: fix warning with _FORTIFY_SOURCE

CC    net/slirp.o
cc1: warnings being treated as errors
net/slirp.c: In function 'slirp_smb_cleanup':
net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_result
make: *** [net/slirp.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock/qcow2.c: fix warnings with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:15 +0000 (00:56 +0100)]
block/qcow2.c: fix warnings with _FORTIFY_SOURCE

CC    block/qcow2.o
cc1: warnings being treated as errors
block/qcow2.c: In function 'qcow_create2':
block/qcow2.c:829: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow2.c:838: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow2.c:839: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow2.c:841: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow2.c:844: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow2.c:849: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow2.c:852: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow2.c:855: error: ignoring return value of 'write', declared with attribute warn_unused_result
make: *** [block/qcow2.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock/vvfat.c: fix warnings with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:14 +0000 (00:56 +0100)]
block/vvfat.c: fix warnings with _FORTIFY_SOURCE

CC    block/vvfat.o
cc1: warnings being treated as errors
block/vvfat.c: In function 'commit_one_file':
block/vvfat.c:2259: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result
make: *** [block/vvfat.o] Error 1
  CC    block/vvfat.o
In file included from /usr/include/stdio.h:912,
                 from ./qemu-common.h:19,
                 from block/vvfat.c:27:
In function 'snprintf',
    inlined from 'init_directories' at block/vvfat.c:871,
    inlined from 'vvfat_open' at block/vvfat.c:1068:
/usr/include/bits/stdio2.h:65: error: call to __builtin___snprintf_chk will always overflow destination buffer
make: *** [block/vvfat.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock/vmdk.o: fix warnings with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:13 +0000 (00:56 +0100)]
block/vmdk.o: fix warnings with _FORTIFY_SOURCE

CC    block/vmdk.o
cc1: warnings being treated as errors
block/vmdk.c: In function 'vmdk_snapshot_create':
block/vmdk.c:236: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result
block/vmdk.c: In function 'vmdk_create':
block/vmdk.c:775: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/vmdk.c:776: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/vmdk.c:778: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result
block/vmdk.c:784: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/vmdk.c:790: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/vmdk.c:807: error: ignoring return value of 'write', declared with attribute warn_unused_result
make: *** [block/vmdk.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock/qcow.c: fix warnings with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:12 +0000 (00:56 +0100)]
block/qcow.c: fix warnings with _FORTIFY_SOURCE

CC    block/qcow.o
cc1: warnings being treated as errors
block/qcow.c: In function 'qcow_create':
block/qcow.c:804: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow.c:806: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow.c:811: error: ignoring return value of 'write', declared with attribute warn_unused_result
make: *** [block/qcow.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoblock/cow.c: fix warnings with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:11 +0000 (00:56 +0100)]
block/cow.c: fix warnings with _FORTIFY_SOURCE

CC    block/cow.o
cc1: warnings being treated as errors
block/cow.c: In function 'cow_create':
block/cow.c:251: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/cow.c:253: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result
make: *** [block/cow.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoposix-aio-compat.c: fix warning with _FORTIFY_SOURCE
Kirill A. Shutemov [Tue, 19 Jan 2010 23:56:10 +0000 (00:56 +0100)]
posix-aio-compat.c: fix warning with _FORTIFY_SOURCE

CC    posix-aio-compat.o
cc1: warnings being treated as errors
posix-aio-compat.c: In function 'aio_signal_handler':
posix-aio-compat.c:505: error: ignoring return value of 'write', declared with attribute warn_unused_result
make: *** [posix-aio-compat.o] Error 1

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>