sdk/emulator/qemu.git
12 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Thu, 1 Mar 2012 21:26:01 +0000 (15:26 -0600)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

* qemu-kvm/uq/master:
  pc-bios: update kvmvapic.bin
  kvmvapic: Use optionrom helpers
  optionsrom: Reserve space for checksum
  kvmvapic: Simplify mp/up_set_tpr
  kvmvapic: Introduce TPR access optimization for Windows guests
  kvmvapic: Add option ROM
  target-i386: Add infrastructure for reporting TPR MMIO accesses
  Allow to use pause_all_vcpus from VCPU context
  Process pending work while waiting for initial kick-off in TCG mode
  Remove useless casts from cpu iterators
  kvm: Set cpu_single_env only once
  kvm: Synchronize cpu state in kvm_arch_stop_on_emulation_error()

12 years agopc-bios: update kvmvapic.bin
Avi Kivity [Thu, 1 Mar 2012 10:58:46 +0000 (12:58 +0200)]
pc-bios: update kvmvapic.bin

Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Wed, 29 Feb 2012 18:57:28 +0000 (12:57 -0600)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony: (27 commits)
  qemu-img: fix segment fault when the image format is qed
  qemu-io: fix segment fault when the image format is qed
  qemu-tool: revert cpu_get_clock() abort(3)
  qemu-iotests: Test rebase with short backing file
  qemu-iotests: 026: Reduce output changes for cache=none qcow2
  qemu-iotests: Filter out DOS line endings
  test: add image streaming tests
  qemu-iotests: add iotests Python module
  qemu-iotests: export TEST_DIR for non-bash tests
  QMP: Add qmp command for blockdev-group-snapshot-sync
  qapi: Introduce blockdev-group-snapshot-sync command
  qcow2: Reject too large header extensions
  qcow2: Fix offset in qcow2_read_extensions
  block: drop aio_multiwrite in BlockDriver
  block: remove unused fields in BlockDriverState
  qcow2: Fix build with DEBUG_EXT enabled
  ide: fail I/O to empty disk
  fdc: DIR (Digital Input Register) should return status of current drive...
  fdc: fix seek command, which shouldn't check tracks
  fdc: check if media rate is correct before doing any transfer
  ...

12 years agoMerge remote-tracking branch 'spice/spice.v49' into staging
Anthony Liguori [Wed, 29 Feb 2012 18:54:08 +0000 (12:54 -0600)]
Merge remote-tracking branch 'spice/spice.v49' into staging

* spice/spice.v49:
  qxl: properly handle upright and non-shared surfaces
  Error out when tls-channel option is used without TLS
  spice: use error_report to report errors
  qxl: add optinal 64bit vram bar
  qxl: make qxl_render_update async
  qxl: introduce QXLCookie
  qxl: remove flipped
  qxl: require spice >= 0.8.2
  qxl: drop qxl_spice_update_area_async definition
  sdl: remove NULL check, g_malloc0 can't fail
  qxl: fix spice+sdl no cursor regression

12 years agoMerge remote-tracking branch 'kraxel/usb.39' into staging
Anthony Liguori [Wed, 29 Feb 2012 15:11:00 +0000 (09:11 -0600)]
Merge remote-tracking branch 'kraxel/usb.39' into staging

* kraxel/usb.39: (21 commits)
  usb: Resolve warnings about unassigned bus on usb device creation
  usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint
  usb-redir: Limit return values returned by iso packets
  usb-redir: Let the usb-host know about our device filtering
  usb-redir: Always clear device state on filter reject
  usb-redir: Fix printing of device version
  ehci: drop old stuff
  usb-ehci: Handle ISO packets failing with an error other then NAK
  libcacard: fix reported ATR length
  usb-ccid: advertise SELF_POWERED
  libcacard: link with glib for g_strndup
  usb-desc: fix user trigerrable segfaults (!config)
  usb-ehci: sanity-check iso xfers
  usb: add tracepoint for usb packet state changes.
  usb-xhci: enable packet queuing
  usb-uhci: implement packet queuing
  usb-uhci: process uhci_handle_td return code via switch.
  usb-uhci: add UHCIQueue
  usb-uhci: cleanup UHCIAsync allocation & initialization.
  usb-ehci: fix reset
  ...

12 years agoqemu-img: fix segment fault when the image format is qed
Zhi Yong Wu [Sun, 19 Feb 2012 14:24:35 +0000 (22:24 +0800)]
qemu-img: fix segment fault when the image format is qed

[root@f15 qemu]# qemu-img info /home/zwu/work/misc/rh6.img
image: /home/zwu/work/misc/rh6.img
file format: qed
virtual size: 4.0G (4294967296 bytes)
disk size: 1.2G
cluster_size: 65536
Segmentation fault (core dumped)

Today when i were fixing another issue, i found this issue; After simple
investigation, i found that the required clock vm_clock is not created
for qemu tool.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-io: fix segment fault when the image format is qed
Zhi Yong Wu [Sun, 19 Feb 2012 14:24:59 +0000 (22:24 +0800)]
qemu-io: fix segment fault when the image format is qed

[root@f15 qemu]# qemu-io -c info /home/zwu/work/misc/rh6.img
format name: qed
cluster size: 64 KiB
vm state offset: 0.000000 bytes
Segmentation fault (core dumped)

This reason is same as the former patch

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-tool: revert cpu_get_clock() abort(3)
Stefan Hajnoczi [Wed, 29 Feb 2012 14:41:32 +0000 (14:41 +0000)]
qemu-tool: revert cpu_get_clock() abort(3)

Despite the fact that the qemu-tool environment has no guest running and
vm_clock therefore does not make sense, there is code that gets the
vm_clock time even in qemu-tool.  Therefore, revert the abort(3) call
and just return 0 like we used to.  This unbreaks qemu-img/qemu-io with
QED and Kevin has also expressed interest in this for qcow2.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: Test rebase with short backing file
Kevin Wolf [Wed, 15 Feb 2012 14:03:25 +0000 (15:03 +0100)]
qemu-iotests: Test rebase with short backing file

This tests that qemu-img rebase doesn't assume that the backing file has
the same size as the image, but considers that it can be smaller.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqemu-iotests: 026: Reduce output changes for cache=none qcow2
Kevin Wolf [Fri, 29 Apr 2011 13:32:55 +0000 (15:32 +0200)]
qemu-iotests: 026: Reduce output changes for cache=none qcow2

qemu-iotests supports the -nocache option which makes the tests run with
cache=none. For blkdebug tests with qcow2 this means that we may see
test results that differ from cache=writethrough. This patch makes the
diff a bit smaller and therefore easier to review.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqemu-iotests: Filter out DOS line endings
Kevin Wolf [Fri, 29 Apr 2011 13:30:25 +0000 (15:30 +0200)]
qemu-iotests: Filter out DOS line endings

This one makes it possible to run qemu-iotests on a Windows build using Wine
and get somewhat meaningful results.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotest: add image streaming tests
Stefan Hajnoczi [Wed, 29 Feb 2012 13:25:22 +0000 (13:25 +0000)]
test: add image streaming tests

This patch adds a test suite for the image streaming feature.  It
exercises the 'block_stream', 'block_job_cancel', 'block_job_set_speed',
and 'query-block-jobs' QMP commands.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: add iotests Python module
Stefan Hajnoczi [Wed, 29 Feb 2012 13:25:21 +0000 (13:25 +0000)]
qemu-iotests: add iotests Python module

Block layer tests that involve QMP commands rather than qemu-img or
qemu-io are not well-suited for shell scripting.  This patch adds a
Python module which allows tests to be written in Python instead.

The basic API is:

  VM          - class for launching and interacting with a VM
  QMPTestCase - abstract base class for tests that use QMP
  qemu_img()  - wrapper function for invoking qemu-img
  qemu_io()   - wrapper function for invoking qemu-io
  imgfmt      - the image format under test (e.g. qcow2, qed)
  test_dir    - scratch directory path for temporary files
  main()      - entry point for running tests

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: export TEST_DIR for non-bash tests
Stefan Hajnoczi [Wed, 29 Feb 2012 13:25:20 +0000 (13:25 +0000)]
qemu-iotests: export TEST_DIR for non-bash tests

Since qemu-iotests may need to create large image files it is possible
to specify the test directory.  The TEST_DIR variable needs to be
exported so non-bash tests can make use of it.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoQMP: Add qmp command for blockdev-group-snapshot-sync
Jeff Cody [Tue, 28 Feb 2012 20:54:07 +0000 (15:54 -0500)]
QMP: Add qmp command for blockdev-group-snapshot-sync

This adds the QMP command for blockdev-group-snapshot-sync. It
takes an array in as the input, for the argument devlist.  The
array consists of the following elements:

    + device:        device to snapshot. e.g. "ide-hd0", "virtio0"
    + snapshot-file: path & file for the snapshot image. e.g. "/tmp/file.img"
    + format:        snapshot format. e.g., "qcow2". Optional

There is no HMP equivalent for the command.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqapi: Introduce blockdev-group-snapshot-sync command
Jeff Cody [Tue, 28 Feb 2012 20:54:06 +0000 (15:54 -0500)]
qapi: Introduce blockdev-group-snapshot-sync command

This is a QAPI/QMP only command to take a snapshot of a group of
devices. This is similar to the blockdev-snapshot-sync command, except
blockdev-group-snapshot-sync accepts a list devices, filenames, and
formats.

It is attempted to keep the snapshot of the group atomic; if the
creation or open of any of the new snapshots fails, then all of
the new snapshots are abandoned, and the name of the snapshot image
that failed is returned.  The failure case should not interrupt
any operations.

Rather than use bdrv_close() along with a subsequent bdrv_open() to
perform the pivot, the original image is never closed and the new
image is placed 'in front' of the original image via manipulation
of the BlockDriverState fields.  Thus, once the new snapshot image
has been successfully created, there are no more failure points
before pivoting to the new snapshot.

This allows the group of disks to remain consistent with each other,
even across snapshot failures.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: Reject too large header extensions
Kevin Wolf [Wed, 22 Feb 2012 11:37:13 +0000 (12:37 +0100)]
qcow2: Reject too large header extensions

Image files that make qemu-img info read several gigabytes into the
unknown header extensions list are bad. Just fail opening the image
if an extension claims to be larger than the header extension area.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqcow2: Fix offset in qcow2_read_extensions
Kevin Wolf [Wed, 22 Feb 2012 11:31:47 +0000 (12:31 +0100)]
qcow2: Fix offset in qcow2_read_extensions

The spec says that the length of extensions is padded to 8 bytes, not
the offset. Currently this is the same because the header size is a
multiple of 8, so this is only about compatibility with future changes
to the header size.

While touching it, move the calculation to a common place instead of
duplicating it for each header extension type.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoblock: drop aio_multiwrite in BlockDriver
Paolo Bonzini [Tue, 21 Feb 2012 15:43:52 +0000 (16:43 +0100)]
block: drop aio_multiwrite in BlockDriver

These were never used.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: remove unused fields in BlockDriverState
Paolo Bonzini [Mon, 20 Feb 2012 16:58:34 +0000 (17:58 +0100)]
block: remove unused fields in BlockDriverState

sync_aiocb is unused since commit ce1a14d (Dynamically allocate AIO
Completion Blocks., 2006-08-07).

private is unused since commit 56a1493 (drive cleanup fixes., 2009-09-25).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: Fix build with DEBUG_EXT enabled
Kevin Wolf [Fri, 17 Feb 2012 17:45:33 +0000 (18:45 +0100)]
qcow2: Fix build with DEBUG_EXT enabled

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide: fail I/O to empty disk
Paolo Bonzini [Wed, 15 Feb 2012 10:46:11 +0000 (11:46 +0100)]
ide: fail I/O to empty disk

Requesting a read or a write operation on an empty disk can lead
to QEMU dumping core.

Also fix a few braces here and there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: DIR (Digital Input Register) should return status of current drive...
Hervé Poussineau [Mon, 6 Feb 2012 21:29:12 +0000 (22:29 +0100)]
fdc: DIR (Digital Input Register) should return status of current drive...

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: fix seek command, which shouldn't check tracks
Hervé Poussineau [Mon, 6 Feb 2012 21:29:11 +0000 (22:29 +0100)]
fdc: fix seek command, which shouldn't check tracks

The seek command just sends step pulses to the drive and doesn't care if
there is a medium inserted of if it is banging the head against the drive.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: check if media rate is correct before doing any transfer
Hervé Poussineau [Mon, 6 Feb 2012 21:29:10 +0000 (22:29 +0100)]
fdc: check if media rate is correct before doing any transfer

The programmed rate has to be the same as the required rate for the
floppy format ; if that's not the case, the transfer should abort.
This check can be disabled by using the 'check_media_rate' property.

Save media rate value only if media rate check is enabled.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: add a 'check media rate' property. Not used yet
Hervé Poussineau [Mon, 6 Feb 2012 21:29:09 +0000 (22:29 +0100)]
fdc: add a 'check media rate' property. Not used yet

Set it to true for current Qemu versions, and false for previous ones

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: add a transfer rate for floppy types
Hervé Poussineau [Mon, 6 Feb 2012 21:29:07 +0000 (22:29 +0100)]
block: add a transfer rate for floppy types

Floppies must be read at a specific transfer rate, depending of its own format.
Update floppy description table to include required transfer rate.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: add CCR (Configuration Control Register) write register
Hervé Poussineau [Mon, 6 Feb 2012 21:29:06 +0000 (22:29 +0100)]
fdc: add CCR (Configuration Control Register) write register

DIR and CCR registers share the same address ; DIR is read-only
while CCR is write-only

CCR register is used to change media transfer rate, which will be
checked in following changes.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: handle read-only floppies (abort early on write commands)
Hervé Poussineau [Mon, 6 Feb 2012 21:29:05 +0000 (22:29 +0100)]
fdc: handle read-only floppies (abort early on write commands)

A real floppy doesn't attempt to write to read-only media either.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: most control commands do not generate interrupts
Hervé Poussineau [Mon, 6 Feb 2012 21:29:04 +0000 (22:29 +0100)]
fdc: most control commands do not generate interrupts

In fact, only three control commands generate an interrupt:
read_id, recalibrate and seek

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: set busy bit when starting a command
Hervé Poussineau [Mon, 6 Feb 2012 21:29:03 +0000 (22:29 +0100)]
fdc: set busy bit when starting a command

This bit must be active while a command is currently executed.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: take side count into account
Hervé Poussineau [Mon, 6 Feb 2012 21:29:02 +0000 (22:29 +0100)]
fdc: take side count into account

Floppies can be simple or double-sided. However, current code
was only taking the common case into account (ie 2 sides).

This repairs single-sided floppies, which where totally broken
before this patch : for track > 0, wrong sector number was
calculated, and data was read/written at wrong place on
underlying device.

Fortunately, only some 360 kB floppies are single-sided, so
this bug was probably not seen much.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqxl: properly handle upright and non-shared surfaces
Gerd Hoffmann [Mon, 27 Feb 2012 10:05:09 +0000 (11:05 +0100)]
qxl: properly handle upright and non-shared surfaces

Although qxl creates a shared displaysurface when the qxl surface is
upright and doesn't need to be flipped there is no guarantee that the
surface doesn't become unshared for some reason.  Rename qxl_flip to
qxl_blit and fix it to handle both flip and non-flip cases.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoError out when tls-channel option is used without TLS
Christophe Fergeau [Fri, 24 Feb 2012 17:28:32 +0000 (18:28 +0100)]
Error out when tls-channel option is used without TLS

It's currently possible to setup spice channels using TLS when
no TLS port has been specified (ie TLS is disabled). This cannot
work, so better to error out in such a situation.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agospice: use error_report to report errors
Christophe Fergeau [Fri, 24 Feb 2012 17:13:12 +0000 (18:13 +0100)]
spice: use error_report to report errors

Error message reporting during spice startup wasn't consistent, it was done
with fprintf(stderr, "") but sometimes the message didn't have a trailing
\n. Using error_report make the intent of the message clearer and deal
with the final \n for us.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqxl: add optinal 64bit vram bar
Gerd Hoffmann [Fri, 14 Oct 2011 16:05:48 +0000 (18:05 +0200)]
qxl: add optinal 64bit vram bar

This patch adds an 64bit pci bar for vram.  It is turned off by default.
It can be enabled by setting the size of the 64bit bar to be larger than
the 32bit bar.  Both 32bit and 64bit bar refer to the same memory.  Only
the first part of the memory is available via 32bit bar.

The intention is to allow large vram sizes for 64bit guests, by allowing
the vram bar being mapped above 4G, so we don't have to squeeze it into
the pci I/O window below 4G.

With vram_size_mb=16 and vram64_size_mb=256 it looks like this:

00:02.0 VGA compatible controller: Red Hat, Inc. Device 0100 (rev 02) (prog-if 00 [VGA controller])
        Subsystem: Red Hat, Inc Device 1100
        Physical Slot: 2
        Flags: fast devsel, IRQ 10
        Memory at f8000000 (32-bit, non-prefetchable) [size=64M]
        Memory at fc000000 (32-bit, non-prefetchable) [size=16M]
        Memory at fd020000 (32-bit, non-prefetchable) [size=8K]
        I/O ports at c5a0 [size=32]
        Memory at ffe0000000 (64-bit, prefetchable) [size=256M]
        Expansion ROM at fd000000 [disabled] [size=64K]

[ mapping above 4G needs patched seabios:
  http://www.kraxel.org/cgit/seabios/commit/?h=pci64 ]

12 years agoMerge remote-tracking branch 'aneesh/for-upstream' into staging
Anthony Liguori [Mon, 27 Feb 2012 17:19:27 +0000 (11:19 -0600)]
Merge remote-tracking branch 'aneesh/for-upstream' into staging

* aneesh/for-upstream:
  hw/9pfs: Endian fixes for virtfs
  ./configure: add option for disabling VirtFS

12 years agousb: Resolve warnings about unassigned bus on usb device creation
Jan Kiszka [Mon, 27 Feb 2012 14:18:47 +0000 (15:18 +0100)]
usb: Resolve warnings about unassigned bus on usb device creation

When creating an USB device the old way, there is no way to specify the
target bus. Thus the warning issued by usb_create makes no sense and
rather confuses our users.

Resolve this by passing a bus reference to the usbdevice_init handler
and letting those handlers forward it to usb_create.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoslirp: Fix assertion failure on rejected DHCP requests
David Gibson [Fri, 24 Feb 2012 00:23:28 +0000 (01:23 +0100)]
slirp: Fix assertion failure on rejected DHCP requests

The guest network stack might DHCPREQUEST an address that the slirp built
in dhcp server can't let it have - for example if the guest has an old
leases file from another network configuration.  In this case the dhcp
server should and does reject the request and prepares to send a DHCPNAK
to the client.

However, in this case the daddr variable in bootp_reply() is set to
0.0.0.0.  Shortly afterwards, it unconditionally attempts to pre-insert the
new client address into the ARP table.  This causes an assertion failure in
arp_address_add() because of the 0.0.0.0 address.

According to RFC2131, DHCPNAK messages for clients on the same subnet
must be sent to the broadcast address (S3.2, subpoint 2).

Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: Refactor if_start
Jan Kiszka [Fri, 17 Feb 2012 15:35:36 +0000 (16:35 +0100)]
slirp: Refactor if_start

Replace gotos with a while loop, fix coding style.

CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
CC: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: Fix requeuing of batchq packets in if_start
Jan Kiszka [Fri, 17 Feb 2012 15:26:38 +0000 (16:26 +0100)]
slirp: Fix requeuing of batchq packets in if_start

In case we requeued a packet that was the head of a longer session
queue, we failed to restore this ordering. Also, we did not properly
deal with changes to Slirp::next_m.

Instead of a cumbersome roll back, this fix simply avoids any changes
until we know if the packet was actually sent. Both fixes crashes due
to inconsistent queues and simplifies the logic.

Thanks to Zhi Yong Wu who found the reason for these crashes.

CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
CC: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: Clean up ifs_init
Jan Kiszka [Fri, 17 Feb 2012 13:39:30 +0000 (14:39 +0100)]
slirp: Clean up ifs_init

Remove duplicate ifs_init macros, reimplement the logic as static inline
in mbuf.h.

CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agousb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint
Hans de Goede [Sun, 26 Feb 2012 15:14:47 +0000 (16:14 +0100)]
usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint

We should return USB_RET_NAK, rather then a 0 sized packet, when we've no data
for an interrupt IN endpoint.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-redir: Limit return values returned by iso packets
Hans de Goede [Sun, 26 Feb 2012 15:14:46 +0000 (16:14 +0100)]
usb-redir: Limit return values returned by iso packets

The usbredir protocol uses a status of usb_redir_stall to indicate that
an iso data stream has stopped (ie because the urbs failed on resubmit),
but iso packets should never return a result of USB_RET_STALL, since iso
endpoints cannot stall. So instead simply always return USB_RET_NAK on
iso stream errors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-redir: Let the usb-host know about our device filtering
Hans de Goede [Sun, 26 Feb 2012 15:14:45 +0000 (16:14 +0100)]
usb-redir: Let the usb-host know about our device filtering

libusbredirparser-0.3.4 adds 2 new packets which allows us to notify
the usb-host:
-about the usb device filter we have (if any), so that it knows not the even
 try to redirect certain devices
-when we reject a device based on filtering (in case it tries anyways)

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-redir: Always clear device state on filter reject
Hans de Goede [Sun, 26 Feb 2012 15:14:44 +0000 (16:14 +0100)]
usb-redir: Always clear device state on filter reject

Always call usbredir_device_disconnect() when usbredir_check_filter() fails
to clean up all the device state (ie received endpoint info).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-redir: Fix printing of device version
Hans de Goede [Sun, 26 Feb 2012 15:14:43 +0000 (16:14 +0100)]
usb-redir: Fix printing of device version

The device version is in bcd format, which requires some special handling to
print.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoehci: drop old stuff
Gerd Hoffmann [Mon, 27 Feb 2012 12:08:25 +0000 (13:08 +0100)]
ehci: drop old stuff

Drop the "ehci under development" banner.
Drop unused & inactive (#if 0) code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: Handle ISO packets failing with an error other then NAK
Hans de Goede [Sun, 26 Feb 2012 15:14:48 +0000 (16:14 +0100)]
usb-ehci: Handle ISO packets failing with an error other then NAK

Before this patch the ehci code was not checking for any other errors other
then USB_RET_NAK. This causes 2 problems:
1) Other errors are not reported to the guest.
2) When transactions with the ITD_XACT_IOC bit set completing with another
   error would not result in USBSTS_INT getting set.

I hit this problem when unplugging devices while iso data was streaming from
the device to the guest. When this happens it takes a while for the guest to
process the unplugging and remove ISO transactions from the ehci schedule, in
the mean time these transactions would complete with a result of USB_RET_NODEV,
which was not handled. This lead to the Linux guest's usb subsystem "hanging",
that is it would no longer see new usb devices getting plugged in and running
for example lsusb would lead to a stuck (D state) lsusb process. This patch
fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agolibcacard: fix reported ATR length
Alon Levy [Sun, 26 Feb 2012 16:09:24 +0000 (17:09 +0100)]
libcacard: fix reported ATR length

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ccid: advertise SELF_POWERED
Alon Levy [Sun, 26 Feb 2012 16:09:23 +0000 (17:09 +0100)]
usb-ccid: advertise SELF_POWERED

Before commit ed5a83ddd8c1d8ec7b1015315530cf29949e7c48 each device
provided it's own response to USB_REQ_GET_STATUS, but after it that
response was based on bmAttributes, which was errounously set for
usb-ccid as 0xa0 and not 0xe0.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agolibcacard: link with glib for g_strndup
Alon Levy [Sun, 26 Feb 2012 16:09:22 +0000 (17:09 +0100)]
libcacard: link with glib for g_strndup

Without it the produced library for make libcacard.la has an unresolved
symbol.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-desc: fix user trigerrable segfaults (!config)
Alon Levy [Sun, 26 Feb 2012 16:09:21 +0000 (17:09 +0100)]
usb-desc: fix user trigerrable segfaults (!config)

Check for dev->config being NULL in two places:
 USB_REQ_GET_CONFIGURATION and USB_REQ_GET_STATUS.

The behavior of USB_REQ_GET_STATUS is unspecified in the Default state,
that corresponds to dev->config being NULL (it defaults to NULL and is
reset whenever a SET_CONFIGURATION with value 0, or attachment). I
implemented it to correspond with the state before
ed5a83ddd8c1d8ec7b1015315530cf29949e7c48, the commit moving SET_STATUS
to usb-desc; if dev->config is not set we return whatever is in the
first configuration.

The behavior of USB_REQ_GET_CONFIGURATION is also undefined before any
SET_CONFIGURATION, but here we just return 0 (same as specified for the
Address state).

A win7 guest failed to initialize the device before this patch,
segfaulting when GET_STATUS was called with dev->config == NULL. With
this patch the passthrough device still doesn't work but the failure is
unrelated.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: sanity-check iso xfers
Gerd Hoffmann [Mon, 27 Feb 2012 10:23:08 +0000 (11:23 +0100)]
usb-ehci: sanity-check iso xfers

This patch adds a sanity check to itd processing to make sure the
endpoint addressed by the guest is actually an iso endpoint.  Also
verify that usb drivers don't return USB_RET_ASYNC which is illegal for
iso xfers.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: add tracepoint for usb packet state changes.
Gerd Hoffmann [Fri, 24 Feb 2012 10:03:27 +0000 (11:03 +0100)]
usb: add tracepoint for usb packet state changes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-xhci: enable packet queuing
Gerd Hoffmann [Fri, 24 Feb 2012 09:44:05 +0000 (10:44 +0100)]
usb-xhci: enable packet queuing

qemu usb core has packet queues now, so flip lets the switch.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-uhci: implement packet queuing
Gerd Hoffmann [Fri, 27 Jan 2012 16:27:31 +0000 (17:27 +0100)]
usb-uhci: implement packet queuing

When a usb device is busy processing a packet (and returns
USB_RET_ASYNC), continue walking the transfer descriptor list
and process them to fill the request queue.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-uhci: process uhci_handle_td return code via switch.
Gerd Hoffmann [Fri, 27 Jan 2012 15:38:42 +0000 (16:38 +0100)]
usb-uhci: process uhci_handle_td return code via switch.

Restruct the uhci_handle_td return code processing to make the
control flow more clear and the code more readable.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-uhci: add UHCIQueue
Gerd Hoffmann [Fri, 27 Jan 2012 13:17:06 +0000 (14:17 +0100)]
usb-uhci: add UHCIQueue

UHCIAsync structs (in-flight requests) grouped in UHCIQueue now.
Each (active) usb endpoint gets its own UHCIQueue.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-uhci: cleanup UHCIAsync allocation & initialization.
Gerd Hoffmann [Fri, 27 Jan 2012 13:17:59 +0000 (14:17 +0100)]
usb-uhci: cleanup UHCIAsync allocation & initialization.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: fix reset
Gerd Hoffmann [Thu, 23 Feb 2012 13:24:00 +0000 (14:24 +0100)]
usb-ehci: fix reset

Two reset fixes:
  * pick up s->usbcmd value after ehci_reset call to make sure it
    keeps the reset value and doesn't get rubbish filled in when
    val is written back to the mmio register array later on.
  * make sure the frame timer is zapped on reset.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-hid: fix tablet activation
Gerd Hoffmann [Thu, 23 Feb 2012 14:24:24 +0000 (15:24 +0100)]
usb-hid: fix tablet activation

Activate usb hid pointer devices (mouse+tablet) unconditionally
on polls, even if we NAK the poll due to lack of new events.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqxl: make qxl_render_update async
Alon Levy [Fri, 24 Feb 2012 21:19:31 +0000 (23:19 +0200)]
qxl: make qxl_render_update async

RHBZ# 747011

Removes the last user of QXL_SYNC when using update drivers that use the
_ASYNC io ports.

The last user is qxl_render_update, it is called both by qxl_hw_update
which is the vga_hw_update_ptr passed to graphic_console_init, and by
qxl_hw_screen_dump.

At the same time the QXLRect area being passed to the red_worker thread
is passed as a copy, as part of the QXLCookie.

The implementation uses interface_update_area_complete with a bh to make
sure dpy_update and qxl_flip are called from the io thread, otherwise
the vga->ds->surface.data can change under our feet.

With this patch sdl+spice works fine. But spice by itself doesn't
produce the expected screendumps unless repeated a few times, due to
ppm_save being called before update_area (rendering done in spice server
thread) having a chance to complete. Fixed by next patch, but see commit
message for problem introduced by it.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqxl: introduce QXLCookie
Alon Levy [Fri, 24 Feb 2012 21:19:30 +0000 (23:19 +0200)]
qxl: introduce QXLCookie

Will be used in the next patch.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqxl: remove flipped
Alon Levy [Fri, 24 Feb 2012 21:19:29 +0000 (23:19 +0200)]
qxl: remove flipped

Tested on linux and windows guests. For negative stride, qxl_flip copies
directly to vga->ds->surface->data, for positive it's reallocated to
share qxl->guest_primary.data

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqxl: require spice >= 0.8.2
Alon Levy [Fri, 24 Feb 2012 21:19:28 +0000 (23:19 +0200)]
qxl: require spice >= 0.8.2

drop all ifdefs on SPICE_INTERFACE_QXL_MINOR >= 1 as a result,
any check for SPICE_SERVER_VERSION that is now always satisfied,
and SPICE_INTERFACE_CORE_MINOR >= 3 tests, because
0.8.2 has SPICE_INTERFACE_QXL_MINOR == 1 and
SPICE_INTERFACE_CORE_MINOR == 3.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqxl: drop qxl_spice_update_area_async definition
Alon Levy [Fri, 24 Feb 2012 21:19:27 +0000 (23:19 +0200)]
qxl: drop qxl_spice_update_area_async definition

It was never used. Introduced in
5ff4e36c804157bd84af43c139f8cd3a59722db9
qxl: async io support using new spice api

But not used even then.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agosdl: remove NULL check, g_malloc0 can't fail
Alon Levy [Fri, 24 Feb 2012 21:19:26 +0000 (23:19 +0200)]
sdl: remove NULL check, g_malloc0 can't fail

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoqxl: fix spice+sdl no cursor regression
Alon Levy [Fri, 24 Feb 2012 21:19:25 +0000 (23:19 +0200)]
qxl: fix spice+sdl no cursor regression

regression introduced by 075360945860ad9bdd491921954b383bf762b0e5,

v2: lock around qemu_spice_cursor_refresh_unlocked

Reported-by: Fabiano Fidêncio <fabiano@fidencio.org>
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoaudio: Add some fall through comments
Stefan Weil [Sat, 25 Feb 2012 13:46:55 +0000 (14:46 +0100)]
audio: Add some fall through comments

Static code analysers expect these comments for case statements without
a break statement.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoconfigure: Check whether makecontext() is a glibc stub function
Peter Maydell [Thu, 23 Feb 2012 16:20:05 +0000 (16:20 +0000)]
configure: Check whether makecontext() is a glibc stub function

On some systems (notably ARM Linux) glibc provides implementations
of makecontext(), getcontext() and friends which are stubs which
always return failure. Make the configure test for makecontext()
also check for the presence of the __stub_makecontext macro which
indicates the presence of these stubs, so we can avoid trying to use
them and fall back to a different coroutine implementation instead.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovl.c: Avoid segfault when started with no arguments
Peter Maydell [Wed, 22 Feb 2012 22:40:00 +0000 (22:40 +0000)]
vl.c: Avoid segfault when started with no arguments

Fix a bug (introduced in commit a0abe47) where a command line which
specified no machine arguments (either explicitly or implicitly via
-kernel &co) would result in a segfault because of a NULL pointer
returned from qemu_opts_find(qemu_find_opts("machine"), 0).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agonic: zap obsolote romloading bits from ne2k + pcnet
Gerd Hoffmann [Wed, 8 Feb 2012 15:02:11 +0000 (16:02 +0100)]
nic: zap obsolote romloading bits from ne2k + pcnet

These days one just needs to specify the romfile in PCiDeviceInfo and
everything magically works.  It also allows to disable pxe rom loading
via "romfile=<emptystring>" like it is possible for all other nics.

[ v2: rebased & adapted to qom changes ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agobuild: allow turning off debuginfo
Gerd Hoffmann [Wed, 8 Feb 2012 12:54:13 +0000 (13:54 +0100)]
build: allow turning off debuginfo

This patch adds --{enable,disable}-debug-info switches to configure
which allows to include/exclude the '-g' switch on the gcc & ld
command lines.  Not building debug info reduces ressource usage
(especially disk) alot and is quite useful for test builds.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agooptimize screendump for the common non-switch case
Gerd Hoffmann [Fri, 24 Feb 2012 11:43:45 +0000 (12:43 +0100)]
optimize screendump for the common non-switch case

switch console only if needed, also pass down whenever the console was
switched or not because a displaysurface redraw is only needed in case
the console was switched.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoRemove screendump dummy functions.
Gerd Hoffmann [Fri, 24 Feb 2012 11:43:44 +0000 (12:43 +0100)]
Remove screendump dummy functions.

The code in console.c verifies whenever a screen_dump function
pointer is present before calling it, so there is no need to supply an
dummy function.  Remove them.  Also report an error to notify the user
that he didn't got a screenshot.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovga: simplify screendump
Gerd Hoffmann [Fri, 24 Feb 2012 11:43:43 +0000 (12:43 +0100)]
vga: simplify screendump

The displaychangelistener isn't needed at all, we can simply save the
image when vga_hw_update is done instead of hooking into the update
process.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosuspend: add qmp events
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:26 +0000 (13:45 +0100)]
suspend: add qmp events

Send qmp events on suspend and wakeup so libvirt
has a chance to track the vm state.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosuspend: make acpi timer wakeup the guest.
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:25 +0000 (13:45 +0100)]
suspend: make acpi timer wakeup the guest.

Make the acpi timer wake up the guest.
Guests can enable/disable this via acpi too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosuspend: make rtc alarm wakeup the guest.
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:24 +0000 (13:45 +0100)]
suspend: make rtc alarm wakeup the guest.

Make the rtc wake up the guest when the alarm fires.
Add acpi windup to property support RTC_EN, so guests
can enable and disable this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosuspend: make serial ports wakeup the guest.
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:23 +0000 (13:45 +0100)]
suspend: make serial ports wakeup the guest.

Add a 'wakeup' property to the serial port.  It is off by default.  When
enabled any incoming character on the serial line will wake up the
guest.  Useful for guests which have a serial console configured.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosuspend: make ps/2 devices wakeup the guest
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:22 +0000 (13:45 +0100)]
suspend: make ps/2 devices wakeup the guest

This patch adds wakeup support to ps/2 emulation.  Any key press on the
ps/2 keyboard will wakeup the guest.  Likewise any mouse button press
will wakeup the guest.  Mouse moves are ignored, so the guest will not
wakeup in case your mouse crosses the vnc window of a suspended guest by
accident.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosuspend: add system_wakeup monitor command
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:21 +0000 (13:45 +0100)]
suspend: add system_wakeup monitor command

This patch adds the system_wakeup monitor command which will simply
wake up suspended guests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosuspend: switch acpi s3 to new infrastructure.
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:20 +0000 (13:45 +0100)]
suspend: switch acpi s3 to new infrastructure.

This patch switches pc s3 suspend over to the new infrastructure.
The cmos_s3 qemu_irq is killed, the new notifier is used instead.
The xen hack goes away with that too, the hypercall can simply be
done in a notifier function now.

This patch also makes the guest actually stay suspended instead
of leaving suspend instantly, so it is useful for more than just
testing whenever the suspend/resume cycle actually works.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosuspend: add infrastructure
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:19 +0000 (13:45 +0100)]
suspend: add infrastructure

This patch adds some infrastructure to handle suspend and resume to
qemu.  First there are two functions to switch state and second there
is a suspend notifier:

 * qemu_system_suspend_request is supposed to be called when the
   guest asks for being be suspended, for example via ACPI.

 * qemu_system_wakeup_request is supposed to be called on events
   which should wake up the guest.

 * qemu_register_suspend_notifier can be used to register a notifier
   which will be called when the guest is suspended.  Machine types
   and device models can hook in there to modify state if needed.

 * qemu_register_wakeup_notifier can be used to register a notifier
   which will be called when the guest is woken up.  Machine types
   and device models can hook in there to modify state if needed.

 * qemu_system_wakeup_enable can be used to enable/disable wakeup
   events.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoacpi: add acpi_pm1_evt_write_en
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:18 +0000 (13:45 +0100)]
acpi: add acpi_pm1_evt_write_en

Do APCIREGS->pm1.evt.en updates using the new acpi_pm1_evt_write_en
function, so the acpi code will see those updates.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoacpi: don't pass overflow_time to acpi_pm1_evt_get_sts
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:17 +0000 (13:45 +0100)]
acpi: don't pass overflow_time to acpi_pm1_evt_get_sts

Pretty pointless, can easily be reached via ACPIREGS now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoacpi: add ACPIREGS
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:16 +0000 (13:45 +0100)]
acpi: add ACPIREGS

All those acpi structs are not independent from each other.
Various acpi functions expecting multiple acpi structs passed
in are a clean indicator for that ;)

So this patch bundles all acpi structs in the new ACPIREGS
struct, then use it everythere pass around acpi state.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoacpi: move around structs
Gerd Hoffmann [Thu, 23 Feb 2012 12:45:15 +0000 (13:45 +0100)]
acpi: move around structs

Group all structs at the top of hw/acpi.h.
Just moving around lines, no code changes.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:51:24 +0000 (09:51 -0600)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  slirp/misc: fix gcc __warn_memset_zero_len warnings
  vl.c: Increase width of machine name column in "-M ?" output
  tcg: Remove unneeded include statements

12 years agoMerge remote-tracking branch 'mdroth/qga-win32-pull-2-23-12' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:50:37 +0000 (09:50 -0600)]
Merge remote-tracking branch 'mdroth/qga-win32-pull-2-23-12' into staging

* mdroth/qga-win32-pull-2-23-12:
  qemu-ga: add win32 guest-shutdown command
  qemu-ga: add Windows service integration
  qemu-ga: add initial win32 support
  qemu-ga: fixes for win32 build of qemu-ga
  qemu-ga: rename guest-agent-commands.c -> commands-posix.c
  qemu-ga: separate out common commands from posix-specific ones
  qemu-ga: move channel/transport functionality into wrapper class
  qemu-ga: Add schema documentation for types

12 years agoMerge remote-tracking branch 'qmp/queue/qmp' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:45:22 +0000 (09:45 -0600)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging

* qmp/queue/qmp:
  qmp: add DEVICE_TRAY_MOVED event
  ide: drop ide_tray_state_post_load()
  block: Don't call bdrv_eject() if the tray state didn't change
  block: bdrv_eject(): Make eject_flag a real bool
  block: Rename bdrv_mon_event() & BlockMonEventAction

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:37:27 +0000 (09:37 -0600)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony: (46 commits)
  qemu-iotests: common.config: Allow use of arbitrary qemu* paths
  qemu-iotests: check: print relevant path information
  qemu-iotests: test loading internal snapshots
  qemu-iotests: Update filter for default cluster size
  qemu-iotests: add qed support to 025 image resize test
  qemu-iotests: Update rbd support
  qemu-iotests: common.config: Fix no $TEST_DIR directory
  qemu-iotests: only run 016 for file and sheepdog protocols
  qemu-iotests: Use zero-based offsets for IO patterns
  qemu-iotests: add support for rbd and sheepdog protocols
  qemu-iotests: filter IMGFMT correctly in 019
  qemu-iotests: README: Fix spelling
  qemu-iotests: add support for qed format
  qemu-iotests: filter TEST_DIR correctly in 019
  qemu-iotests: fix 019 golden output
  qemu-iotests: update expected results after qemu-img changes
  qemu-iotests: add read/write from smaller backing image test
  qemu-iotests: add sub-cluster allocating write test for sparse image formats
  qemu-iotests: improve test for qemu-img convert with backing file
  qemu-iotests: consider more cases in parsing qemu-io output
  ...

12 years agoMerge remote-tracking branch 'bonzini/virtio-scsi' into staging
Anthony Liguori [Fri, 24 Feb 2012 15:33:03 +0000 (09:33 -0600)]
Merge remote-tracking branch 'bonzini/virtio-scsi' into staging

* bonzini/virtio-scsi:
  scsi-block: always use scsi_generic_ops for cache != none
  scsi: fix searching for an empty id
  scsi: fix wrong return for target INQUIRY
  virtio-scsi: add migration support
  virtio-scsi: process control queue requests
  virtio-scsi: add basic SCSI bus operation
  virtio-scsi: Add basic request processing infrastructure
  virtio-scsi: Add virtio-scsi stub device
  scsi-disk: add migration support
  scsi-generic: add migration support
  scsi: add SCSIDevice vmstate definitions
  scsi-disk: enable scatter/gather functionality
  scsi: add scatter/gather functionality
  scsi: pass residual amount to command_complete
  ahci: use new DMA helpers
  dma-helpers: add accounting wrappers
  dma-helpers: add dma_buf_read and dma_buf_write
  dma-helpers: make QEMUSGList target independent

12 years agotarget-i386: Introduce x86_cpuid_set_model_id()
Andreas Färber [Fri, 17 Feb 2012 16:46:04 +0000 (17:46 +0100)]
target-i386: Introduce x86_cpuid_set_model_id()

Move the logic to transform the 48-char model ID into the 12-word model
value into a helper.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agotarget-i386: Introduce x86_cpuid_version_set_stepping()
Andreas Färber [Fri, 17 Feb 2012 16:46:03 +0000 (17:46 +0100)]
target-i386: Introduce x86_cpuid_version_set_stepping()

Move the logic for setting the stepping field into a helper function.

To make the function self-contained and to prepare for future
unordered/multiple uses, mask out any previous stepping values first.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agotarget-i386: Introduce x86_cpuid_version_set_model()
Andreas Färber [Fri, 17 Feb 2012 16:46:02 +0000 (17:46 +0100)]
target-i386: Introduce x86_cpuid_version_set_model()

Move the logic for setting the model and extended model fields
into a helper function.

To make the function self-contained and to prepare for future
unordered/multiple uses, mask out any previous model values first.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agotarget-i386: Introduce x86_cpuid_version_set_family()
Andreas Färber [Fri, 17 Feb 2012 16:46:01 +0000 (17:46 +0100)]
target-i386: Introduce x86_cpuid_version_set_family()

Move the logic for setting the family and extended family into a
helper function.

To make the helper self-contained and in preparation of future
unordered/multiple uses, mask out any previous family values first.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoconsole: Eliminate text_consoles[]
Markus Armbruster [Tue, 7 Feb 2012 14:09:21 +0000 (15:09 +0100)]
console: Eliminate text_consoles[]

Simply use consoles[] instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosockets: Clean up inet_listen_opts()'s convoluted bind() loop
Markus Armbruster [Tue, 7 Feb 2012 14:09:15 +0000 (15:09 +0100)]
sockets: Clean up inet_listen_opts()'s convoluted bind() loop

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>