]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/log
lisovros/qemu_apohw.git
11 years agoapohw: update for actual FPGA design. apohw-1.x
Pavel Pisa [Sat, 6 Apr 2013 14:33:31 +0000 (16:33 +0200)]
apohw: update for actual FPGA design.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
11 years agovirtio-9p-handle: define AT_EMPTY_PATH if needed
Serge Hallyn [Fri, 24 Feb 2012 09:51:43 +0000 (09:51 +0000)]
virtio-9p-handle: define AT_EMPTY_PATH if needed

If AT_EMPTY_PATH is not in one of the included files, go ahead and
define it.  qemu won't compile on ubuntu for me without this.

(Note - alternatively we could #include <linux/fcntl.h> to pick
up the definitions there)

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
11 years agoapohw: Fixed 'display clear' command.
Rostislav Lisovy [Thu, 10 May 2012 12:39:08 +0000 (14:39 +0200)]
apohw: Fixed 'display clear' command.

11 years agoMerge branch 'apohw' of ssh://rtime.felk.cvut.cz/lisovros/qemu_apohw into apohw
Pavel Pisa [Thu, 10 May 2012 08:32:36 +0000 (10:32 +0200)]
Merge branch 'apohw' of ssh://rtime.felk.cvut.cz/lisovros/qemu_apohw into apohw

11 years agoapohw: Adjust position of LED indicators in the output after switch to RAW mode.
Pavel Pisa [Thu, 10 May 2012 08:32:22 +0000 (10:32 +0200)]
apohw: Adjust position of LED indicators in the output after switch to RAW mode.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoapohw: Added real authors to document header.
Rostislav Lisovy [Thu, 3 May 2012 08:08:06 +0000 (10:08 +0200)]
apohw: Added real authors to document header.

12 years agoapohw: Print state after telnet connection and telnet raw input mode.
Pavel Pisa [Mon, 30 Apr 2012 23:00:43 +0000 (01:00 +0200)]
apohw: Print state after telnet connection and telnet raw input mode.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoapohw: do not print keyboard debug by default.
Pavel Pisa [Mon, 23 Apr 2012 00:43:09 +0000 (02:43 +0200)]
apohw: do not print keyboard debug by default.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoapohw: initial keyboard implementation.
Pavel Pisa [Mon, 23 Apr 2012 00:40:56 +0000 (02:40 +0200)]
apohw: initial keyboard implementation.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoapohw: Updates for MING32 (Windows) build compatibility.
Pavel Pisa [Tue, 17 Apr 2012 00:55:19 +0000 (02:55 +0200)]
apohw: Updates for MING32 (Windows) build compatibility.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoAPOHW: Fix addresses with current HW.
Pavel Pisa [Mon, 16 Apr 2012 07:35:06 +0000 (09:35 +0200)]
APOHW: Fix addresses with current HW.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoAPOHW: The HD44780 I/D flag proves complementary logic on real HW.
Pavel Pisa [Mon, 16 Apr 2012 07:32:56 +0000 (09:32 +0200)]
APOHW: The HD44780 I/D flag proves complementary logic on real HW.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoAPOHW: Correct display handling and check for DDRAM overflow.
Pavel Pisa [Mon, 16 Apr 2012 07:31:21 +0000 (09:31 +0200)]
APOHW: Correct display handling and check for DDRAM overflow.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoAPOHW: Correct oversimplified socket handling to not lose sent data.
Pavel Pisa [Mon, 16 Apr 2012 07:26:29 +0000 (09:26 +0200)]
APOHW: Correct oversimplified socket handling to not lose sent data.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoAPOHW: Add led_pio to the VMSTATE and remove duplicated item.
Pavel Pisa [Mon, 16 Apr 2012 07:14:36 +0000 (09:14 +0200)]
APOHW: Add led_pio to the VMSTATE and remove duplicated item.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
12 years agoapohw: A bit advanced virtual hd44780 driver. Needs fixes.
Rostislav Lisovy [Fri, 30 Mar 2012 19:44:01 +0000 (21:44 +0200)]
apohw: A bit advanced virtual hd44780 driver. Needs fixes.

12 years agoapohw: More advanced HD44780 virtual driver.
Rostislav Lisovy [Fri, 30 Mar 2012 15:20:36 +0000 (17:20 +0200)]
apohw: More advanced HD44780 virtual driver.

12 years agoapohw: Basic hd44780 functions supported - i.e. writing into its RAM.
Rostislav Lisovy [Fri, 30 Mar 2012 13:27:39 +0000 (15:27 +0200)]
apohw: Basic hd44780 functions supported - i.e. writing into its RAM.

12 years agoapohw: Basic functions of APOTERM implemented.
Rostislav Lisovy [Mon, 27 Feb 2012 14:50:43 +0000 (15:50 +0100)]
apohw: Basic functions of APOTERM implemented.

12 years agoapohw: Thread handling socket for client connection.
Rostislav Lisovy [Fri, 17 Feb 2012 16:22:36 +0000 (17:22 +0100)]
apohw: Thread handling socket for client connection.

12 years agoapohw: Fixed BAR0 allocation + corresponding read/write functions.
Rostislav Lisovy [Fri, 17 Feb 2012 15:38:27 +0000 (16:38 +0100)]
apohw: Fixed BAR0 allocation + corresponding read/write functions.

12 years agoapohw: Bar0 read() and write() functions implemented.
Rostislav Lisovy [Mon, 13 Feb 2012 15:10:17 +0000 (16:10 +0100)]
apohw: Bar0 read() and write() functions implemented.

12 years agoapohw: Added initialization.
Rostislav Lisovy [Fri, 3 Feb 2012 16:55:01 +0000 (17:55 +0100)]
apohw: Added initialization.

12 years agoapohw: Added VM state descriptions.
Rostislav Lisovy [Fri, 3 Feb 2012 16:33:26 +0000 (17:33 +0100)]
apohw: Added VM state descriptions.

12 years agoapohw: Basic skeleton.
Rostislav Lisovy [Fri, 3 Feb 2012 15:06:40 +0000 (16:06 +0100)]
apohw: Basic skeleton.

12 years agom48t59: use rtc_clock for alarm timer
Paolo Bonzini [Fri, 20 Jan 2012 12:05:00 +0000 (13:05 +0100)]
m48t59: use rtc_clock for alarm timer

This lets the RTC get adjustments from the host NTP client.
The watchdog still uses the vm_clock.  The previous behavior is
available with "-rtc clock=vm".

Cc: Andreas Färber <afaerber@suse.de>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoGRLIB UART: Add RX channel
Fabien Chouteau [Thu, 26 Jan 2012 17:03:15 +0000 (18:03 +0100)]
GRLIB UART: Add RX channel

This patch implements the RX channel of GRLIB UART with a FIFO to
improve data rate.

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix off-by-one in dirty bitmap functions
Avi Kivity [Sun, 29 Jan 2012 14:47:47 +0000 (16:47 +0200)]
Fix off-by-one in dirty bitmap functions

Reported-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Blue Swirl [Sat, 28 Jan 2012 13:11:20 +0000 (13:11 +0000)]
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
  Add Cortex-A15 CPU definition
  Add dummy implementation of generic timer cp15 registers
  arm: store the config_base_register during cpu_reset
  target-arm/helper.c: Don't assume softfloat int32 is 32 bits only
  target-arm: Fix implementation of TLB invalidate operations

12 years agounin_pci: Fix typos in device names
Andreas Färber [Fri, 27 Jan 2012 19:08:52 +0000 (20:08 +0100)]
unin_pci: Fix typos in device names

Commit 999e12bbe85c5dcf49bef13bce4f97399c7105f4 (sysbus: apic: ioapic:
convert to QEMU Object Model) introduced two typos, one of which broke
the mac99 machine.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: change ambiguous qdev names
Anthony Liguori [Wed, 25 Jan 2012 19:37:36 +0000 (13:37 -0600)]
qdev: change ambiguous qdev names

Reported-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovirtio-s390: convert to QEMU Object Model
Anthony Liguori [Thu, 22 Dec 2011 02:57:49 +0000 (20:57 -0600)]
virtio-s390: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agosysbus: apic: ioapic: convert to QEMU Object Model
Anthony Liguori [Tue, 24 Jan 2012 19:12:29 +0000 (13:12 -0600)]
sysbus: apic: ioapic: convert to QEMU Object Model

This converts three devices because apic and ioapic are subclasses of sysbus.
Converting subclasses independently of their base class is prohibitively hard.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agopci: convert to QEMU Object Model
Anthony Liguori [Sun, 4 Dec 2011 18:22:06 +0000 (12:22 -0600)]
pci: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agounin_pci: Drop unused reset handler
Andreas Färber [Thu, 19 Jan 2012 07:40:18 +0000 (07:40 +0000)]
unin_pci: Drop unused reset handler

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agounin_pci: Drop duplicate busdev
Andreas Färber [Thu, 19 Jan 2012 07:40:17 +0000 (07:40 +0000)]
unin_pci: Drop duplicate busdev

PCIHostState already has a busdev.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agounin_pci: Clean up qdev names
Andreas Färber [Thu, 19 Jan 2012 07:40:16 +0000 (07:40 +0000)]
unin_pci: Clean up qdev names

Add -pcihost to SysBus devices to resolve name conflicts,
and clarify PCI vs. Internal PCI.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agovirtio-serial: convert to QEMU Object Model
Anthony Liguori [Sun, 4 Dec 2011 18:38:12 +0000 (12:38 -0600)]
virtio-serial: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agospapr: convert to QEMU Object Model (v2)
Anthony Liguori [Thu, 15 Dec 2011 22:31:06 +0000 (16:31 -0600)]
spapr: convert to QEMU Object Model (v2)

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v1 -> v2
 - use QOM to check for the default console

12 years agoscsi: convert to QEMU Object Model
Anthony Liguori [Thu, 15 Dec 2011 20:50:08 +0000 (14:50 -0600)]
scsi: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoide: convert to QEMU Object Model
Anthony Liguori [Fri, 16 Dec 2011 19:41:12 +0000 (13:41 -0600)]
ide: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agohda-codec: convert to QEMU Object Model
Anthony Liguori [Fri, 16 Dec 2011 19:39:51 +0000 (13:39 -0600)]
hda-codec: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoi2c: smbus: convert to QEMU Object Model
Anthony Liguori [Mon, 5 Dec 2011 02:39:20 +0000 (20:39 -0600)]
i2c: smbus: convert to QEMU Object Model

This converts two types because smbus is implemented as a subclass of i2c.  It's
extremely difficult to convert these two independently.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoi2c: rename i2c_slave -> I2CSlave
Anthony Liguori [Mon, 5 Dec 2011 02:28:27 +0000 (20:28 -0600)]
i2c: rename i2c_slave -> I2CSlave

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agossi: convert to QEMU Object Model
Anthony Liguori [Fri, 16 Dec 2011 19:36:39 +0000 (13:36 -0600)]
ssi: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoccid: convert to QEMU Object Model
Anthony Liguori [Sun, 4 Dec 2011 18:34:10 +0000 (12:34 -0600)]
ccid: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agousb: convert to QEMU Object Model
Anthony Liguori [Thu, 15 Dec 2011 20:53:10 +0000 (14:53 -0600)]
usb: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoisa: pic: convert to QEMU Object Model
Anthony Liguori [Sun, 4 Dec 2011 17:52:49 +0000 (11:52 -0600)]
isa: pic: convert to QEMU Object Model

This converts two devices at once because PIC subclasses ISA and converting
subclasses independently is extremely hard.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: prepare source tree for code conversion
Anthony Liguori [Wed, 7 Dec 2011 01:32:44 +0000 (19:32 -0600)]
qdev: prepare source tree for code conversion

These are various small stylistic changes which help make things more
consistent such that the automated conversion script can be simpler.

It's not necessary to agree or disagree with these style changes because all
of this code is going to be rewritten by the patch monkey script anyway.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: add class_init to DeviceInfo
Anthony Liguori [Sun, 4 Dec 2011 20:37:06 +0000 (14:37 -0600)]
qdev: add class_init to DeviceInfo

Since we are still dynamically creating TypeInfo, we need to chain the
class_init function in order to be able to make use of it within subclasses of
TYPE_DEVICE.

This will disappear once we register TypeInfos directly.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: add a interface to register subclasses
Anthony Liguori [Thu, 15 Dec 2011 20:40:29 +0000 (14:40 -0600)]
qdev: add a interface to register subclasses

In order to introduce inheritance while still using the qdev registration
interfaces, we need to be able to use a parent other than TYPE_DEVICE.  Add a
new interface that allows this.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: use a wrapper to access reset and promote reset to a class method
Anthony Liguori [Sun, 4 Dec 2011 17:36:01 +0000 (11:36 -0600)]
qdev: use a wrapper to access reset and promote reset to a class method

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: don't access name through info
Anthony Liguori [Sun, 4 Dec 2011 17:17:51 +0000 (11:17 -0600)]
qdev: don't access name through info

We already have a QOM interface for this so let's use it.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: move qdev->info to class
Anthony Liguori [Sun, 4 Dec 2011 17:08:36 +0000 (11:08 -0600)]
qdev: move qdev->info to class

Right now, DeviceInfo acts as the class for qdev.  In order to switch to a
proper ObjectClass derivative, we need to ween all of the callers off of
interacting directly with the info pointer.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqdev: integrate with QEMU Object Model (v2)
Anthony Liguori [Fri, 16 Dec 2011 20:34:46 +0000 (14:34 -0600)]
qdev: integrate with QEMU Object Model (v2)

This is a very shallow integration.  We register a TYPE_DEVICE but only use
QOM as basically a memory allocator.  This will make all devices show up as
QOM objects but they will all carry the TYPE_DEVICE.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v1 -> v2
 - update for new location of object.h

12 years agoqom: add the base Object class (v2)
Anthony Liguori [Sat, 3 Dec 2011 23:10:08 +0000 (17:10 -0600)]
qom: add the base Object class (v2)

This class provides the main building block for QEMU Object Model and is
extensively documented in the header file.  It is largely inspired by GObject.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v1 -> v2
 - remove printf() in type registration
 - fix typo in comment (Paolo)
 - make Interface private
 - move object into a new directory and move header into include/qemu/
 - don't make object.h depend on qemu-common.h
 - remove Type and replace it with TypeImpl * (Paolo)
 - use hash table to store types (Paolo)
 - aggressively cache parent type (Paolo)
 - make a type_register and use it with interfaces (Paolo)
 - fix interface cast comment (Paolo)
 - add a few more functions required in later series

12 years agopci: call reset unconditionally
Anthony Liguori [Sun, 4 Dec 2011 17:40:58 +0000 (11:40 -0600)]
pci: call reset unconditionally

Because now all PCI devices are converted to qdev.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoopenpic: remove dead code to make a PCI device version
Anthony Liguori [Wed, 21 Dec 2011 22:18:02 +0000 (16:18 -0600)]
openpic: remove dead code to make a PCI device version

bus is always NULL so the code in this if clause is dead (and therefore
untested).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agomacio: convert to qdev
Anthony Liguori [Wed, 21 Dec 2011 22:14:09 +0000 (16:14 -0600)]
macio: convert to qdev

This is a "shallow", half hearted, and untested conversion.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
Anthony Liguori [Fri, 27 Jan 2012 15:00:03 +0000 (09:00 -0600)]
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging

* pmaydell/arm-devs.for-upstream:
  arm: SoC model for Calxeda Highbank
  arm_boot: support board IDs more than 16 bits wide
  arm: add secondary cpu boot callbacks to arm_boot.c
  ahci: add support for non-PCI based controllers
  Add xgmac ethernet model

12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Fri, 27 Jan 2012 14:58:52 +0000 (08:58 -0600)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony: (22 commits)
  scsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_command
  qcow: Use bdrv functions to replace file operation
  qcow: Return real error code in qcow_open
  block/vdi: Zero unused parts when allocating a new block (fix #919242)
  virtio-blk: add virtio_blk_handle_read trace event
  docs: describe live block operations
  block: add support for partial streaming
  add QERR_BASE_NOT_FOUND
  block: add bdrv_find_backing_image
  blockdev: make image streaming safe across hotplug
  qmp: add query-block-jobs
  qmp: add block_job_cancel command
  qmp: add block_job_set_speed command
  qmp: add block_stream command
  block: rate-limit streaming operations
  block: add image streaming block job
  block: add BlockJob interface for long-running operations
  block: make copy-on-read a per-request flag
  block: check bdrv_in_use() before blockdev operations
  coroutine: add co_sleep_ns() coroutine sleep function
  ...

12 years agoqemu-io: end aio help text sentences with periods
Laszlo Ersek [Tue, 24 Jan 2012 20:13:28 +0000 (21:13 +0100)]
qemu-io: end aio help text sentences with periods

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years ago./configure: export xfs config via --{enable, disable}-xfsctl
Sergei Trofimovich [Tue, 24 Jan 2012 17:42:40 +0000 (20:42 +0300)]
./configure: export xfs config via --{enable, disable}-xfsctl

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agopcnet: Preserve link state across device reset
Jan Kiszka [Tue, 24 Jan 2012 12:47:56 +0000 (13:47 +0100)]
pcnet: Preserve link state across device reset

A device reset does not affect the link state, only set_link does.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoe1000: Preserve link state across device reset
Jan Kiszka [Tue, 24 Jan 2012 12:47:46 +0000 (13:47 +0100)]
e1000: Preserve link state across device reset

A device reset does not affect the link state, only set_link does.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqdev-property: Make bit property parsing stricter
Jan Kiszka [Sat, 21 Jan 2012 13:43:07 +0000 (14:43 +0100)]
qdev-property: Make bit property parsing stricter

By using strncasecmp, we allow for arbitrary characters after the
"on"/"off" string. Fix this by switching to strcasecmp.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoremove #if 0 code for timers
Paolo Bonzini [Fri, 20 Jan 2012 11:05:22 +0000 (12:05 +0100)]
remove #if 0 code for timers

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoscsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_command
Thomas Higdon [Tue, 24 Jan 2012 17:19:44 +0000 (12:19 -0500)]
scsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_command

Limit the return value (corresponding to the length of the buffer to be
DMAed back to the intiator) to the value in req->cmd.xfer, which is the
amount of data that the initiator expects. Eliminate now-duplicate code
that does this guarding in the functions for individual commands.

Without this, the SCRIPTS code in the emulated LSI device eventually
raises a DMA interrupt for a data overrun when an INQUIRY command whose
buflen exceeds req->cmd.xfer is processed. It's the responsibility of
the client to provide a request buffer and allocation length that are
large enough for the result of the command.

Signed-off-by: Thomas Higdon <thigdon@akamai.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow: Use bdrv functions to replace file operation
Li Zhi Hui [Mon, 21 Nov 2011 07:40:39 +0000 (15:40 +0800)]
qcow: Use bdrv functions to replace file operation

Since common file operation functions lack of error detection and use
much more I/O syscalls, so change them to bdrv series functions and
reduce I/O request.

Signed-off-by: Li Zhi Hui <zhihuili@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow: Return real error code in qcow_open
Li Zhi Hui [Thu, 15 Dec 2011 10:14:00 +0000 (18:14 +0800)]
qcow: Return real error code in qcow_open

Signed-off-by: Li Zhi Hui <zhihuili@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock/vdi: Zero unused parts when allocating a new block (fix #919242)
Stefan Weil [Sat, 21 Jan 2012 12:54:24 +0000 (13:54 +0100)]
block/vdi: Zero unused parts when allocating a new block (fix #919242)

The new block was filled with zero when it was allocated by g_malloc0,
but when it was reused later and only partially used, data from the
previously allocated block were still present and written to the new
block.

This caused the problems reported by bug #919242
(https://bugs.launchpad.net/qemu/+bug/919242).

Now the unused parts of the new block which are before and after the data
are always filled with zero, so it is no longer necessary to zero the whole
block with g_malloc0.

I also updated the copyright comment.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovirtio-blk: add virtio_blk_handle_read trace event
Stefan Hajnoczi [Thu, 22 Dec 2011 13:17:02 +0000 (13:17 +0000)]
virtio-blk: add virtio_blk_handle_read trace event

There already exists a virtio_blk_handle_write trace event as well as
completion events.  Add the virtio_blk_handle_read event so it's easy to
trace virtio-blk requests for both read and write operations.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agodocs: describe live block operations
Marcelo Tosatti [Wed, 18 Jan 2012 14:40:54 +0000 (14:40 +0000)]
docs: describe live block operations

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: add support for partial streaming
Marcelo Tosatti [Wed, 18 Jan 2012 14:40:53 +0000 (14:40 +0000)]
block: add support for partial streaming

Add support for streaming data from an intermediate section of the
image chain (see patch and documentation for details).

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoadd QERR_BASE_NOT_FOUND
Marcelo Tosatti [Wed, 18 Jan 2012 14:40:52 +0000 (14:40 +0000)]
add QERR_BASE_NOT_FOUND

This qerror will be raised when a given streaming base (backing file)
cannot be found.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: add bdrv_find_backing_image
Marcelo Tosatti [Wed, 18 Jan 2012 14:40:51 +0000 (14:40 +0000)]
block: add bdrv_find_backing_image

Add bdrv_find_backing_image: given a BlockDriverState pointer, and an id,
traverse the backing image chain to locate the id.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblockdev: make image streaming safe across hotplug
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:50 +0000 (14:40 +0000)]
blockdev: make image streaming safe across hotplug

Unplugging a storage interface like virtio-blk causes the host block
device to be deleted too.  Long-running operations like block migration
must take a DriveInfo reference to prevent the BlockDriverState from
being freed.  For image streaming we can do the same thing.

Note that it is not possible to acquire/release the drive reference in
block.c where the block job functions live because
drive_get_ref()/drive_put_ref() are blockdev.c functions.  Calling them
from block.c would be a layering violation - tools like qemu-img don't
even link against blockdev.c.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqmp: add query-block-jobs
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:49 +0000 (14:40 +0000)]
qmp: add query-block-jobs

Add query-block-jobs, which shows the progress of ongoing block device
operations.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqmp: add block_job_cancel command
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:48 +0000 (14:40 +0000)]
qmp: add block_job_cancel command

Add block_job_cancel, which stops an active block streaming operation.
When the operation has been cancelled the new BLOCK_JOB_CANCELLED event
is emitted.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqmp: add block_job_set_speed command
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:47 +0000 (14:40 +0000)]
qmp: add block_job_set_speed command

Add block_job_set_speed, which sets the maximum speed for a background
block operation.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqmp: add block_stream command
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:46 +0000 (14:40 +0000)]
qmp: add block_stream command

Add the block_stream command, which starts copy backing file contents
into the image file.  Also add the BLOCK_JOB_COMPLETED QMP event which
is emitted when image streaming completes.  Later patches add control
over the background copy speed, cancelation, and querying running
streaming operations.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoarm: SoC model for Calxeda Highbank
Rob Herring [Thu, 26 Jan 2012 11:43:49 +0000 (11:43 +0000)]
arm: SoC model for Calxeda Highbank

Adds support for Calxeda's Highbank SoC.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoarm_boot: support board IDs more than 16 bits wide
Peter Maydell [Thu, 26 Jan 2012 11:43:48 +0000 (11:43 +0000)]
arm_boot: support board IDs more than 16 bits wide

Support passing a board ID value to the kernel in r1
that is more than 16 bits wide. This is needed to pass
the '-1 == invalid' value for boards which only support
device tree booting.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
12 years agoarm: add secondary cpu boot callbacks to arm_boot.c
Mark Langsdorf [Thu, 26 Jan 2012 11:43:48 +0000 (11:43 +0000)]
arm: add secondary cpu boot callbacks to arm_boot.c

Create two functions, write_secondary_boot() and secondary_cpu_reset_hook(),
to allow platforms more control of how secondary CPUs are brought up. The
new functions default to NULL and aren't called unless they are populated
so there are no changes to existing platform models.

Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoahci: add support for non-PCI based controllers
Rob Herring [Thu, 26 Jan 2012 11:43:47 +0000 (11:43 +0000)]
ahci: add support for non-PCI based controllers

Add support for ahci on sysbus.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoAdd xgmac ethernet model
Rob Herring [Thu, 26 Jan 2012 11:43:47 +0000 (11:43 +0000)]
Add xgmac ethernet model

This adds very basic support for the xgmac ethernet core. Missing things
include:

- statistics counters
- WoL support
- rx checksum offload
- chained descriptors (only linear descriptor ring)
- broadcast and multicast handling

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoblock: rate-limit streaming operations
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:45 +0000 (14:40 +0000)]
block: rate-limit streaming operations

This patch implements rate-limiting for image streaming.  If we've
exceeded the bandwidth quota for a 100 ms time slice we sleep the
coroutine until the next slice begins.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: add image streaming block job
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:44 +0000 (14:40 +0000)]
block: add image streaming block job

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: add BlockJob interface for long-running operations
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:43 +0000 (14:40 +0000)]
block: add BlockJob interface for long-running operations

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: make copy-on-read a per-request flag
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:42 +0000 (14:40 +0000)]
block: make copy-on-read a per-request flag

Previously copy-on-read could only be enabled for all requests to a
block device.  This means requests coming from the guest as well as
QEMU's internal requests would perform copy-on-read when enabled.

For image streaming we want to support finer-grained behavior than just
populating the image file from its backing image.  Image streaming
supports partial streaming where a common backing image is preserved.
In this case guest requests should not perform copy-on-read because they
would indiscriminately copy data which should be left in a backing image
from the backing chain.

Introduce a per-request flag for copy-on-read so that a block device can
process both regular and copy-on-read requests.  Overlapping reads and
writes still need to be serialized for correctness when copy-on-read is
happening, so add an in-flight reference count to track this.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: check bdrv_in_use() before blockdev operations
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:41 +0000 (14:40 +0000)]
block: check bdrv_in_use() before blockdev operations

Long-running block operations like block migration and image streaming
must have continual access to their block device.  It is not safe to
perform operations like hotplug, eject, change, resize, commit, or
external snapshot while a long-running operation is in progress.

This patch adds the missing bdrv_in_use() checks so that block migration
and image streaming never have the rug pulled out from underneath them.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agocoroutine: add co_sleep_ns() coroutine sleep function
Stefan Hajnoczi [Wed, 18 Jan 2012 14:40:40 +0000 (14:40 +0000)]
coroutine: add co_sleep_ns() coroutine sleep function

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock: replace unchecked strdup/malloc/calloc with glib
Stefan Hajnoczi [Mon, 16 Jan 2012 09:28:06 +0000 (09:28 +0000)]
block: replace unchecked strdup/malloc/calloc with glib

Most of the codebase as been converted to use glib memory allocation
functions.  There are still a few instances of malloc/calloc in the
block layer and qemu-io.  Replace them, especially since they do not
check the strdup/malloc/calloc return value.

Reported-by: Dr David Alan Gilbert <davidagilbert@uk.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agorbd: wire up snapshot removal and rollback functionality
Gregory Farnum [Wed, 11 Jan 2012 19:53:52 +0000 (11:53 -0800)]
rbd: wire up snapshot removal and rollback functionality

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agovga: compile cirrus_vga in hwlib
Blue Swirl [Sun, 9 Oct 2011 09:58:00 +0000 (09:58 +0000)]
vga: compile cirrus_vga in hwlib

Remove target dependencies and compile Cirrus VGA in hwlib.

Address masking can be removed since memory API handles that now.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomemory: change dirty setting APIs to take a size
Blue Swirl [Sun, 16 Oct 2011 16:04:59 +0000 (16:04 +0000)]
memory: change dirty setting APIs to take a size

Instead of each target knowing or guessing the guest page size,
just pass the desired size of dirtied memory area.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomemory: fix dirty mask function length handling
Blue Swirl [Sun, 22 Jan 2012 11:00:44 +0000 (11:00 +0000)]
memory: fix dirty mask function length handling

Fix handling of cases like start = 0xfff, length = 2.

Change length to ram_addr_t to handle larger lengths.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agovga: fix -nodefaults -device VGA
Blue Swirl [Tue, 24 Jan 2012 17:27:35 +0000 (17:27 +0000)]
vga: fix -nodefaults -device VGA

Flag -nodefaults should also imply no VGA. This was broken in
a369da5f31ddbdeb32a7f76622e480d3995fbb00.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoAdd Cortex-A15 CPU definition
Peter Maydell [Wed, 25 Jan 2012 12:42:29 +0000 (12:42 +0000)]
Add Cortex-A15 CPU definition

Add a definition of a Cortex-A15 CPU. Note that for the moment we do
not implement any of:
 * Large Physical Address Extensions (LPAE)
 * Virtualization Extensions
 * Generic Timer
 * TrustZone (this is also true of our existing Cortex-A9 model, etc)

This CPU model is sufficient to boot a Linux kernel which has been
compiled for an A15 without LPAE enabled.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoAdd dummy implementation of generic timer cp15 registers
Peter Maydell [Wed, 25 Jan 2012 12:42:29 +0000 (12:42 +0000)]
Add dummy implementation of generic timer cp15 registers

Add a dummy implementation of the cp15 registers for the generic
timer (found in the Cortex-A15), just sufficient for Linux to
decide that it can't use it. This requires at least CNTP_CTL and
CNTFRQ to be implemented as RAZ/WI; we RAZ/WI all of c14.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>