]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agoVMDK: separate vmdk_read_extent/vmdk_write_extent
Fam Zheng [Fri, 12 Aug 2011 15:19:29 +0000 (23:19 +0800)]
VMDK: separate vmdk_read_extent/vmdk_write_extent

Factor out read/write extent code, since there will be more things to
take care of once reading/writing compressed clusters is introduced.

Signed-off-by: Fam Zheng <famcool@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoVMDK: add twoGbMaxExtentSparse support
Fam Zheng [Fri, 12 Aug 2011 15:19:28 +0000 (23:19 +0800)]
VMDK: add twoGbMaxExtentSparse support

Add twoGbMaxExtentSparse support. Introduce vmdk_free_last_extent.

Signed-off-by: Fam Zheng <famcool@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoVMDK: enable twoGbMaxExtentFlat
Fam Zheng [Fri, 12 Aug 2011 15:19:27 +0000 (23:19 +0800)]
VMDK: enable twoGbMaxExtentFlat

Enable the createType 'twoGbMaxExtentFlat'. The supporting code is
already in.

Signed-off-by: Fam Zheng <famcool@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Declare qemu_blockalign() in block.h, not block_int.h
Markus Armbruster [Wed, 3 Aug 2011 13:08:19 +0000 (15:08 +0200)]
block: Declare qemu_blockalign() in block.h, not block_int.h

Device models should be able to use it without an unclean include of
block_int.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agospitz tosa: Simplify "drive is suitable for microdrive" test
Markus Armbruster [Wed, 3 Aug 2011 13:08:13 +0000 (15:08 +0200)]
spitz tosa: Simplify "drive is suitable for microdrive" test

We try the drive defined with -drive if=ide,index=0 (or equivalent
sugar).  We use it only if (dinfo && bdrv_is_inserted(dinfo->bdrv) &&
!bdrv_is_removable(dinfo->bdrv)).  This is a convoluted way to test
for "drive media can't be removed".

The only way to create such a drive with -drive if=ide is media=cdrom.
And that sets dinfo->media_cd, so just test that.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoxen: Clean up pci_piix3_xen_ide_unplug()'s test for "not a CD"
Markus Armbruster [Wed, 3 Aug 2011 13:08:12 +0000 (15:08 +0200)]
xen: Clean up pci_piix3_xen_ide_unplug()'s test for "not a CD"

pci_piix3_xen_ide_unplug() unplugs only disks, not CD-ROMs.  It peeks
into the DriveInfo's BlockDriverState to distinguish between the two.
Unclean; use DriveInfo member media_cd, like xen_config_dev_blk().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agosavevm: Include writable devices with removable media
Markus Armbruster [Wed, 3 Aug 2011 13:08:11 +0000 (15:08 +0200)]
savevm: Include writable devices with removable media

savevm and loadvm silently ignore block devices with removable media,
such as floppies and SD cards.  Rolling back a VM to a previous
checkpoint will *not* roll back writes to block devices with removable
media.

Moreover, bdrv_is_removable() is a confused mess, and wrong in at
least one case: it considers "-drive if=xen,media=cdrom -M xenpv"
removable.  It'll be cleaned up later in this series.

Read-only block devices are also ignored, but that's okay.

Fix by ignoring only read-only block devices and empty block devices.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Clean up bdrv_flush_all()
Markus Armbruster [Wed, 3 Aug 2011 13:08:10 +0000 (15:08 +0200)]
block: Clean up bdrv_flush_all()

Change (!bdrv_is_removable(bs) || bdrv_is_inserted(bs)) to just
bdrv_is_inserted().  Rationale:

    The value of bdrv_is_removable(bs) matters only when
    bdrv_is_inserted(bs) is false.

    bdrv_is_inserted(bs) is true when bs is open (bs->drv != NULL) and
    not an empty host drive (CD-ROM or floppy).

    Therefore, bdrv_is_removable(bs) matters only when:

    1. bs is not open
       old: may call bdrv_flush(bs), which does nothing
       new: won't call

    2. bs is an empty host drive
       old: may call bdrv_flush(bs), which calls driver method
            raw_flush(), which calls fdatasync() or equivalent, which
            can't do anything useful while the drive is empty
       new: won't call

Result is bs->drv && !bdrv_is_read_only(bs) && bdrv_is_inserted(bs).
bdrv_is_inserted(bs) implies bs->drv.  Drop the redundant test.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: Make media change detection more robust
Markus Armbruster [Wed, 3 Aug 2011 13:08:09 +0000 (15:08 +0200)]
fdc: Make media change detection more robust

fdctrl_change_cb() gets called on a virtual media change via monitor.
It would be nice if host device block drivers called it on physical
media change, but they don't.

bdrv_media_changed() lets you poll for media change, but it returns
"don't know" except with block driver "host_floppy".

FDrive member media_changed gets set on device initialization and by
fdctrl_change_cb(), and cleared by fdctrl_media_changed().  Thus, it's
set on first entry to fdctrl_media_changed() since device
initialization or virtual media change.

fdctrl_media_changed() ignores media_changed unless
bdrv_media_changed() returns "don't know".  If we change media via
monitor (setting media_changed), and the new media's block driver
returns 0, we lose.  Fortunately, "host_floppy" always returns 1 on
first call.  Brittle.  Clean it up not to rely on it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Leave tracking media change to device models
Markus Armbruster [Wed, 3 Aug 2011 13:08:08 +0000 (15:08 +0200)]
block: Leave tracking media change to device models

hw/fdc.c is the only one that cares.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock/raw: Fix to forward method bdrv_media_changed()
Markus Armbruster [Wed, 3 Aug 2011 13:08:07 +0000 (15:08 +0200)]
block/raw: Fix to forward method bdrv_media_changed()

Block driver "raw" forwards most methods to the underlying block
driver.  However, it doesn't implement method bdrv_media_changed().
Makes bdrv_media_changed() always return -ENOTSUP.

I believe -fda /dev/fd0 gives you raw over host_floppy, and disk
change detection (fdc register 7 bit 7) is broken.  Testing my theory
requires a computer museum, though.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Give vmstate structs internal linkage where possible
Markus Armbruster [Wed, 3 Aug 2011 13:08:04 +0000 (15:08 +0200)]
ide: Give vmstate structs internal linkage where possible

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Clean up case label indentation in ide_exec_cmd()
Markus Armbruster [Wed, 3 Aug 2011 13:07:44 +0000 (15:07 +0200)]
ide: Clean up case label indentation in ide_exec_cmd()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: Update command code definitions as per ACS-2 Table B.2
Markus Armbruster [Wed, 3 Aug 2011 13:07:43 +0000 (15:07 +0200)]
ide: Update command code definitions as per ACS-2 Table B.2

Drop WIN_SRST, it has the same value as WIN_DEVICE_RESET.

Drop unused WIN_RESTORE, it has the same value as WIN_RECAL.

Drop codes that are not implemented and long obsolete: WIN_READ_LONG,
WIN_READ_LONG_ONCE, WIN_WRITE_LONG, WIN_WRITE_LONG_ONCE, WIN_FORMAT
(all obsolete since ATA4), WIN_ACKMEDIACHANGE, WIN_POSTBOOT,
WIN_PREBOOT (obsolete since ATA3), WIN_WRITE_SAME (obsolete since
ATA3, code reused for something else in ACS2), WIN_IDENTIFY_DMA
(obsolete since ATA4).

Drop codes that are not implemented and vendor-specific:
EXABYTE_ENABLE_NEST, DISABLE_SEAGATE.

Drop WIN_INIT, it isn't implemented, its value used to be reserved,
and is used for something else since ATA8.

CFA_IDLEIMMEDIATE isn't specific to CFATA.  ACS-2 shows it as a
defined command in ATA-1, -2 and -3.  Rename to WIN_IDLEIMMEDIATE2.

Mark vendor specific, retired, and obsolete codes.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Split change_cb() into change_media_cb(), resize_cb()
Markus Armbruster [Wed, 3 Aug 2011 13:07:42 +0000 (15:07 +0200)]
block: Split change_cb() into change_media_cb(), resize_cb()

Multiplexing callbacks complicates matters needlessly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Generalize change_cb() to BlockDevOps
Markus Armbruster [Wed, 3 Aug 2011 13:07:41 +0000 (15:07 +0200)]
block: Generalize change_cb() to BlockDevOps

So we can more easily add device model callbacks.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: Attach non-qdev devices as well
Markus Armbruster [Wed, 3 Aug 2011 13:07:40 +0000 (15:07 +0200)]
block: Attach non-qdev devices as well

For now, this just protects against programming errors like having the
same drive back multiple non-qdev devices, or untimely bdrv_delete().
Later commits will add other interesting uses.

While there, rename BlockDriverState member peer to dev, bdrv_attach()
to bdrv_attach_dev(), bdrv_detach() to bdrv_detach_dev(), and
bdrv_get_attached() to bdrv_get_attached_dev().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoasync: Allow nested qemu_bh_poll calls
Kevin Wolf [Thu, 1 Sep 2011 14:16:10 +0000 (16:16 +0200)]
async: Allow nested qemu_bh_poll calls

qemu may segfault when a BH handler first deletes a BH and then (possibly
indirectly) calls a nested qemu_bh_poll(). This is because the inner instance
frees the BH and deletes it from the list that the outer one processes.

This patch deletes BHs only in the outermost qemu_bh_poll instance.

Commit 7887f620 already tried to achieve the same, but it assumed that the BH
handler would only delete its own BH. With a nested qemu_bh_poll(), this isn't
guaranteed, so that commit wasn't enough. Hope this one fixes it for real.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: Fix error cases to run depedent requests
Kevin Wolf [Thu, 1 Sep 2011 13:02:13 +0000 (15:02 +0200)]
qcow2: Fix error cases to run depedent requests

Requests depending on a failed request would end up waiting forever. This fixes
the error path to continue dependent requests even when the request has failed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: Properly initialise QcowL2Meta
Kevin Wolf [Thu, 1 Sep 2011 13:00:42 +0000 (15:00 +0200)]
qcow2: Properly initialise QcowL2Meta

Dependency list pointers filled with random garbage from the stack aren't a
good idea.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agolinux aio: some comments
Frediano Ziglio [Tue, 30 Aug 2011 07:46:11 +0000 (09:46 +0200)]
linux aio: some comments

Add some notes about Linux AIO explaining why we don't use AIO in
some situations.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoapb_pci: convert PCI space to memory API
Blue Swirl [Sat, 3 Sep 2011 16:38:02 +0000 (16:38 +0000)]
apb_pci: convert PCI space to memory API

Add a new memory space for PCI instead of using system memory.

This also fixes a bug where VGA region vga.chain4 is
accidentally mapped to 0xa0000 instead of 0x1ff000a0000.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agofw_cfg: fix crash if FW_CFG_WRITE_CHANNEL is used incorrectly
Blue Swirl [Fri, 26 Aug 2011 18:43:18 +0000 (18:43 +0000)]
fw_cfg: fix crash if FW_CFG_WRITE_CHANNEL is used incorrectly

Avoid a crash if the guest combines FW_CFG_WRITE_CHANNEL with
a wrong value.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agosoftfloat: Use uint32 consistently
Andreas Färber [Sun, 28 Aug 2011 18:24:34 +0000 (20:24 +0200)]
softfloat: Use uint32 consistently

Prepares for uint32 replacement.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agosoftfloat: Use uint16 consistently
Andreas Färber [Sun, 28 Aug 2011 18:24:33 +0000 (20:24 +0200)]
softfloat: Use uint16 consistently

Prepares for uint16 replacement.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoAllow overriding the location of Samba's smbd.
Brad [Fri, 2 Sep 2011 20:53:28 +0000 (16:53 -0400)]
Allow overriding the location of Samba's smbd.

Allow overriding the location of Samba's smbd.

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

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoUse new macro QEMU_PACKED for packed structures
Stefan Weil [Wed, 31 Aug 2011 10:38:01 +0000 (12:38 +0200)]
Use new macro QEMU_PACKED for packed structures

Most changes were made using these commands:

git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/'
git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/'

Whitespace in linux-user/syscall_defs.h was fixed manually
to avoid warnings from scripts/checkpatch.pl.

Manual changes were also applied to hw/pc.c.

I did not fix indentation with tabs in block/vvfat.c.
The patch will show 4 errors with scripts/checkpatch.pl.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoAdd new macro QEMU_PACKED for packed C structures
Stefan Weil [Wed, 31 Aug 2011 10:38:00 +0000 (12:38 +0200)]
Add new macro QEMU_PACKED for packed C structures

A packed struct needs different gcc attributes for compilations
with MinGW compilers because glib-2.0 adds compiler flag
-mms-bitfields which modifies the packing algorithm.

Attribute gcc_struct reverses the negative effects of -mms-bitfields.
QEMU_PACKED sets this attribute and must be used for any packed
struct which is affected by -mms-bitfields.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agorename qemu_malloc and related to glib names for coherence
Frediano Ziglio [Wed, 31 Aug 2011 07:25:35 +0000 (09:25 +0200)]
rename qemu_malloc and related to glib names for coherence

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoFix install(1) usage to be compatible with OpenBSD's install(1).
Brad [Sun, 28 Aug 2011 08:01:33 +0000 (04:01 -0400)]
Fix install(1) usage to be compatible with OpenBSD's install(1).

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

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

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoRename qemu -> qemu-system-i386
Anthony Liguori [Mon, 29 Aug 2011 14:55:36 +0000 (09:55 -0500)]
Rename qemu -> qemu-system-i386

This has been discussed before in the past.  The special casing really makes no
sense anymore.  This seems like a good change to make for 1.0.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomain: force enabling of I/O thread
Anthony Liguori [Mon, 22 Aug 2011 13:24:58 +0000 (08:24 -0500)]
main: force enabling of I/O thread

Enabling the I/O thread by default seems like an important part of declaring
1.0.  Besides allowing true SMP support with KVM, the I/O thread means that the
TCG VCPU doesn't have to multiplex itself with the I/O dispatch routines which
currently requires a (racey) signal based alarm system.

I know there have been concerns about performance.  I think so far the ones that
have come up (virtio-net) are most likely due to secondary reasons like
decreased batching.

I think we ought to force enabling I/O thread early in 1.0 development and
commit to resolving any lingering issues.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agotrace: fix out-of-tree builds
Anthony Liguori [Fri, 2 Sep 2011 15:28:35 +0000 (10:28 -0500)]
trace: fix out-of-tree builds

Reported-by: Lluis Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Fri, 2 Sep 2011 15:08:48 +0000 (10:08 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Thu, 1 Sep 2011 18:57:19 +0000 (13:57 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm-tmp/memory/core' into staging
Anthony Liguori [Thu, 1 Sep 2011 18:55:58 +0000 (13:55 -0500)]
Merge remote-tracking branch 'qemu-kvm-tmp/memory/core' into staging

12 years agobuild: sort objects to remove duplicates for link
Stefan Hajnoczi [Thu, 25 Aug 2011 08:18:52 +0000 (09:18 +0100)]
build: sort objects to remove duplicates for link

Avoid duplicate object files during the link.  There are legitimate
cases where a link command-line would include duplicate object files
because two independent subsystems both depend on common infrastructure.

Use GNU make's $(sort) function to remove duplicate object files from
the link command-line.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomain: switch qemu_set_fd_handler to g_io_add_watch
Anthony Liguori [Mon, 22 Aug 2011 13:12:53 +0000 (08:12 -0500)]
main: switch qemu_set_fd_handler to g_io_add_watch

This patch changes qemu_set_fd_handler to be implemented in terms of
g_io_add_watch().  The semantics are a bit different so some glue is required.

qemu_set_fd_handler2 is much harder to convert because of its use of polling.

The glib main loop has the major of advantage of having a proven thread safe
architecture.  By using the glib main loop instead of our own, it will allow us
to eventually introduce multiple I/O threads.

I'm pretty sure that this will work on Win32, but I would appreciate some help
testing.  I think the semantics of g_io_channel_unix_new() are really just tied
to the notion of a "unix fd" and not necessarily unix itself.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoAdd glib support to main loop
Anthony Liguori [Mon, 22 Aug 2011 13:12:52 +0000 (08:12 -0500)]
Add glib support to main loop

This allows GSources to be used to register callback events in QEMU.  This is
useful as it allows us to take greater advantage of glib and also because it
allows us to write code that is more easily testable outside of QEMU since we
can make use of glib's main loop in unit tests.

All new code should use glib's callback mechanisms for registering fd events
which are very well documented at:

http://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html

And:

http://developer.gnome.org/gio/stable/

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agotcg/ppc/tcg-target.c: Avoid 'set but not used' gcc warnings
Peter Maydell [Thu, 1 Sep 2011 15:45:01 +0000 (16:45 +0100)]
tcg/ppc/tcg-target.c: Avoid 'set but not used' gcc warnings

Move the declaration and initialisation of some variables in
tcg_out_qemu_ld and tcg_out_qemu_st inside CONFIG_SOFTMMU, to
avoid the "variable set but not used" warning of gcc 4.6.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: malc <av1474@comtv.ru>
12 years agosimpletrace: fix process() argument count
Stefan Hajnoczi [Thu, 25 Aug 2011 17:03:49 +0000 (18:03 +0100)]
simpletrace: fix process() argument count

The simpletrace.process() function invokes analyzer methods with the
wrong number of arguments if a timestamp should be included.  This patch
fixes the issue so that trace analysis scripts can make use of
timestamps.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotrace: enable all events
Lluís [Wed, 31 Aug 2011 18:31:58 +0000 (20:31 +0200)]
trace: enable all events

Given that all events with programmatically-controlled state are disabled by
default, we can delete the "disable" property from all events.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: [stderr] add support for dynamically enabling/disabling events
Lluís [Wed, 31 Aug 2011 18:31:51 +0000 (20:31 +0200)]
trace: [stderr] add support for dynamically enabling/disabling events

Uses the generic interface provided in "trace/control.h" in order to provide
a programmatic interface as well as command line and monitor controls.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: [simple] disable all trace points by default
Lluís [Wed, 31 Aug 2011 18:31:45 +0000 (20:31 +0200)]
trace: [simple] disable all trace points by default

Note that this refers to the backend-specific state (whether the output must be
generated), not the event "disabled" property (which always uses the "nop"
backend).

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: always use the "nop" backend on events with the "disable" keyword
Lluís [Wed, 31 Aug 2011 18:31:38 +0000 (20:31 +0200)]
trace: always use the "nop" backend on events with the "disable" keyword

Any event with the keyword/property "disable" generates an empty trace event
using the "nop" backend, regardless of the current backend.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: add "-trace events" argument to control initial state
Lluís [Wed, 31 Aug 2011 18:31:31 +0000 (20:31 +0200)]
trace: add "-trace events" argument to control initial state

The "-trace events" argument can be used to provide a file with a list of trace
event names that will be enabled prior to starting execution, thus providing
early tracing.

This saves the user from manually toggling event states through the monitor
interface or whichever backend-specific interface.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: always compile support for controlling and querying trace event states
Lluís [Wed, 31 Aug 2011 18:31:24 +0000 (20:31 +0200)]
trace: always compile support for controlling and querying trace event states

The current interface is generic for this small set of operations, and thus
other backends can easily modify the "trace/control.c" file to add their own
implementation.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: separate trace event control and query routines from the simple backend
Lluís [Wed, 31 Aug 2011 18:31:18 +0000 (20:31 +0200)]
trace: separate trace event control and query routines from the simple backend

Generalize the 'st_print_trace_events' and 'st_change_trace_event_state' into
backend-specific 'trace_print_events' and 'trace_event_set_state' (respectively)
in the "trace/control.h" file.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: generalize the "property" concept in the trace-events file
Lluís [Wed, 31 Aug 2011 18:31:10 +0000 (20:31 +0200)]
trace: generalize the "property" concept in the trace-events file

This adds/modifies the following functions:

* get_name: Get _only_ the event name
* has_property: Return whether an event has a property (keyword before the event
  name)

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: avoid conditional code compilation during option parsing
Lluís [Wed, 31 Aug 2011 18:31:03 +0000 (20:31 +0200)]
trace: avoid conditional code compilation during option parsing

A default implementation for backend-specific routines is provided in
"trace/default.c", which backends can override by setting "trace_default=no" in
"configure".

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: move backend-specific code into the trace/ directory
Lluís [Wed, 31 Aug 2011 18:30:57 +0000 (20:30 +0200)]
trace: move backend-specific code into the trace/ directory

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: [make] replace 'ifeq' with values in CONFIG_TRACE_*
Lluís [Wed, 31 Aug 2011 18:30:50 +0000 (20:30 +0200)]
trace: [make] replace 'ifeq' with values in CONFIG_TRACE_*

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotrace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*
Lluís [Wed, 31 Aug 2011 18:30:43 +0000 (20:30 +0200)]
trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_*

Provides a more hierarchical view of the variable domain.

Also adds the CONFIG_TRACE_* variables for all backends.

[Stefan added missing 'test' in stap if statement]

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agobuild: [simple] Include qemu-timer-common.o in trace-obj-y
Lluís [Wed, 31 Aug 2011 18:30:37 +0000 (20:30 +0200)]
build: [simple] Include qemu-timer-common.o in trace-obj-y

Helper programs like qemu-ga use tracing primitives, but qemu-timer-common.o
(also used by simpletrace.o) is not necessarily included in the linkage line.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agobuild: Fix linkage of QEMU_PROG
Lluís [Wed, 31 Aug 2011 18:30:30 +0000 (20:30 +0200)]
build: Fix linkage of QEMU_PROG

Using '$^' to establish the files to link with will remove any repeated entries
in the list of dependencies.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotusb6010: Convert to qdev
Peter Maydell [Tue, 30 Aug 2011 17:36:56 +0000 (18:36 +0100)]
tusb6010: Convert to qdev

Convert the tusb6010 to qdev.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
12 years agomemory: Fix memory_region_get_ram_ptr for ROM devices
Jan Kiszka [Mon, 29 Aug 2011 22:38:24 +0000 (00:38 +0200)]
memory: Fix memory_region_get_ram_ptr for ROM devices

Mask out the sub-page bits that are used by ROM device for storing the
io-index and the IO_MEM_ROMD flag.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoMerge branch 'omap-for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm...
Edgar E. Iglesias [Mon, 29 Aug 2011 21:59:06 +0000 (23:59 +0200)]
Merge branch 'omap-for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm into pm

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 29 Aug 2011 14:57:06 +0000 (09:57 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm/memory/core' into staging
Anthony Liguori [Mon, 29 Aug 2011 13:48:43 +0000 (08:48 -0500)]
Merge remote-tracking branch 'qemu-kvm/memory/core' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm/memory/urgent' into staging
Anthony Liguori [Mon, 29 Aug 2011 13:48:28 +0000 (08:48 -0500)]
Merge remote-tracking branch 'qemu-kvm/memory/urgent' into staging

12 years agoMerge remote-tracking branch 'mst/for_anthony' into staging
Anthony Liguori [Mon, 29 Aug 2011 13:48:15 +0000 (08:48 -0500)]
Merge remote-tracking branch 'mst/for_anthony' into staging

12 years agoMerge remote-tracking branch 'qmp/queue/monitor' into staging
Anthony Liguori [Mon, 29 Aug 2011 13:48:07 +0000 (08:48 -0500)]
Merge remote-tracking branch 'qmp/queue/monitor' into staging

12 years agoqemu-img: Require larger zero areas for sparse handling
Kevin Wolf [Fri, 26 Aug 2011 13:27:13 +0000 (15:27 +0200)]
qemu-img: Require larger zero areas for sparse handling

By default, require 4k of consecutive zero bytes for qemu-img to make the
output file sparse by not issuing a write request for the zeroed parts. Add an
-S option to allow users to tune this setting.

This helps to avoid situations where a lot of zero sectors and data sectors are
mixed and qemu-img tended to issue many tiny 512 byte writes.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoFix spelling in comments and debug messages (recieve -> receive)
Stefan Weil [Sun, 28 Aug 2011 19:45:40 +0000 (21:45 +0200)]
Fix spelling in comments and debug messages (recieve -> receive)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agohw/pci-stub: fix comment typo
Alon Levy [Fri, 26 Aug 2011 19:06:01 +0000 (22:06 +0300)]
hw/pci-stub: fix comment typo

[Stefan fixed "doesn't" -> "don't"]

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agomemory: fix rom_device I/O mode
Avi Kivity [Mon, 29 Aug 2011 06:12:49 +0000 (09:12 +0300)]
memory: fix rom_device I/O mode

When adding a rom_device in I/O mode, we incorrectly masked off the low
bits, resulting in a pure RAM map.  Fix my masking off the high bits and
IO_MEM_ROMD, yielding a pure I/O map.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoomap_gpmc: Implement prefetch engine
Peter Maydell [Sun, 28 Aug 2011 16:22:20 +0000 (16:22 +0000)]
omap_gpmc: Implement prefetch engine

This commit implements the prefetch engine feature of the GPMC
which can be used for NAND devices. This includes both interrupt
driven and DMA-filling modes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap: Wire up the DMA request line to the GPMC
Peter Maydell [Sun, 28 Aug 2011 16:22:20 +0000 (16:22 +0000)]
omap: Wire up the DMA request line to the GPMC

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Pull prefetch engine data into sub-struct
Peter Maydell [Sun, 28 Aug 2011 16:22:20 +0000 (16:22 +0000)]
omap_gpmc: Pull prefetch engine data into sub-struct

Refactor the gpmc state structure so items relating to
the prefetch engine are in their own sub-struct and have
more useful names.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Accept a zero mask field on omap3630
Juha Riihimäki [Sun, 28 Aug 2011 16:22:20 +0000 (16:22 +0000)]
omap_gpmc: Accept a zero mask field on omap3630

OMAP3630 adds an extra bit of address masking, so a mask of
0xb1111 is valid. Unfortunately the GPMC_REVISION is the same as
on the OMAP3430 which only has three bits of address masking, so
we have to derive this feature directly from the OMAP revision
rather than from the GPMC revision.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/omap.h: Add OMAP 3630 to omap_mpu_model enumeration
Peter Maydell [Sun, 28 Aug 2011 16:22:20 +0000 (16:22 +0000)]
hw/omap.h: Add OMAP 3630 to omap_mpu_model enumeration

Add the OMAP 3630 to the omap_mpu_model enumeration, and add the
corresponding cpu_is_omap3630() function.

(OMAP3 isn't supported yet but this is useful in upgrading common
components to be "OMAP3 ready". We already have this for OMAP3430.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Support NAND devices
Peter Maydell [Sun, 28 Aug 2011 16:22:19 +0000 (16:22 +0000)]
omap_gpmc: Support NAND devices

Support accesses to NAND devices, both by mapping them into
the GPMC address space, and via the NAND_COMMAND, NAND_ADDRESS
and NAND_DATA GPMC registers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Reindent misindented switch statements
Peter Maydell [Sun, 28 Aug 2011 16:22:19 +0000 (16:22 +0000)]
omap_gpmc: Reindent misindented switch statements

Whitespace-only change fixing indentation.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Calculate revision from OMAP model
Juha Riihimäki [Sun, 28 Aug 2011 16:22:19 +0000 (16:22 +0000)]
omap_gpmc: Calculate revision from OMAP model

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Take omap_mpu_state* in omap_gpmc_init
Juha Riihimäki [Sun, 28 Aug 2011 16:22:19 +0000 (16:22 +0000)]
omap_gpmc: Take omap_mpu_state* in omap_gpmc_init

Take a pointer to the omap mpu state struct in omap_gpmc_init.
Some details of GPMC behaviour depend on the OMAP version we
are a part of.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Fix handling of FIFOTHRESHOLDSTATUS bit
Peter Maydell [Sun, 28 Aug 2011 16:22:19 +0000 (16:22 +0000)]
omap_gpmc: Fix handling of FIFOTHRESHOLDSTATUS bit

The OMAP3 TRM is inconsistent about whether the GPMC FIFOTHRESHOLDSTATUS
bit should be set when FIFOPOINTER > FIFOTHRESHOLD or when it is >=
FIFOTHRESHOLD. Apparently the underlying functional spec from which
the TRM was created states that the behaviour is ">=", and this also
makes more conceptual sense.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Wire up the GPMC IRQ correctly
Peter Maydell [Sun, 28 Aug 2011 16:22:18 +0000 (16:22 +0000)]
omap_gpmc: Wire up the GPMC IRQ correctly

The omap_gpmc wasn't actually wiring up its IRQ, so
anything that provoked an interrupt would be using
uninitialised data for its IRQ number.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: GPMC_IRQSTATUS is write-one-to-clear
Peter Maydell [Sun, 28 Aug 2011 16:22:18 +0000 (16:22 +0000)]
omap_gpmc: GPMC_IRQSTATUS is write-one-to-clear

Fix a bug in the handling of writes to GPMC_IRQSTATUS:
it behaves as "write one to clear, writing zero is ignored".

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Refactor omap_gpmc_cs_map and omap_gpmc_cs_unmap
Peter Maydell [Sun, 28 Aug 2011 16:22:18 +0000 (16:22 +0000)]
omap_gpmc: Refactor omap_gpmc_cs_map and omap_gpmc_cs_unmap

Refactor the omap_gpmc_cs_map/unmap functions:
 * take the omap_gpmc_s* and a chipselect id rather than the
   omap_gpmc_cs_file_s*, so they have access to the general gpmc
   member fields
 * extract the base and mask from the config registers in the functions
   rather than at every callsite
 * check for CSVALID in the functions rather than at every callsite

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoomap_gpmc: Clean up omap_gpmc_attach MemoryRegion conversion
Peter Maydell [Sun, 28 Aug 2011 16:22:18 +0000 (16:22 +0000)]
omap_gpmc: Clean up omap_gpmc_attach MemoryRegion conversion

Now that all callers of omap_gpmc_attach pass in a MemoryRegion*,
we can remove the base_update and unmap function pointer arguments,
and the opaque pointer that was passed into these callbacks.

We can also remove the base and size fields from omap_gpmc_cs_file_s
as these are no longer necessary (you don't need the base/size
to unmap a MemoryRegion the way you did to undo a mapping made
with cpu_register_physical_memory()).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/onenand: Minor spacing fixes
Juha Riihimäki [Sun, 28 Aug 2011 16:22:17 +0000 (16:22 +0000)]
hw/onenand: Minor spacing fixes

Minor whitespace-only cleanup (separated out from the qdevifying
patch for clarity).

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/onenand: Qdevify
Juha Riihimäki [Sun, 28 Aug 2011 16:22:17 +0000 (16:22 +0000)]
hw/onenand: Qdevify

Qdevify the ONENAND device.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/onenand: Remove unnecessary argument from onenand_command()
Juha Riihimäki [Sun, 28 Aug 2011 16:33:02 +0000 (16:33 +0000)]
hw/onenand: Remove unnecessary argument from onenand_command()

Refactor onenand_command() -- since it is essentially a method of
the device object, it doesn't make sense to pass in something as
an argument which is one of the object's own member fields.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
[Riku Voipio: Fixes and restructuring patchset]
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
[Peter Maydell: More fixes and cleanups for upstream submission]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/sysbus: Add sysbus_mmio_get_region()
Peter Maydell [Sun, 28 Aug 2011 16:22:17 +0000 (16:22 +0000)]
hw/sysbus: Add sysbus_mmio_get_region()

Add a sysbus_mmio_get_region() which allows users of sysbus
devices to turn a (SysBusDevice*, mmioidx) tuple into a
MemoryRegion*. This enables some useful simplifications of
devices which pass through another device's mmio region
(either directly or by implementing some kind of memory
controller device).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agosh_pci: Fix sh_pci memory alias confusion
Avi Kivity [Sun, 28 Aug 2011 15:17:04 +0000 (18:17 +0300)]
sh_pci: Fix sh_pci memory alias confusion

The a7 area was set up as an alias of itself, rather than the p4 area.  This
sent the memory core into infinite recursion.

Fix by aliasing the a7 area to the p4 area.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoFix disabling interrupts in sun4u
Artyom Tarasenko [Mon, 25 Jul 2011 17:22:38 +0000 (19:22 +0200)]
Fix disabling interrupts in sun4u

clear interrupt request if the interrupt priority < CPU pil
clear hardware interrupt request if interrupts are disabled

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
[blauwirbel@gmail.com: added a comment about magic 2]
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoxilinx: Convert most xilinx devices to MemoryRegion
Edgar E. Iglesias [Thu, 25 Aug 2011 22:13:47 +0000 (00:13 +0200)]
xilinx: Convert most xilinx devices to MemoryRegion

This converts ethlite, intc, timer and uartlite to use
MemoryRegions.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
12 years agoTCG: improve optimizer debugging
Blue Swirl [Sat, 30 Jul 2011 19:18:32 +0000 (19:18 +0000)]
TCG: improve optimizer debugging

Use enum TCGOpcode instead of plain old int so that the name of
current op can be seen in GDB. Add a default case to switch
so that GCC does not complain about unhandled enum cases.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agodyngen-exec.h: cleanup
Blue Swirl [Sat, 30 Jul 2011 15:50:22 +0000 (15:50 +0000)]
dyngen-exec.h: cleanup

Remove unused or otherwise available stuff.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agog364fb: convert to qdev
Hervé Poussineau [Fri, 26 Aug 2011 19:20:12 +0000 (21:20 +0200)]
g364fb: convert to qdev

Extract G364 ROM contents from device emulation to machine emulation,
so device emulation can be reused in other machines (Commodore Amiga)

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agog364fb: use trace framework
Hervé Poussineau [Fri, 26 Aug 2011 19:20:11 +0000 (21:20 +0200)]
g364fb: use trace framework

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agocheckpatch: fix braces {} handling
Pavel Borzenkov [Fri, 26 Aug 2011 13:34:37 +0000 (17:34 +0400)]
checkpatch: fix braces {} handling

checkpatch.pl doesn't report warning for if/else statements with missing
'else' braces:

if (something) {
    foo;
} else
    bar;

The patch has been tested using the last 100 commits.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix linker scripts
Gerd Hoffmann [Fri, 26 Aug 2011 09:16:10 +0000 (11:16 +0200)]
Fix linker scripts

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix build on OpenBSD with BSD userland emu and smartcard NSS enabled
Brad [Mon, 22 Aug 2011 20:39:59 +0000 (16:39 -0400)]
Fix build on OpenBSD with BSD userland emu and smartcard NSS enabled

The first issue is the hard coded POSIX Real Time extensions library in the
libcacard/Makefile. From looking at the code it doesn't seem this is necessary
anyway. Robert Relyea seems to think it most likely isn't necessary.

The second issue was the missing exclusion of the BSD userland binary
builds from the addition of this Makefile target for the smartcard NSS
code which breaks the builds if smartcard NSS support is enabled.

pastebin clip of the build failure..

http://pastebin.com/raw.php?i=BLCKd3s6

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoblock: latency accounting
Christoph Hellwig [Thu, 25 Aug 2011 06:26:10 +0000 (08:26 +0200)]
block: latency accounting

Account the total latency for read/write/flush requests.  This allows
management tools to average it based on a snapshot of the nr ops
counters and allow checking for SLAs or provide statistics.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovhost-net: cleanup host notifiers at last step
Michael S. Tsirkin [Thu, 11 Aug 2011 07:21:18 +0000 (10:21 +0300)]
vhost-net: cleanup host notifiers at last step

When the vhost notifier is disabled, the userspace handler runs
immediately: virtio_pci_set_host_notifier_internal might
call virtio_queue_notify_vq.
Since the VQ state and the tap backend state aren't
recovered yet, this causes
"Guest moved used index from XXX to YYY" assertions.

The solution is to split out host notifier handling
from vhost VQ setup and disable notifiers as our last step
when we stop vhost-net. For symmetry enable them first thing
on start.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
12 years agolinux-user: Correct a few missuses of host addresses
Edgar E. Iglesias [Mon, 22 Aug 2011 16:44:58 +0000 (18:44 +0200)]
linux-user: Correct a few missuses of host addresses

Fix a few cases where we were passing host pointers to the
guest.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
12 years agomemory: add opaque parameter to memory_region_init_rom_device()
Avi Kivity [Thu, 25 Aug 2011 21:35:15 +0000 (00:35 +0300)]
memory: add opaque parameter to memory_region_init_rom_device()

The MemoryRegionOps callbacks expect it.

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agomicroblaze: Add an MSR_PVR constant and use it.
Edgar E. Iglesias [Thu, 25 Aug 2011 06:41:19 +0000 (16:41 +1000)]
microblaze: Add an MSR_PVR constant and use it.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>