sdk/emulator/qemu.git
13 years agomemory: move obsolete exec.c functions to a private header
Avi Kivity [Thu, 15 Dec 2011 13:25:22 +0000 (15:25 +0200)]
memory: move obsolete exec.c functions to a private header

This will help avoid accidental usage.

Signed-off-by: Avi Kivity <avi@redhat.com>
13 years agoetraxfs_eth: drop bogus cpu_unregister_io_memory()
Avi Kivity [Thu, 15 Dec 2011 13:23:03 +0000 (15:23 +0200)]
etraxfs_eth: drop bogus cpu_unregister_io_memory()

Leftover call to cpu_unregister_io_memory() can segfault on cleanup.  Remove.

Signed-off-by: Avi Kivity <avi@redhat.com>
13 years agoxen: convert to memory API
Avi Kivity [Sun, 18 Dec 2011 14:27:48 +0000 (16:27 +0200)]
xen: convert to memory API

Undo the private implementation of qemu_ram_alloc(); use the global one
(which calls right back into xen_ram_alloc()).

Signed-off-by: Avi Kivity <avi@redhat.com>
13 years agomemory, xen: pass MemoryRegion to xen_ram_alloc()
Avi Kivity [Sun, 18 Dec 2011 13:48:55 +0000 (15:48 +0200)]
memory, xen: pass MemoryRegion to xen_ram_alloc()

Currently xen_ram_alloc() relies on ram_addr, which is going away.
Give it something else to use as a cookie.

Signed-off-by: Avi Kivity <avi@redhat.com>
13 years agophys_page_find_alloc: Use correct initial region_offset.
Alex Rozenman [Tue, 13 Dec 2011 10:52:08 +0000 (12:52 +0200)]
phys_page_find_alloc: Use correct initial region_offset.

This fixes a common bug with initial region_offset value.
Usually, the pages are re-assigned afterwards, so the bug
has a very small effect on regular QEMU use flows.

Signed-off-by: Alex Rozenman <Alex_Rozenman@mentor.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agonetwork scripts: don't block SIGCHLD before forking
Michael Roth [Thu, 8 Dec 2011 03:48:07 +0000 (21:48 -0600)]
network scripts: don't block SIGCHLD before forking

This patch fixes a bug where child processes of launch_script() can
misbehave due to SIGCHLD being blocked. In the case of `sudo`, this
causes a permanent hang.

Previously a SIGCHLD handler was added to reap fork_exec()'d zombie
processes by calling waitpid(-1, ...). This required other
fork()/waitpid() callers to temporarilly block SIGCHILD to avoid
having the final wait status being intercepted by the SIGCHLD
handler:

7c3370d4fe3fa6cda8655f109e4659afc8ca4269

Since then, the qemu_add_child_watch() interface was added to allow
registration of such processes and reap only from that specific set
of PIDs:

4d54ec7898bd951007cb6122d5315584bd41d0c4

As a result, we can now avoid blocking SIGCHLD in launch_script(), so
drop that behavior.

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoHACKING: clarify allocation/free recommendations
Peter Maydell [Thu, 15 Dec 2011 13:33:54 +0000 (13:33 +0000)]
HACKING: clarify allocation/free recommendations

Clarify the allocation/free recommendations; this is mostly
just tidying up following the global-search-and-replace done
with the conversion to the GLib g_malloc and friends.

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agousb: fix usb_qdev_init() error handling again
Stefan Hajnoczi [Thu, 15 Dec 2011 10:05:18 +0000 (10:05 +0000)]
usb: fix usb_qdev_init() error handling again

Commit f462141f18ffdd75847f6459ef83d90b831d12c0 introduced clean up code
when usb_qdev_init() fails.  Unfortunately it calls .handle_destroy()
when .init() was never invoked or failed.  This can lead to crashes when
.handle_destroy() tries to clean up things that were never initialized.

This patch is careful to undo only those steps that completed along the
usb_qdev_init() code path.  It's not as pretty as the unified error
handling in f462141f18ffdd75847f6459ef83d90b831d12c0 but it's necessary.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoexec.c: Fix subpage memory access to RAM MemoryRegion
Andreas Färber [Wed, 30 Nov 2011 15:26:21 +0000 (16:26 +0100)]
exec.c: Fix subpage memory access to RAM MemoryRegion

Commit 95c318f5e1f88d7e5bcc6deac17330fd4806a2d3 (Fix segfault in mmio
subpage handling code.) prevented a segfault by making all subpage
registrations over an existing memory page perform an unassigned access.
Symptoms were writes not taking effect and reads returning zero.

Very small page sizes are not currently supported either,
so subpage memory areas cannot fully be avoided.

Therefore change the previous fix to use a new IO_MEM_SUBPAGE_RAM
instead of IO_MEM_UNASSIGNED. Suggested by Avi.

Reviewed-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Avi Kivity <avi@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agovl.c: Print the actual program name in help output
michael@ozlabs.org [Tue, 13 Dec 2011 01:22:58 +0000 (12:22 +1100)]
vl.c: Print the actual program name in help output

In help() we do what boils down to:

  printf("%s", "qemu");

This seems to be an artifact of be995c27640a82c7056b6f53d02ec823570114e5
("removed unused code"), which removed some ifdef'ery that used to print
a different name depending on CONFIG_SOFTMMU.

Instead print the actual program name, originally from argv[0].

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoerror: Add an accessor for progname
michael@ozlabs.org [Tue, 13 Dec 2011 01:22:57 +0000 (12:22 +1100)]
error: Add an accessor for progname

We'd like to get the progname for help output, so add an accessor.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Andreas F=E4rber <afaerber@suse.de>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agofix win32 build
Paolo Bonzini [Tue, 13 Dec 2011 12:43:52 +0000 (13:43 +0100)]
fix win32 build

On Windows, cpus.c needs access to the hThread.  Add a Windows-specific
function to grab it.  This requires changing the CPU threads to
joinable.  There is no substantial change because the threads run
in an infinite loop.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqdev: add a qdev_get_type() function and expose as a 'type' property
Anthony Liguori [Mon, 12 Dec 2011 20:29:43 +0000 (14:29 -0600)]
qdev: add a qdev_get_type() function and expose as a 'type' property

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: add string property type
Anthony Liguori [Mon, 12 Dec 2011 20:29:42 +0000 (14:29 -0600)]
qom: add string property type

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: add vga node to the pc composition tree
Anthony Liguori [Mon, 12 Dec 2011 20:29:41 +0000 (14:29 -0600)]
qom: add vga node to the pc composition tree

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: optimize qdev_get_canonical_path using a parent link
Anthony Liguori [Mon, 12 Dec 2011 20:29:40 +0000 (14:29 -0600)]
qom: optimize qdev_get_canonical_path using a parent link

The full tree search was a bit unreasonable.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agortc: add a dynamic property for retrieving the date
Anthony Liguori [Mon, 12 Dec 2011 20:29:39 +0000 (14:29 -0600)]
rtc: add a dynamic property for retrieving the date

This really shows the power of dynamic object properties compared to qdev
static properties.

This property represents a complex structure who's format is preserved over the
wire.  This is enabled by visitors.

It also shows an entirely synthetic property that is not tied to device state.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agortc: make piix3 set the rtc as a child (v2)
Anthony Liguori [Mon, 12 Dec 2011 20:29:38 +0000 (14:29 -0600)]
rtc: make piix3 set the rtc as a child (v2)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agodev: add an anonymous peripheral container
Anthony Liguori [Mon, 12 Dec 2011 20:29:37 +0000 (14:29 -0600)]
dev: add an anonymous peripheral container

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqdev: add explicitly named devices to the root complex
Anthony Liguori [Mon, 12 Dec 2011 20:29:36 +0000 (14:29 -0600)]
qdev: add explicitly named devices to the root complex

We first add a 'peripheral' container to the root device that we add user
created devices to.  This provides all user created devices with a unique and
isolated namespace.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: qom_{get, set} monitor commands (v2)
Anthony Liguori [Mon, 12 Dec 2011 20:29:35 +0000 (14:29 -0600)]
qom: qom_{get, set} monitor commands (v2)

This allows clients to read and write device model properties through QMP.  QAPI
doesn't support Visitor types yet and these commands are special in that they
don't work with fixed types.

I've added a documentation stub to qapi-schema.json so we can keep consistency
there.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqmp: add qom-list command
Anthony Liguori [Mon, 12 Dec 2011 20:29:34 +0000 (14:29 -0600)]
qmp: add qom-list command

This can be used to list properties in the device model.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqapi: allow a 'gen' key to suppress code generation
Anthony Liguori [Mon, 12 Dec 2011 20:29:33 +0000 (14:29 -0600)]
qapi: allow a 'gen' key to suppress code generation

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: add link properties (v2)
Anthony Liguori [Mon, 12 Dec 2011 20:29:32 +0000 (14:29 -0600)]
qom: add link properties (v2)

Links represent an ephemeral relationship between devices.  They are meant to
replace the qdev concept of busses by allowing more informal relationships
between devices.

Links are fairly limited in their usefulness without implementing QOM-style
subclassing and interfaces.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: add child properties (composition) (v3)
Anthony Liguori [Mon, 12 Dec 2011 20:29:31 +0000 (14:29 -0600)]
qom: add child properties (composition) (v3)

Child properties express a relationship of composition.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqdev: provide a path resolution (v2)
Anthony Liguori [Mon, 12 Dec 2011 20:29:30 +0000 (14:29 -0600)]
qdev: provide a path resolution (v2)

There are two types of supported paths--absolute paths and partial paths.

Absolute paths are derived from the root device and can follow child<> or
link<> properties.  Since they can follow link<> properties, they can be
arbitrarily long.  Absolute paths look like absolute filenames and are prefixed
with a leading slash.

Partial paths are look like relative filenames.  They do not begin with a
prefix.  The matching rules for partial paths are subtle but designed to make
specifying devices easy.  At each level of the composition tree, the partial
path is matched as an absolute path.  The first match is not returned.  At
least two matches are searched for.  A successful result is only returned if
only one match is founded.  If more than one match is found, a flag is returned
to indicate that the match was ambiguous.

At the end of the day, partial path support means that if you create a device
called 'ide0', you can just say 'ide0' as the path name and it will Just Work.
If we internally create a device called 'i440fx', you can just say 'i440fx' and
it will Just Work and long as you don't do anything silly.

A management tool should probably always use absolute paths since then they
don't have to deal with the possibility of ambiguity.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqdev: provide an interface to return canonical path from root (v2)
Anthony Liguori [Mon, 12 Dec 2011 20:29:29 +0000 (14:29 -0600)]
qdev: provide an interface to return canonical path from root (v2)

The canonical path is the path in the composition tree from the root to the
device.  This is effectively the name of the device.

This is an incredibly unefficient implementation that will be optimized in
a future patch.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: introduce root device
Anthony Liguori [Mon, 12 Dec 2011 20:29:28 +0000 (14:29 -0600)]
qom: introduce root device

This is based on Jan's suggestion for how to do unique naming.  The root device
is the root of composition.  All devices are reachable via child<> links from
this device.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: register legacy properties as new style properties (v2)
Anthony Liguori [Mon, 12 Dec 2011 20:29:27 +0000 (14:29 -0600)]
qom: register legacy properties as new style properties (v2)

Expose all legacy properties through the new QOM property mechanism.  The qdev
property types are exposed through the 'legacy<>' namespace.  They are always
visited as strings since they do their own string parsing.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: add new dynamic property infrastructure based on Visitors (v2)
Anthony Liguori [Mon, 12 Dec 2011 20:29:26 +0000 (14:29 -0600)]
qom: add new dynamic property infrastructure based on Visitors (v2)

qdev properties are settable only during construction and static to classes.
This isn't flexible enough for QOM.

This patch introduces a property interface for qdev that provides dynamic
properties that are tied to objects, instead of classes.  These properties are
Visitor based instead of string based too.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqom: add a reference count to qdev objects
Anthony Liguori [Mon, 12 Dec 2011 20:29:25 +0000 (14:29 -0600)]
qom: add a reference count to qdev objects

To ensure that a device isn't removed from the graph until all of its links are
broken.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agotcg/arm: remove fixed map code buffer restriction
Dr. David Alan Gilbert [Mon, 12 Dec 2011 15:37:31 +0000 (16:37 +0100)]
tcg/arm: remove fixed map code buffer restriction

On ARM, don't map the code buffer at a fixed location, and fix up the
call/goto tcg routines to let it do long jumps.

Mapping the code buffer at a fixed address could sometimes result in it being
mapped over the top of the heap with pretty random results.

Signed-off-by: Dr. David Alan Gilbert <david.gilbert@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
13 years agoMerge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Andrzej Zaborowski [Wed, 14 Dec 2011 20:34:00 +0000 (21:34 +0100)]
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

13 years agoMerge remote-tracking branch 'stefanha/trivial-patches-next' into staging
Anthony Liguori [Wed, 14 Dec 2011 13:59:21 +0000 (07:59 -0600)]
Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging

13 years agodoc: Remove Symbian Virtual Platform
Stefan Weil [Wed, 14 Dec 2011 06:30:24 +0000 (07:30 +0100)]
doc: Remove Symbian Virtual Platform

Commit d396a657baec8c6b7aa0c888746e0e2f78303650 removed the code
for SVP, so the documentation needs this update.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agomigration.h: remove incoming_expected declarations
Isaku Yamahata [Tue, 13 Dec 2011 03:40:51 +0000 (12:40 +0900)]
migration.h: remove incoming_expected declarations

The variable is deleted by 1bcef683bf840a928d633755031ac572d5fdb851
So remove its declaration.

Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agotcg: make tcg_const_ptr actually accept a pointer argument
Peter Maydell [Sat, 10 Dec 2011 16:35:31 +0000 (16:35 +0000)]
tcg: make tcg_const_ptr actually accept a pointer argument

Make tcg_const_ptr() include a cast so that you can pass it a
pointer. This allows us to drop the casts we had in all the places
that use this macro.

Acked-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agoFix spelling in comments, documentation and messages
Stefan Weil [Fri, 9 Dec 2011 23:19:46 +0000 (00:19 +0100)]
Fix spelling in comments, documentation and messages

accidently->accidentally
annother->another
choosen->chosen
consideres->considers
decriptor->descriptor
developement->development
paramter->parameter
preceed->precede
preceeding->preceding
priviledge->privilege
propogation->propagation
substraction->subtraction
throught->through
upto->up to
usefull->useful

Fix also grammar in posix-aio-compat.c

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agohw: Fix spelling in comments and code
Stefan Weil [Fri, 9 Dec 2011 23:19:45 +0000 (00:19 +0100)]
hw: Fix spelling in comments and code

compatiblity->compatibility
transfered->transferred
transfering->transferring

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agohw: Fix spelling in comments
Stefan Weil [Fri, 9 Dec 2011 23:19:44 +0000 (00:19 +0100)]
hw: Fix spelling in comments

adress->address
advertisment->advertisement
begining->beginning
bondary->boundary
controler->controller
controll->control
convertion->conversion
doesnt->doesn't
existant->existent
instuction->instruction
loosing->losing
managment->management
multipled->multiplied
negotation->negotiation
runing->running
teh->the
unchangable->unchangeable
writen->written
yeild->yield

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agohw: Fix spelling (licenced->licensed)
Stefan Weil [Fri, 9 Dec 2011 23:19:43 +0000 (00:19 +0100)]
hw: Fix spelling (licenced->licensed)

New code introduced old misspellings.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agofmopl: Fix spelling in code and comments
Stefan Weil [Fri, 9 Dec 2011 23:19:42 +0000 (00:19 +0100)]
fmopl: Fix spelling in code and comments

algorythm->algorithm
rythm->rhythm

I did not try to fix the coding standard, so checkpatch.pl
reports lots of violations.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
13 years agotarget-arm: Infer VFPv3 feature from VFPv4
Andreas Färber [Tue, 13 Dec 2011 18:19:25 +0000 (18:19 +0000)]
target-arm: Infer VFPv3 feature from VFPv4

VFP4 => VFP3

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agotarget-arm: Infer VFP feature from VFPv3
Andreas Färber [Tue, 13 Dec 2011 18:19:24 +0000 (18:19 +0000)]
target-arm: Infer VFP feature from VFPv3

VFP3 => VFP

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agotarget-arm: Infer Thumb division feature from M profile
Andreas Färber [Tue, 13 Dec 2011 18:19:24 +0000 (18:19 +0000)]
target-arm: Infer Thumb division feature from M profile

M => THUMB_DIV

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agotarget-arm: Infer Thumb2 feature from ARMv7
Andreas Färber [Tue, 13 Dec 2011 18:19:24 +0000 (18:19 +0000)]
target-arm: Infer Thumb2 feature from ARMv7

V7 => THUMB2

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agotarget-arm: Infer AUXCR feature from ARMv6
Andreas Färber [Tue, 13 Dec 2011 18:19:24 +0000 (18:19 +0000)]
target-arm: Infer AUXCR feature from ARMv6

V6 && !M => AUXCR

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agotarget-arm: Infer ARMv6(K) feature from ARMv7
Andreas Färber [Tue, 13 Dec 2011 18:19:24 +0000 (18:19 +0000)]
target-arm: Infer ARMv6(K) feature from ARMv7

V7 && M => V6
V7 && !M => V6K

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agotarget-arm: Infer ARMv6 feature from v6K
Andreas Färber [Tue, 13 Dec 2011 18:19:24 +0000 (18:19 +0000)]
target-arm: Infer ARMv6 feature from v6K

V6K => V6

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agotarget-arm: Infer ARMv5 feature from ARMv6
Andreas Färber [Tue, 13 Dec 2011 18:19:24 +0000 (18:19 +0000)]
target-arm: Infer ARMv5 feature from ARMv6

V6 => V5

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agotarget-arm: Infer ARMv4T feature from ARMv5
Andreas Färber [Tue, 13 Dec 2011 18:19:23 +0000 (18:19 +0000)]
target-arm: Infer ARMv4T feature from ARMv5

V5 => V4T

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agoarm: Fix CP15 FSR (C5) domain setting
Jean-Christophe DUBOIS [Tue, 13 Dec 2011 18:19:23 +0000 (18:19 +0000)]
arm: Fix CP15 FSR (C5) domain setting

Return the correct value in the domain field in the cp15 DFSR
(C5) -- bug noticed during Xvisor development.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
[Peter Maydell: reworded commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agoccid: make threads joinable
Paolo Bonzini [Mon, 12 Dec 2011 16:21:34 +0000 (17:21 +0100)]
ccid: make threads joinable

Destroying a mutex that another thread might have just unlocked
is racy.  It usually works, but you cannot do that in general and
can lead to deadlocks or segfaults.  Change ccid to use joinable
threads instead.

(Also, qemu_mutex_init/qemu_cond_init were missing).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqemu-thread: implement joinable threads for Win32
Paolo Bonzini [Mon, 12 Dec 2011 16:21:33 +0000 (17:21 +0100)]
qemu-thread: implement joinable threads for Win32

Rewrite the handshaking between qemu_thread_create and the
win32_start_routine, so that the thread can be joined without races.
Similar handshaking is done now between qemu_thread_exit and
qemu_thread_join.

This also simplifies how QemuThreads are initialized.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqemu-thread: implement joinable threads for POSIX
Jan Kiszka [Mon, 12 Dec 2011 16:21:32 +0000 (17:21 +0100)]
qemu-thread: implement joinable threads for POSIX

Allow to control if a QEMU thread is created joinable or not. Make it
not joinable by default to avoid that we keep the associated resources
around when terminating a thread without joining it (what we couldn't do
so far for obvious reasons).

The audio subsystem will need the join feature when converting it to
QEMU threading/locking abstractions, so provide that service.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqemu-thread: add API for joinable threads
Jan Kiszka [Mon, 12 Dec 2011 16:21:31 +0000 (17:21 +0100)]
qemu-thread: add API for joinable threads

Split from Jan's original qemu-thread-posix.c patch.  No semantic change,
just introduce the new API that POSIX and Win32 implementations will
conform to.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agosyborg: drop support for Symbian Virtual Platform
Stefan Hajnoczi [Mon, 12 Dec 2011 12:11:41 +0000 (12:11 +0000)]
syborg: drop support for Symbian Virtual Platform

The Symbian Virtual Platform was an ARM-based development and debugging
board.  Since Symbian has been disbanded and the code is no longer being
used it can now be removed.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agonet: take ownership of fd in socket init functions
Stefan Hajnoczi [Wed, 7 Dec 2011 15:01:49 +0000 (15:01 +0000)]
net: take ownership of fd in socket init functions

Today net/socket.c has no consistent policy for closing the socket file
descriptor when initialization fails.  This means we leak the file
descriptor in some cases or we could also try to close it twice.

Make error paths consistent by taking ownership of the file descriptor
and closing it on error.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agonet: expand tabs in net/socket.c
Stefan Hajnoczi [Wed, 7 Dec 2011 15:01:48 +0000 (15:01 +0000)]
net: expand tabs in net/socket.c

In order to make later patches sane, expand the tab characters and
conform to QEMU coding style now.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoguest agent: add supported command list to guest-info RPC
Michael Roth [Wed, 7 Dec 2011 04:03:43 +0000 (22:03 -0600)]
guest agent: add supported command list to guest-info RPC

Not that there is blacklisting functionality we can no longer infer
the agent's capabilities via version. This patch extends the current
guest-info RPC to also return a list of dictionaries containing the name
of each supported RPC, along with a boolean indicating whether or not
the command has been disabled by a guest administrator/distro.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoguest agent: add RPC blacklist command-line option
Michael Roth [Wed, 7 Dec 2011 04:03:42 +0000 (22:03 -0600)]
guest agent: add RPC blacklist command-line option

This adds a command-line option, -b/--blacklist, that accepts a
comma-seperated list of RPCs to disable, or prints a list of
available RPCs if passed "?".

In consequence this also adds general blacklisting and RPC listing
facilities to the new QMP dispatch/registry facilities, should the
QMP monitor ever have a need for such a thing.

Ideally, to avoid support/compatability issues in the future,
blacklisting guest agent functionality will be the exceptional
case, but we add the functionality here to handle guest administrators
with specific requirements.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoAdd a .mailmap to map pre-git-conversion authors to friendly names
Peter Maydell [Mon, 12 Dec 2011 10:58:26 +0000 (10:58 +0000)]
Add a .mailmap to map pre-git-conversion authors to friendly names

Add a .mailmap file so 'git shortlog' can map the unfriendly
pre-git-conversion author entries to real names.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agounix_close(): check for close() errors too (v2)
Eduardo Habkost [Thu, 10 Nov 2011 12:41:48 +0000 (10:41 -0200)]
unix_close(): check for close() errors too (v2)

In case close() fails, we want to report the error back.

Changes v1 -> v2:
 - Use braces on if statement to match coding style

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agotcp_close(): check for close() errors too (v2)
Eduardo Habkost [Thu, 10 Nov 2011 12:41:47 +0000 (10:41 -0200)]
tcp_close(): check for close() errors too (v2)

In case close() fails, we want to report the error back.

Changes v1 -> v2:
 - Use braces on if statement to match coding style

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoexec_close(): return -errno on errors (v2)
Eduardo Habkost [Thu, 10 Nov 2011 12:41:46 +0000 (10:41 -0200)]
exec_close(): return -errno on errors (v2)

All qemu_fclose() callers were already changed to accept any negative
value as error, so we now can change it to return -errno.

When the process exits with a non-zero exit code, we return -EIO to as a
fake errno value.

Changes v1 -> v2:
 - Don't use "//" comments, to make checkpatch.pl happy

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agostdio_fclose: return -errno on errors (v2)
Eduardo Habkost [Thu, 10 Nov 2011 12:41:45 +0000 (10:41 -0200)]
stdio_fclose: return -errno on errors (v2)

This is what qemu_fclose() expects.

Changes v1 -> v2:
 - Add braces to if statement to match coding style

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agostdio_pclose: return -errno on error (v3)
Eduardo Habkost [Thu, 10 Nov 2011 12:41:44 +0000 (10:41 -0200)]
stdio_pclose: return -errno on error (v3)

This is what qemu_fclose() expects.

Changes v1 -> v2:
 - On success, keep returning pclose() return value, instead of always 0.

Changes v2 -> v3:
 - Add braces on if statements to match coding style

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoqemu_fclose: return last_error if set (v3)
Eduardo Habkost [Thu, 10 Nov 2011 12:41:43 +0000 (10:41 -0200)]
qemu_fclose: return last_error if set (v3)

This will make sure no error will be missed as long as callers always
check for qemu_fclose() return value. For reference, this is the
complete list of qemu_fclose() callers:

 - exec_close(): already fixed to check for negative values, not -1
 - migrate_fd_cleanup(): already fixed to consider only negative values
   as error, not any non-zero value
 - exec_accept_incoming_migration(): no return value check (yet)
 - fd_accept_incoming_migration(): no return value check (yet)
 - tcp_accept_incoming_migration(): no return value check (yet)
 - unix_accept_incoming_migration(): no return value check (yet)
 - do_savevm(): no return value check (yet)
 - load_vmstate(): no return value check (yet)

Changes v1 -> v2:
 - Add small comment about the need to return previously-spotted errors

Changes v2 -> v3:
 - Add braces to "if" statements to match coding style

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agomigrate_fd_cleanup: accept any negative qemu_fclose() value as error
Eduardo Habkost [Thu, 10 Nov 2011 12:41:42 +0000 (10:41 -0200)]
migrate_fd_cleanup: accept any negative qemu_fclose() value as error

Also, we now return the qemu_fclose() value unchanged to the caller. For
reference, the migrate_fd_cleanup() callers are the following:

- migrate_fd_completed(): any negative value is considered an
  error, so the change is OK.
- migrate_fd_error(): doesn't check the migrate_fd_cleanup() return value
- migrate_fd_cancel(): doesn't check the migrate_fd_cleanup() return
  value

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoexec_close(): accept any negative value as qemu_fclose() error
Eduardo Habkost [Thu, 10 Nov 2011 12:41:41 +0000 (10:41 -0200)]
exec_close(): accept any negative value as qemu_fclose() error

Note that we don't return the unchanged return value back yet, because
we need to change all qemu_fclose() callers to accept any positive value
as success.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoQEMUFileCloseFunc: add return value documentation (v2)
Eduardo Habkost [Thu, 10 Nov 2011 12:41:40 +0000 (10:41 -0200)]
QEMUFileCloseFunc: add return value documentation (v2)

qemu_fclose() and QEMUFile->close will return -errno on error, and any
positive value on success.

We need the positive non-zero success values because
migration-exec.c:exec_close() relies on non-zero return values to get
the process exit code.

Changes v1 -> v2:
 - Cosmetic spelling change on comment text

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agosavevm: use qemu_file_set_error() instead of setting last_error directly
Eduardo Habkost [Thu, 10 Nov 2011 12:41:39 +0000 (10:41 -0200)]
savevm: use qemu_file_set_error() instead of setting last_error directly

Some code uses qemu_file_set_error() already, so use it everywhere
when setting last_error, for consistency.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agohw/usb-net.c: Fix precedence bug when checking rndis_state
Peter Maydell [Wed, 9 Nov 2011 21:09:23 +0000 (21:09 +0000)]
hw/usb-net.c: Fix precedence bug when checking rndis_state

"!X == 2" is always false (spotted by Coverity), so the checks
for whether rndis is in the correct state would never fire.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRemove unnecessary casts from PCI DMA code in usb-uhci
David Gibson [Fri, 4 Nov 2011 01:03:38 +0000 (12:03 +1100)]
Remove unnecessary casts from PCI DMA code in usb-uhci

This patch removes some unnecessary casts in the usb-uhci device,
introduced by commit fff23ee9a5de74ab111b3cea9eec56782e7d7c50
'usb-uhci: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRemove unnecessary casts from PCI DMA code in usb-ehci
David Gibson [Fri, 4 Nov 2011 01:03:37 +0000 (12:03 +1100)]
Remove unnecessary casts from PCI DMA code in usb-ehci

This patch removes some unnecessary casts in the usb-ehci device,
introduced by commit 68d553587c0aa271c3eb2902921b503740d775b6
'usb-ehci: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRemove unnecessary casts from PCI DMA code in rtl8139
David Gibson [Fri, 4 Nov 2011 01:03:36 +0000 (12:03 +1100)]
Remove unnecessary casts from PCI DMA code in rtl8139

This patch removes some unnecessary casts in the rtl8139 device,
introduced by commit 3ada003aee2004d24f23b9cd6f4eda87d9601ddb
'rtl8139: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRemove unnecessary casts from PCI DMA code in lsi53c895a
David Gibson [Fri, 4 Nov 2011 01:03:35 +0000 (12:03 +1100)]
Remove unnecessary casts from PCI DMA code in lsi53c895a

This patch removes some unnecessary casts in the lsi53c895a device,
introduced by commit 9ba4524cda1348cbe741535f77815dca6a57da05
'lsi53c895a: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRemove unnecessary casts from PCI DMA code in PCI IDE
David Gibson [Fri, 4 Nov 2011 01:03:34 +0000 (12:03 +1100)]
Remove unnecessary casts from PCI DMA code in PCI IDE

This patch removes some unnecessary casts in the PCI IDE device,
introduced by commit 552908fef5b67ad9d96b76d7cb8371ebc26c9bc8
'PCI IDE: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRemove unnecessary casts from PCI DMA code in e1000
David Gibson [Fri, 4 Nov 2011 01:03:33 +0000 (12:03 +1100)]
Remove unnecessary casts from PCI DMA code in e1000

This patch removes some unnecessary casts in the e1000 device,
introduced by commit 62ecbd353d25e62c4a6c327ea88ba5404e13507a 'e1000:
Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoRemove unnecessary casts from PCI DMA code in eepro100
David Gibson [Fri, 4 Nov 2011 01:03:32 +0000 (12:03 +1100)]
Remove unnecessary casts from PCI DMA code in eepro100

This patch removes some unnecessary casts in the eepro100 device,
introduced by commit 16ef60c9a8eeee269f7cbc95219a431b1d7cbf29
'eepro100: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMerge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
Anthony Liguori [Mon, 12 Dec 2011 16:08:57 +0000 (10:08 -0600)]
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging

13 years agoMerge remote-tracking branch 'qmp/queue/qmp' into staging
Anthony Liguori [Mon, 12 Dec 2011 16:08:08 +0000 (10:08 -0600)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging

13 years agocris: Handle conditional stores on CRISv10
Stefan Sandstrom [Mon, 12 Dec 2011 10:38:31 +0000 (11:38 +0100)]
cris: Handle conditional stores on CRISv10

Signed-off-by: Stefan Sandstrom <Stefan.Sandstrom@axis.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
13 years agohw/mpcore.c: Merge with hw/arm11mpcore.c
Peter Maydell [Mon, 5 Dec 2011 14:09:18 +0000 (14:09 +0000)]
hw/mpcore.c: Merge with hw/arm11mpcore.c

hw/mpcore.c is now implementing only ARM11MPCore specific peripherals,
and is #included only from hw/arm11mpcore.c, so just merge it into that
file.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agohw/a9mpcore.c: Implement A9MP peripherals rather than 11MPcore ones
Peter Maydell [Thu, 1 Dec 2011 21:16:34 +0000 (21:16 +0000)]
hw/a9mpcore.c: Implement A9MP peripherals rather than 11MPcore ones

Implement the A9MP private peripheral region correctly, rather
than piggybacking on the 11MPCore code; the two CPUs are not the
same in this area.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agohw/mpcore: Clean up mpcore_priv_read/write as they are now SCU only
Peter Maydell [Mon, 5 Dec 2011 13:49:18 +0000 (13:49 +0000)]
hw/mpcore: Clean up mpcore_priv_read/write as they are now SCU only

The only code left in mpcore_priv_read and mpcore_priv_write is now
the implementation of the SCU registers. Clean up by renaming functions
and removing some unnecessary conditionals to make this clearer.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agohw/realview_gic: Use GIC memory region for the CPU interface
Peter Maydell [Mon, 5 Dec 2011 13:44:14 +0000 (13:44 +0000)]
hw/realview_gic: Use GIC memory region for the CPU interface

Use the GIC provided memory region for the CPU interface rather
than implementing our own.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agohw/mpcore.c: Use the GIC memory regions for the CPU interface
Peter Maydell [Mon, 5 Dec 2011 13:43:26 +0000 (13:43 +0000)]
hw/mpcore.c: Use the GIC memory regions for the CPU interface

Switch to using the GIC memory regions for the CPU interface
rather than hand implementing them as a subcase of mpcore_priv_read()
and mpcore_priv_write().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agohw/arm_gic: Expose GIC CPU interfaces as sysbus memory regions
Peter Maydell [Mon, 5 Dec 2011 12:52:33 +0000 (12:52 +0000)]
hw/arm_gic: Expose GIC CPU interfaces as sysbus memory regions

Expose the ARM GIC CPU interfaces as memory regions, rather than
just providing read and write functions for them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agohw/arm_mptimer.c: Turn ARM MPcore private timers into qdev devices
Peter Maydell [Mon, 5 Dec 2011 15:47:49 +0000 (15:47 +0000)]
hw/arm_mptimer.c: Turn ARM MPcore private timers into qdev devices

Turn the ARM MPcore private timer/watchdog blocks into separate
qdev devices. This will allow us to share them neatly between
11MPCore and A9MPcore.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agoFix sp804 dual-timer
Peter Chubb [Mon, 12 Dec 2011 10:25:42 +0000 (10:25 +0000)]
Fix sp804 dual-timer

Properly implement dual-timer read/write for the sp804 dual timer module.
Based on ARM specs at
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0271d/index.html

Signed-off-by: Hans Jang <hsjang@ok-labs.com>
Signed-off-by: David Mirabito <david.mirabito@nicta.com.au>
Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13 years agoMerge branch 'master' of git://git.qemu.org/qemu
malc [Mon, 12 Dec 2011 00:12:31 +0000 (04:12 +0400)]
Merge branch 'master' of git://git.qemu.org/qemu

13 years agoUpdate README
Anthony Liguori [Sun, 11 Dec 2011 23:49:23 +0000 (17:49 -0600)]
Update README

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
13 years agoMerge branch 'master' of git://git.qemu.org/qemu
malc [Sun, 11 Dec 2011 20:47:40 +0000 (00:47 +0400)]
Merge branch 'master' of git://git.qemu.org/qemu

13 years agotarget-i386: fix cmpxchg instruction emulation
Andreas Gustafsson [Sun, 11 Dec 2011 20:46:32 +0000 (00:46 +0400)]
target-i386: fix cmpxchg instruction emulation

When the i386 cmpxchg instruction is executed with a memory operand
and the comparison result is "unequal", do the memory write before
changing the accumulator instead of the other way around, because
otherwise the new accumulator value will incorrectly be used in the
comparison when the instruction is restarted after a page fault.

This bug was originally reported on 2010-04-25 as
https://bugs.launchpad.net/qemu/+bug/569760

Signed-off-by: Andreas Gustafsson <gson@gson.org>
13 years agow32: Disable buffering for log file
Stefan Weil [Sat, 3 Dec 2011 21:32:37 +0000 (22:32 +0100)]
w32: Disable buffering for log file

W32 does not support line buffering, but it supports unbuffered output.

Unbuffered output is better for writing to qemu.log than fully buffered
output because it also shows the latest log messages when an application
crash occurs.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agow32: QEMU applications with SDL are always GUI applications
Stefan Weil [Sat, 3 Dec 2011 21:32:21 +0000 (22:32 +0100)]
w32: QEMU applications with SDL are always GUI applications

Since commit 1d14ffa97eacd3cb722271eaf6f093038396eac4 (in 2005),
QEMU applications on W32 don't use the default SDL compiler flags:

Instead of a GUI application, a console application is created.

This has disadvantages (there is always an empty console window) and
no obvious reason, so this patch removes the strange flag modification.

The SDL GUI applications still can be run from a console window
and even send stdout and stderr to that console by setting environment
variable SDL_STDIO_REDIRECT=no.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoconfigure: Enable build by default PIE / read-only relocation sections on OpenBSD...
Brad [Tue, 29 Nov 2011 00:53:49 +0000 (19:53 -0500)]
configure: Enable build by default PIE / read-only relocation sections on OpenBSD amd64/i386.

Enable build by default PIE / read-only relocation sections for the QEMU
binaries on OpenBSD amd64/i386.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agobsd_user: Fix potential null pointer dereference
Stefan Weil [Mon, 21 Nov 2011 20:06:22 +0000 (21:06 +0100)]
bsd_user: Fix potential null pointer dereference

This bug was spotted by cppcheck.

Using g_try_malloc0 (as does the linux-user code) fixes this.

v2:
Use g_free in bsdload.c, too. Thanks to Peter Maydell for this hint.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agovirtio-pci: use pci macros
Hui Kai Ran [Thu, 8 Dec 2011 05:49:13 +0000 (13:49 +0800)]
virtio-pci: use pci macros

Signed-off-by: Hui Kai Ran <hkran@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>