sdk/emulator/qemu.git
12 years agovirtio-scsi: Report missed events
Paolo Bonzini [Mon, 2 Jul 2012 08:47:35 +0000 (10:47 +0200)]
virtio-scsi: Report missed events

When an event is reported but no buffers are present in the event vq,
we can set a flag and report a dummy event as soon as one is added.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agovirtio-scsi: Implement hotplug support for virtio-scsi
Cong Meng [Wed, 20 Jun 2012 06:47:11 +0000 (14:47 +0800)]
virtio-scsi: Implement hotplug support for virtio-scsi

Implement the hotplug() and hot_unplug() interfaces in virtio-scsi, by signal
the virtio_scsi.ko in guest kernel via event virtual queue.

The counterpart patch of virtio_scsi.ko will be sent soon in another thread.

Signed-off-by: Sen Wang <senwang@linux.vnet.ibm.com>
Signed-off-by: Cong Meng <mc@linux.vnet.ibm.com>
[ Add memset, fix LUN field, placate checkpatch - Paolo ]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: report parameter changes to HBA drivers
Paolo Bonzini [Mon, 16 Jul 2012 12:22:36 +0000 (14:22 +0200)]
scsi: report parameter changes to HBA drivers

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: report resized disk via sense codes
Paolo Bonzini [Mon, 16 Jul 2012 12:07:55 +0000 (14:07 +0200)]
scsi-disk: report resized disk via sense codes

Linux will not use these, but a very similar mechanism will be used to
report the condition via virtio-scsi events.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: establish precedence levels for unit attention
Paolo Bonzini [Mon, 16 Jul 2012 12:18:58 +0000 (14:18 +0200)]
scsi: establish precedence levels for unit attention

When a device is resized, we will report a unit attention condition
for CAPACITY DATA HAS CHANGED.  However, we should ensure that this
condition does not override a more important unit attention condition.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: introduce hotplug() and hot_unplug() interfaces for SCSI bus
Cong Meng [Wed, 20 Jun 2012 06:47:10 +0000 (14:47 +0800)]
scsi: introduce hotplug() and hot_unplug() interfaces for SCSI bus

Add two interfaces hotplug() and hot_unplug() to scsi bus info.
The scsi bus can implement these two interfaces to signal the HBA driver
of guest kernel to add/remove the scsi device in question.

Signed-off-by: Sen Wang <senwang@linux.vnet.ibm.com>
Signed-off-by: Cong Meng <mc@linux.vnet.ibm.com>
[ Fixed braces and indentation - Paolo ]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi: add tracepoint for scsi_req_cancel
Paolo Bonzini [Fri, 27 Jul 2012 06:23:07 +0000 (08:23 +0200)]
scsi: add tracepoint for scsi_req_cancel

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: removable hard disks support load/eject
Paolo Bonzini [Mon, 16 Jul 2012 13:59:57 +0000 (15:59 +0200)]
scsi-disk: removable hard disks support load/eject

Support for the LOEJ bit of the START/STOP UNIT command right now is
limited to CD-ROMs.  This is wrong, since removable hard disks (in the
real world: SD card readers) also support it in pretty much the same way.

Without the LOEJ bit, START/STOP UNIT does nothing for all devices.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: Fail medium writes with proper sense for readonly LUNs
Ronnie Sahlberg [Mon, 16 Jul 2012 06:53:28 +0000 (08:53 +0200)]
scsi-disk: Fail medium writes with proper sense for readonly LUNs

Add sense code for DATA_PROTECT/WRITE_PROTECTED and return this error
for any WRITE*/WRITE_VERIFY* calls if the device is readonly=on,
i.e. write-protected

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: improve the lba-out-of-range tests for read/write/verify
Ronnie Sahlberg [Thu, 12 Jul 2012 06:52:47 +0000 (16:52 +1000)]
scsi-disk: improve the lba-out-of-range tests for read/write/verify

Improve the tests for the LBA to cover more cases.

For the 16 byte opcodes, the lba is a uint64, so we need to check is to
make sure that we do not wrap.  For example if an opcode would specify
the LBA:0xffffffffffffffff and LEN:2 then lba+len would wrap to 1.

Also verify that ALL requested blocks are available, not just the first one.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: rd/wr/vr-protect !=0 is an error
Ronnie Sahlberg [Thu, 12 Jul 2012 00:19:38 +0000 (10:19 +1000)]
scsi-disk: rd/wr/vr-protect !=0 is an error

The QEMU SCSI emulation does not support protection information,
so any READ/WRITE/VERIFY commands that has the protect bits set to
non-zero should fail with ILLEGAL_REQUEST/INVALID_FIELD_IN_CDB

From SCSI SBC :
If the logical unit does not support protection information,
then the device server should terminate the command with CHECK CONDITION
status with the sense key set to ILLEGAL REQUEST and the additional sense
code set to INVALID FIELD IN CDB.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
[ Rebase after scsi_dma_reqops introduction - Paolo ]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: support toggling the write cache
Paolo Bonzini [Tue, 10 Jul 2012 13:03:17 +0000 (15:03 +0200)]
scsi-disk: support toggling the write cache

Finally, this uses the "plumbing" in the previous patch to
add support for toggling the WCE bit of the caching mode page.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: parse MODE SELECT commands and parameters
Paolo Bonzini [Tue, 10 Jul 2012 13:02:55 +0000 (15:02 +0200)]
scsi-disk: parse MODE SELECT commands and parameters

This adds the bulk of the parsing code for MODE SELECT, including
breaking out changes to different mode pages, and checking that only
changeable values are modified.

In order to report errors correctly two passes are made through the
parameters; the first only looks for errors, the second actually
applies the changes to the mode page.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: fix changeable values for MODE_PAGE_R_W_ERROR
Paolo Bonzini [Tue, 10 Jul 2012 12:04:51 +0000 (14:04 +0200)]
scsi-disk: fix changeable values for MODE_PAGE_R_W_ERROR

The changeable values were not all-zeros for this mode page, fix it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: adjust offsets in MODE SENSE by 2
Paolo Bonzini [Thu, 12 Jul 2012 14:08:24 +0000 (16:08 +0200)]
scsi-disk: adjust offsets in MODE SENSE by 2

This will make offsets the same when implementing MODE SELECT.  This is
because MODE SELECT has to deal with both 2-byte and 4-byte headers.
Unfortunately, this means that the offsets are now off by two compared
to the descriptions in the SCSI specs, which include the header.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: support emulated TO_DEV requests
Paolo Bonzini [Wed, 8 Feb 2012 09:32:55 +0000 (10:32 +0100)]
scsi-disk: support emulated TO_DEV requests

This adds the implementation of write_data for the emulated
command case.  The first time through it asks for more data,
the second time it finishes the processing of the command.

MODE SELECT and MODE SELECT(10) can now be re-enabled, but they
will not do much.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: separate read_data/write_data implementation for emulate_reqops
Paolo Bonzini [Wed, 8 Feb 2012 09:26:21 +0000 (10:26 +0100)]
scsi-disk: separate read_data/write_data implementation for emulate_reqops

The previous patch only separated the send_command callback.
Use different implementations also for read_data and write_data.
The latter is still unreachable, so it aborts for now.

read_data passes the data buffer that was prepared and completes
the command.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: split scsi-disk reqops
Paolo Bonzini [Wed, 8 Feb 2012 08:53:42 +0000 (09:53 +0100)]
scsi-disk: split scsi-disk reqops

Only checks for present medium were still done in scsi_send_command
for emulated commands.  So move those to scsi_disk_emulate_command
and return different SCSIReqOps depending on the kind of command.

Checks for present medium can be done unconditionally for the
scsi_disk_dma_reqops case.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: move all non-DMA commands to scsi_disk_emulate_command
Paolo Bonzini [Wed, 8 Feb 2012 08:43:52 +0000 (09:43 +0100)]
scsi-disk: move all non-DMA commands to scsi_disk_emulate_command

We want to use separate SCSIReqOps for emulated commands needing an
allocated buffer vs. those that are zerocopy when the HBA supports
S/G lists.  Ensure that all of the former are in scsi_disk_emulate_command.

Commands that do not have any parameters are more similar to emulated
commands, so also move them, even if they do I/O.

Finally, MODE SELECT and MODE SELECT(10) are broken because we do not
yet support passing parameter data _to_ emulated commands, so disable
them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: make discard asynchronous
Paolo Bonzini [Wed, 8 Feb 2012 09:37:48 +0000 (10:37 +0100)]
scsi-disk: make discard asynchronous

By making discard asynchronous, we can reuse all the error handling
code that is used for other commands.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-disk: let the user customize vendor and product name
Dmitry Fleytman [Sat, 7 Jul 2012 05:03:35 +0000 (22:03 -0700)]
scsi-disk: let the user customize vendor and product name

This patch adds two new properties vendor and product to SCSI disks.
These options let the user customize the inquiry data returned by the
disk.

Signed-off-by: Yan Vugenfirer <yan@ravellosystems.com>
Signed-off-by: Dmitry Fleytman <dmitry.fleytman@ravellosystems.com>
[ Use vendor and product property names, avoid "if" statements. - PB ]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agocutils: add strpadcpy()
Dmitry Fleytman [Mon, 9 Jul 2012 06:50:43 +0000 (08:50 +0200)]
cutils: add strpadcpy()

Signed-off-by: Yan Vugenfirer <yan@ravellosystems.com>
Signed-off-by: Dmitry Fleytman <dmitry.fleytman@ravellosystems.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoscsi-block: remove properties that are not relevant for passthrough
Paolo Bonzini [Mon, 9 Jul 2012 10:11:04 +0000 (12:11 +0200)]
scsi-block: remove properties that are not relevant for passthrough

scsi-block is a passthrough device and does not allow customization
of vendor, product, removable, DPOFUA, block size or any other piece of
information.  Thus, drop DEFINE_SCSI_DISK_PROPERTIES() from the
list of qdev properties.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agolsi: avoid redundant tests of s->current != NULL
Paolo Bonzini [Mon, 2 Jul 2012 15:07:40 +0000 (17:07 +0200)]
lsi: avoid redundant tests of s->current != NULL

Simplify the code by checking against req->hba_private directly,
and asserting that it is non-NULL before a command is completed
or canceled.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agolsi: introduce lsi_request_free
Paolo Bonzini [Mon, 2 Jul 2012 15:04:40 +0000 (17:04 +0200)]
lsi: introduce lsi_request_free

Split the common bits of lsi_request_cancelled and lsi_command_complete
out to a new function.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agolsi: use qdev_reset_all
Paolo Bonzini [Mon, 2 Jul 2012 15:03:55 +0000 (17:03 +0200)]
lsi: use qdev_reset_all

By first resetting the devices, lsi_soft_reset will find the queue
already cleared so there is no need to do that forcibly (which may also
leak SCSIRequests, and/or worse due to dangling references to the
lsi_request in the hba_private field).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agomegasas: fix misuse of scsi_req_abort
Paolo Bonzini [Thu, 12 Jul 2012 13:02:29 +0000 (15:02 +0200)]
megasas: fix misuse of scsi_req_abort

scsi_req_abort is for terminating a command with a non-zero status.
The ABORT task management function is invoked by scsi_req_cancel.
In fact, ABORTED_COMMAND is a sense key, not a SAM status code.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agomegasas: Replace trace_megasas_dcmd_dump_frame()
Hannes Reinecke [Wed, 11 Jul 2012 11:35:16 +0000 (13:35 +0200)]
megasas: Replace trace_megasas_dcmd_dump_frame()

trace_megasas_dcmd_dump_frame() takes 9 arguments, which is
rather much. Plus the trace infrastructure doesn't support
it.  As we can get the information via other means it's pointless
to have it in the driver, so rather use some proper trace
point here and remove the old one.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoMerge remote-tracking branch 'stefanha/net' into staging
Anthony Liguori [Mon, 23 Jul 2012 18:15:34 +0000 (13:15 -0500)]
Merge remote-tracking branch 'stefanha/net' into staging

* stefanha/net:
  remove unused QemuOpts parameter from net init functions
  convert net_init_bridge() to NetClientOptions
  convert net_init_tap() to NetClientOptions
  convert net_init_vde() to NetClientOptions
  convert net_init_socket() to NetClientOptions
  convert net_init_slirp() to NetClientOptions
  convert net_init_dump() to NetClientOptions
  convert net_init_nic() to NetClientOptions
  convert net_client_init() to OptsVisitor
  hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)
  qapi schema: add Netdev types
  qapi schema: remove trailing whitespace
  qapi: introduce OptsVisitor
  expose QemuOpt and QemuOpts struct definitions to interested parties
  qapi: introduce "size" type
  qapi: generate C types for fixed-width integers
  qapi: add test case for deallocating traversal of incomplete structure
  qapi: fix error propagation
  MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Mon, 23 Jul 2012 18:15:34 +0000 (13:15 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  Fix some more Qemus in documentation and help text
  qdev: Fix Open Firmware comment
  cpus.c: Make all_cpu_threads_idle() static
  Use macro QEMU_PACKED for new packed structures
  Recognize PCID feature
  powerpc pci: fixed packing of ranges[]

12 years agoMerge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
Anthony Liguori [Mon, 23 Jul 2012 18:15:34 +0000 (13:15 -0500)]
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging

* pmaydell/arm-devs.for-upstream:
  exynos4210: add Exynos4210 i2c implementation
  hw/exynos4210_rtc.c: remove unnecessary code
  hw/exynos4210_rtc.c: Fix calculating for value of year
  hw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard
  hw/arm_boot.c: Support DTBs which use 64 bit addresses
  device_tree: Add support for reading device tree properties
  hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity
  hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct
  hw/arm_boot.c: Make ram_size a uint64_t
  hw/pl011.c: Avoid crash on read when no chr backend present

12 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Mon, 23 Jul 2012 18:15:34 +0000 (13:15 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

* stefanha/tracing:
  Update simpletrace.py for new log format
  Simpletrace v2: Support multiple arguments, strings.
  monitor: remove unused do_info_trace
  trace: added ability to comment out events in the list

12 years agoremove unused QemuOpts parameter from net init functions
Laszlo Ersek [Tue, 17 Jul 2012 14:17:21 +0000 (16:17 +0200)]
remove unused QemuOpts parameter from net init functions

v1->v2:
- unchanged

v2->v3:
- keep "qemu-option.h" included in "net/slirp.h"

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconvert net_init_bridge() to NetClientOptions
Laszlo Ersek [Tue, 17 Jul 2012 14:17:20 +0000 (16:17 +0200)]
convert net_init_bridge() to NetClientOptions

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconvert net_init_tap() to NetClientOptions
Laszlo Ersek [Tue, 17 Jul 2012 14:17:19 +0000 (16:17 +0200)]
convert net_init_tap() to NetClientOptions

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconvert net_init_vde() to NetClientOptions
Laszlo Ersek [Tue, 17 Jul 2012 14:17:18 +0000 (16:17 +0200)]
convert net_init_vde() to NetClientOptions

v1->v2:
- NetdevVdeOptions::port and ::mode are of type uint16. Remove superfluous
  range checks.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconvert net_init_socket() to NetClientOptions
Laszlo Ersek [Tue, 17 Jul 2012 14:17:17 +0000 (16:17 +0200)]
convert net_init_socket() to NetClientOptions

I "reverse engineered" the following permissions between the -socket
sub-options:

             fd  listen  connect  mcast  udp | localaddr
  fd         x   .       .        .      .   | .
  listen     .   x       .        .      .   | .
  connect    .   .       x        .      .   | .
  mcast      .   .       .        x      .   | x
  udp        .   .       .        .      x   | x
  -------------------------------------------+
  localaddr  .   .       .        x      x     x

I transformed the code accordingly. The real fix would be to embed "fd",
"listen", "connect", "mcast" and "udp" in a separate union. However
OptsVisitor's enum parser only supports the type=XXX QemuOpt instance as
union discriminator.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconvert net_init_slirp() to NetClientOptions
Laszlo Ersek [Tue, 17 Jul 2012 14:17:16 +0000 (16:17 +0200)]
convert net_init_slirp() to NetClientOptions

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconvert net_init_dump() to NetClientOptions
Laszlo Ersek [Tue, 17 Jul 2012 14:17:15 +0000 (16:17 +0200)]
convert net_init_dump() to NetClientOptions

v1->v2:
- NetdevDumpOptions::len is of type 'size', whose C type was changed to
  uint64_t. Adapt the printf() format specifier macro.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconvert net_init_nic() to NetClientOptions
Laszlo Ersek [Tue, 17 Jul 2012 14:17:14 +0000 (16:17 +0200)]
convert net_init_nic() to NetClientOptions

v1->v2:
- NetLegacyNicOptions::vectors is of type uint32

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconvert net_client_init() to OptsVisitor
Laszlo Ersek [Tue, 17 Jul 2012 14:17:13 +0000 (16:17 +0200)]
convert net_client_init() to OptsVisitor

The net_client_init() prototype is kept intact.

Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as a
Netdev or a NetLegacy. The original meat of net_client_init() is moved to
and simplified in net_client_init1():

Fields not common between -net and -netdev are clearly separated. Getting
the name for the init functions is cleaner: Netdev::id is mandatory, and
all init functions handle a NULL NetLegacy::name. NetLegacy::vlan
explicitly depends on -net (see below).

Verifying the "type=" option for -netdev can be turned into a switch.

Format validation with qemu_opts_validate() can be removed because the
visitor covers it. Relatedly, the "net_client_types" array is reduced to
an array of init functions that can be directly indexed by opts->kind.
(Help text is available in the schema JSON.)

The outermost negation in the condition around qemu_find_vlan() was
flattened, because it expresses the dependent code's requirements more
clearly.

VLAN lookup is avoided if there's no init function to pass the VLAN to.

Whenever the value of type=... is needed, we substitute
NetClientOptionsKind_lookup[kind].

The individual init functions are not converted yet, thus the original
QemuOpts instance is passed transparently.

v1->v2:
- NetLegacy::name is optional. Tracked it through all init functions: they
  all handle a NULL name. Updated commit message accordingly.

v2->v3:
- NetLegacy::id is allowed and takes precedence over NetLegacy::name.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agohw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)
Laszlo Ersek [Tue, 17 Jul 2012 14:17:12 +0000 (16:17 +0200)]
hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)

NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqapi schema: add Netdev types
Laszlo Ersek [Tue, 17 Jul 2012 14:17:11 +0000 (16:17 +0200)]
qapi schema: add Netdev types

NetdevTapOptions::sndbuf and NetdevDumpOptions::len use the new "size"
type.

v1->v2:
- NetLegacy::name is optional
- NetLegacyNicOptions::vectors is of type uint32
- NetdevVdeOptions::port and ::mode are of type uint16
- NetLegacy::vlan has type int32

v2->v3:
- NetLegacy::id is allowed and takes precedence over NetLegacy::name
- replace "@traits" with "@opts" in NetLegacy & Netdev descriptions

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqapi schema: remove trailing whitespace
Laszlo Ersek [Tue, 17 Jul 2012 14:17:10 +0000 (16:17 +0200)]
qapi schema: remove trailing whitespace

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqapi: introduce OptsVisitor
Laszlo Ersek [Tue, 17 Jul 2012 14:17:09 +0000 (16:17 +0200)]
qapi: introduce OptsVisitor

This visitor supports parsing

  -option [type=]discriminator[,optarg1=val1][,optarg2=val2][,...]

style QemuOpts objects into "native" C structures. After defining the type
tree in the qapi schema (see below), a root type traversal with this
visitor linked to the underlying QemuOpts object will build the "native" C
representation of the option.

The type tree in the schema, corresponding to an option with a
discriminator, must have the following structure:

  struct
    scalar member for non-discriminated optarg 1 [*]
    list for repeating non-discriminated optarg 2 [*]
      wrapper struct
        single scalar member
    union
      struct for discriminator case 1
        scalar member for optarg 3 [*]
        list for repeating optarg 4 [*]
          wrapper struct
            single scalar member
        scalar member for optarg 5 [*]
      struct for discriminator case 2
        ...

The "type" optarg name is fixed for the discriminator role. Its schema
representation is "union of structures", and each discriminator value must
correspond to a member name in the union.

If the option takes no "type" descriminator, then the type subtree rooted
at the union must be absent from the schema (including the union itself).

Optarg values can be of scalar types str / bool / integers / size.

Members marked with [*] may be defined as optional in the schema,
describing an optional optarg.

Repeating an optarg is supported; its schema representation must be "list
of structure with single mandatory scalar member". If an optarg is not
described as repeating in the schema (ie. it is defined as a scalar field
instead of a list), its last occurrence will take effect. Ordering between
differently named optargs is not preserved.

A mandatory list (or an optional one which is reported to be available),
corresponding to a repeating optarg, has at least one element after
successful parsing.

v1->v2:
- Update opts_type_size() prototype to uint64_t.
- Add opts_type_uint64() for options needing the full uint64_t range.
  (Internals could be extracted to "cutils.c".)
- Allow negative values in opts_type_int().
- Rebase to nested Makefiles.

v2->v3:
- Factor opts_visitor_insert() out of opts_start_struct() and call it
  separately for opts_root->id if there's any.
- Don't require non-negative values in opts_type_int()'s error message.
- g_malloc0() may return NULL for zero-sized requests. Support empty
  structures by requesting 1 byte for them instead.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoexpose QemuOpt and QemuOpts struct definitions to interested parties
Laszlo Ersek [Tue, 17 Jul 2012 14:17:08 +0000 (16:17 +0200)]
expose QemuOpt and QemuOpts struct definitions to interested parties

The only clients should be the existent "qemu-option.c", and the upcoming
"qapi/opts-visitor.c".

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqapi: introduce "size" type
Laszlo Ersek [Tue, 17 Jul 2012 14:17:07 +0000 (16:17 +0200)]
qapi: introduce "size" type

v1->v2:
- fall back to uint64 rather than int

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqapi: generate C types for fixed-width integers
Laszlo Ersek [Tue, 17 Jul 2012 14:17:06 +0000 (16:17 +0200)]
qapi: generate C types for fixed-width integers

(Long line folded using parens:
<http://www.python.org/dev/peps/pep-0008/#maximum-line-length>.)

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqapi: add test case for deallocating traversal of incomplete structure
Laszlo Ersek [Tue, 17 Jul 2012 14:17:05 +0000 (16:17 +0200)]
qapi: add test case for deallocating traversal of incomplete structure

v3:
- new patch

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqapi: fix error propagation
Paolo Bonzini [Tue, 17 Jul 2012 14:17:04 +0000 (16:17 +0200)]
qapi: fix error propagation

Don't overwrite / leak previously set errors.
Make traversal cope with missing mandatory sub-structs.
Don't try to end a container that could not be started.

v1->v2:
- unchanged

v2->v3:
- instead of examining, assert that we never overwrite errors with
  error_set()
- allow visitors to set a NULL struct pointer successfully, so traversal
  of incomplete objects can continue
- check for a NULL "obj" before accessing "(*obj)->has_XXX" (this is not a
  typo, "obj != NULL" implies "*obj != NULL" here)
- fix start_struct / end_struct balance for unions as well

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoMAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi
Stefan Hajnoczi [Fri, 20 Jul 2012 13:29:24 +0000 (14:29 +0100)]
MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi

The net subsystem has lacked an active maintainer since 2009.  I have
built and tested a net-next tree to get the ball rolling again.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoFix some more Qemus in documentation and help text
Stefan Weil [Fri, 20 Jul 2012 21:26:02 +0000 (23:26 +0200)]
Fix some more Qemus in documentation and help text

Hopefully they will be eliminated one day.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqdev: Fix Open Firmware comment
Stefan Weil [Fri, 20 Jul 2012 21:04:49 +0000 (23:04 +0200)]
qdev: Fix Open Firmware comment

Commit 0d936928ef87ca1bb7b41b5b89c400c699a7691c removed code,
but left the related comment at a location where it no longer
belongs to.

The patch moves the comment to the correct callback and improves the text.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agocpus.c: Make all_cpu_threads_idle() static
Peter Maydell [Thu, 19 Jul 2012 15:52:27 +0000 (16:52 +0100)]
cpus.c: Make all_cpu_threads_idle() static

Commit 946fb27c1 moved all the uses of all_cpu_threads_idle()
into cpus.c. This means we can mark the function 'static'
(again), if we shuffle it a bit earlier in the source file.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoUse macro QEMU_PACKED for new packed structures
Stefan Weil [Wed, 18 Jul 2012 16:12:37 +0000 (18:12 +0200)]
Use macro QEMU_PACKED for new packed structures

Since commit 541dc0d47f10973c241e9955afc2aefc96adec51,
some new packed structures were added without using QEMU_PACKED.

QEMU_PACKED is needed for compilations with MinGW.
For other platforms nothing changes.

The code was fixed using this command:

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

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoRecognize PCID feature
Mao, Junjie [Fri, 20 Jul 2012 07:08:21 +0000 (07:08 +0000)]
Recognize PCID feature

This patch makes Qemu recognize the PCID feature specified from configuration or command line options.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agopowerpc pci: fixed packing of ranges[]
Alexey Kardashevskiy [Wed, 18 Jul 2012 08:22:51 +0000 (18:22 +1000)]
powerpc pci: fixed packing of ranges[]

By default mingw-gcc is trying to pack structures the way to
preserve binary compatibility with MS Visual C what leads to
incorrect and unexpected padding in the PCI bus ranges property of
the sPAPR PHB.

The patch replaces __attribute__((packed)) with more strict QEMU_PACKED
which actually is __attribute__((gcc_struct, packed)) on Windows.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Tested-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoexynos4210: add Exynos4210 i2c implementation
Mitsyanko Igor [Wed, 18 Jul 2012 08:18:34 +0000 (08:18 +0000)]
exynos4210: add Exynos4210 i2c implementation

Create 9 exynos4210 i2c interfaces.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/exynos4210_rtc.c: remove unnecessary code
Oleg Ogurtsov [Wed, 11 Jul 2012 00:03:28 +0000 (00:03 +0000)]
hw/exynos4210_rtc.c: remove unnecessary code

Signed-off-by: Oleg Ogurtsov <o.ogurtsov@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/exynos4210_rtc.c: Fix calculating for value of year
Oleg Ogurtsov [Wed, 11 Jul 2012 00:03:27 +0000 (00:03 +0000)]
hw/exynos4210_rtc.c: Fix calculating for value of year

Signed-off-by: Oleg Ogurtsov <o.ogurtsov@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard
Peter Maydell [Fri, 20 Jul 2012 12:34:50 +0000 (13:34 +0100)]
hw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard

Now that we have LPAE support and can handle passing 64 bit
RAM sizes to Linux via the device tree, we can lift the
restriction in the Versatile Express A15 daughterboard model
on not having more than 2GB of RAM. Allow up to 30GB, which
is the maximum that can fit in the address map before running
into the (unmodelled) aliases of the first 2GB.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agohw/arm_boot.c: Support DTBs which use 64 bit addresses
Peter Maydell [Fri, 20 Jul 2012 12:34:50 +0000 (13:34 +0100)]
hw/arm_boot.c: Support DTBs which use 64 bit addresses

Support the case where the device tree blob specifies that
#address-cells and #size-cells are greater than 1. (This
is needed for device trees which can handle 64 bit physical
addresses and thus total RAM sizes over 4GB.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
12 years agodevice_tree: Add support for reading device tree properties
Peter Maydell [Fri, 20 Jul 2012 12:34:50 +0000 (13:34 +0100)]
device_tree: Add support for reading device tree properties

Add support for reading device tree properties (both generic
and single-cell ones) to QEMU's convenience wrapper layer.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
12 years agohw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity
Peter Maydell [Fri, 20 Jul 2012 12:34:50 +0000 (13:34 +0100)]
hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity

The legacy ATAGS format for passing information to the kernel only
allows RAM sizes which fit in 32 bits; enforce this restriction
rather than silently doing something weird.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
12 years agohw/arm_boot.c: Consistently use ram_size from arm_boot_info struct
Peter Maydell [Fri, 20 Jul 2012 12:34:50 +0000 (13:34 +0100)]
hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct

Clean up the mix of getting the RAM size from the global ram_size
and from the ram_size field in the arm_boot_info structure, so
that we always use the structure field.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
12 years agohw/arm_boot.c: Make ram_size a uint64_t
Peter Maydell [Fri, 20 Jul 2012 12:34:49 +0000 (13:34 +0100)]
hw/arm_boot.c: Make ram_size a uint64_t

Make the RAM size in arm_boot_info a uint64_t so it can express
the larger RAM sizes that may be seen in LPAE systems.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
12 years agohw/pl011.c: Avoid crash on read when no chr backend present
Peter Maydell [Fri, 20 Jul 2012 12:34:49 +0000 (13:34 +0100)]
hw/pl011.c: Avoid crash on read when no chr backend present

Add a missing guard that meant we would segfault if the guest read
UARTDR on a PL011 serial device which had no chr backend connected.
(This didn't happen for Linux guests because Linux reads the flags
register and doesn't try to read the UART if it's empty.)

Reported-by: Christian Müller <christian.mueller@heig-vd.ch>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoRevert "audio: Make PC speaker audio card available by default"
Anthony Liguori [Thu, 19 Jul 2012 23:25:52 +0000 (18:25 -0500)]
Revert "audio: Make PC speaker audio card available by default"

This reverts commit 504972922da9b562f15e13544d3efca84b46b8fd which broke the
build for ARM.

I don't think this change is necessary.  If I'm wrong, please recommit this
changeset with an appropriate fix for ARM.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoaudio: Make PC speaker audio card available by default
Jan Kiszka [Thu, 19 Jul 2012 15:57:51 +0000 (17:57 +0200)]
audio: Make PC speaker audio card available by default

    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "KOI8-R" character set.  ]
    [ Some special characters may be displayed incorrectly. ]

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoUpdate simpletrace.py for new log format
Harsh Prateek Bora [Wed, 18 Jul 2012 09:46:00 +0000 (15:16 +0530)]
Update simpletrace.py for new log format

Support new tracelog format for multiple arguments and strings.

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoSimpletrace v2: Support multiple arguments, strings.
Harsh Prateek Bora [Wed, 18 Jul 2012 09:45:59 +0000 (15:15 +0530)]
Simpletrace v2: Support multiple arguments, strings.

Existing simpletrace backend allows to trace at max 6 args and does not
support strings. This newer tracelog format gets rid of fixed size records
and therefore allows to trace variable number of args including strings.

Sample trace with strings:
v9fs_version 0.000 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L
v9fs_version_return 6.705 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agomonitor: remove unused do_info_trace
Harsh Prateek Bora [Wed, 18 Jul 2012 09:45:58 +0000 (15:15 +0530)]
monitor: remove unused do_info_trace

Going forward with simpletrace v2 variable size trace records, we cannot
have a generic function to print trace event info and therefore this
interface becomes invalid.

As per Stefan Hajnoczi:

"This command is only available from the human monitor.  It's not very
useful because it historically hasn't been able to pretty-print events
or show them in the right order (we use a ringbuffer but it prints
them out from index 0).

Therefore, I don't think we're under any obligation to keep this
command around.  No one has complained about it's limitations - I
think this is a sign that no one has used it.  I'd be okay with a
patch that removes it."

Ref: http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg01268.html

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agotrace: added ability to comment out events in the list
Alexey Kardashevskiy [Thu, 14 Jun 2012 04:41:40 +0000 (14:41 +1000)]
trace: added ability to comment out events in the list

It is convenient for debug to be able to switch on/off some events easily.
The only possibility now is to remove event name from the file completely
and type it again when we want it back.

The patch adds '#' symbol handling as a comment specifier.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Wed, 18 Jul 2012 19:44:50 +0000 (14:44 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony: (41 commits)
  fdc-test: Clean up a bit
  fdc-test: introduce test_relative_seek
  fdc: fix relative seek
  qemu-iotests: Valgrind support
  coroutine-ucontext: Help valgrind understand coroutines
  qemu-io: Fix memory leaks
  hw/block-common: Factor out fall back to legacy -drive cyls=...
  blockdev: Don't limit DriveInfo serial to 20 characters
  hw/block-common: Factor out fall back to legacy -drive serial=...
  hw/block-common: Move BlockConf & friends from block.h
  Relax IDE CHS limits from 16383,16,63 to 65535,16,255
  blockdev: Drop redundant CHS validation for if=ide
  hd-geometry: Compute BIOS CHS translation in one place
  qtest: Test we don't put hard disk info into CMOS for a CD-ROM
  ide pc: Put hard disk info into CMOS only for hard disks
  block: Geometry and translation hints are now useless, purge them
  qtest: Cover qdev property for BIOS CHS translation
  ide: qdev property for BIOS CHS translation
  qdev: New property type chs-translation
  qdev: Collect private helpers in one place
  ...

12 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Wed, 18 Jul 2012 19:44:43 +0000 (14:44 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

* qemu-kvm/uq/master:
  virtio: move common irqfd handling out of virtio-pci
  virtio: move common ioeventfd handling out of virtio-pci
  event_notifier: add event_notifier_set_handler
  memory: pass EventNotifier, not eventfd
  ivshmem: wrap ivshmem_del_eventfd loops with transaction
  ivshmem: use EventNotifier and memory API
  event_notifier: add event_notifier_init_fd
  event_notifier: remove event_notifier_test
  event_notifier: add event_notifier_set
  apic: Defer interrupt updates to VCPU thread
  apic: Reevaluate pending interrupts on LVT_LINT0 changes
  apic: Resolve potential endless loop around apic_update_irq
  kvm: expose tsc deadline timer feature to guest
  kvm_pv_eoi: add flag support
  kvm: Don't abort on kvm_irqchip_add_msi_route()

12 years agoMerge remote-tracking branch 'qmp/queue/qmp' into staging
Anthony Liguori [Wed, 18 Jul 2012 19:44:37 +0000 (14:44 -0500)]
Merge remote-tracking branch 'qmp/queue/qmp' into staging

* qmp/queue/qmp:
  qapi: Convert getfd and closefd
  qapi: input_type_enum(): fix error message
  qmp: dump-guest-memory: improve schema doc

12 years agoMerge remote-tracking branch 'kraxel/bios.2' into staging
Anthony Liguori [Wed, 18 Jul 2012 19:44:32 +0000 (14:44 -0500)]
Merge remote-tracking branch 'kraxel/bios.2' into staging

* kraxel/bios.2:
  Add vgabios build rules to roms/Makefile

12 years agoMerge remote-tracking branch 'kraxel/usb.57' into staging
Anthony Liguori [Wed, 18 Jul 2012 19:44:27 +0000 (14:44 -0500)]
Merge remote-tracking branch 'kraxel/usb.57' into staging

* kraxel/usb.57:
  ehci: improve expire time calculation
  ehci: implement Interrupt Threshold Control support
  ehci: raise irq in the frame timer
  uhci: initialize expire_time when loading v1 vmstate
  usb: add usb attached scsi emulation
  scsi: add free_request callback

12 years agobuild: fix build breakage due to bad merge
Anthony Liguori [Tue, 17 Jul 2012 23:58:20 +0000 (18:58 -0500)]
build: fix build breakage due to bad merge

34bb443ee74df3780d86044dbf6492eb798c5807 broke the build but in a subtle way.
The patch on the ML was actually based on the 1.1.1 stable branch
(accidentally).  When I merged it from the ML, the fuzzing got resolved in a
such a way that the newly introduced Makefile dependency on GENERATED_HEADERS
got lost (that was not in 1.1.1).

The dist bits also got duplicated (but this is just cosmetic).

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agobuild: add make dist target (v2)
Anthony Liguori [Tue, 17 Jul 2012 18:33:32 +0000 (13:33 -0500)]
build: add make dist target (v2)

Let's stop screwing up releases by having a script do the work that Anthony's
fat fingers can't seem to get right.

Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-options.hx: Fix set_password and expire_password description
Michal Novotny [Mon, 16 Jul 2012 13:54:38 +0000 (15:54 +0200)]
qemu-options.hx: Fix set_password and expire_password description

The description for set_password and expire_password commands is
incomplete. This patch fixes the man page that is being generated
to match the real behaviour of these functions.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-options.hx: Improve -nodefaults description
Michal Novotny [Mon, 16 Jul 2012 12:35:10 +0000 (14:35 +0200)]
qemu-options.hx: Improve -nodefaults description

This patch improves the description of -nodefaults QEMU command line
option by adding more information what is being disabled using this
command.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoqemu-options.hx: Improve -{read|write}config options description
Michal Novotny [Mon, 16 Jul 2012 12:28:32 +0000 (14:28 +0200)]
qemu-options.hx: Improve -{read|write}config options description

This is the patch to improve description for -{read|write}config
functions.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoconstify value pointer for qdev_prop_set_string
Christian Borntraeger [Tue, 17 Jul 2012 13:26:17 +0000 (15:26 +0200)]
constify value pointer for qdev_prop_set_string

qdev_prop_set_string uses object_property_set_str, which takes
a const char * for the value. Lets propagate the constness
into qdev_prop_set_string.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agodoc: Fix indefinite article an -> a before nouns that begin with 'h'
Stefan Weil [Mon, 16 Jul 2012 21:37:07 +0000 (23:37 +0200)]
doc: Fix indefinite article an -> a before nouns that begin with 'h'

Although the rule also allows 'an' for historical reasons,
'a' is more common because 'h' is pronounced.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agofdc-test: Clean up a bit
Kevin Wolf [Mon, 16 Jul 2012 14:06:56 +0000 (16:06 +0200)]
fdc-test: Clean up a bit

Readability of the test code has suffered as the test case evolved. This
should improve it a bit again.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc-test: introduce test_relative_seek
Pavel Hrdina [Mon, 16 Jul 2012 13:48:27 +0000 (15:48 +0200)]
fdc-test: introduce test_relative_seek

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agofdc: fix relative seek
Pavel Hrdina [Mon, 16 Jul 2012 13:48:26 +0000 (15:48 +0200)]
fdc: fix relative seek

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: Valgrind support
Kevin Wolf [Thu, 28 Jun 2012 14:55:54 +0000 (16:55 +0200)]
qemu-iotests: Valgrind support

check -valgrind wraps all qemu-io calls with valgrind. This makes it a
bit easier to debug problems that occur somewhere deep in a test case.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agocoroutine-ucontext: Help valgrind understand coroutines
Kevin Wolf [Fri, 29 Jun 2012 11:40:27 +0000 (13:40 +0200)]
coroutine-ucontext: Help valgrind understand coroutines

valgrind tends to get confused and report false positives when you
switch stacks and don't tell it about it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoqemu-io: Fix memory leaks
Kevin Wolf [Mon, 2 Jul 2012 13:13:53 +0000 (15:13 +0200)]
qemu-io: Fix memory leaks

Almost all callers of create_iovec() forgot to destroy the qiov when the
request has completed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agohw/block-common: Factor out fall back to legacy -drive cyls=...
Markus Armbruster [Wed, 11 Jul 2012 13:08:39 +0000 (15:08 +0200)]
hw/block-common: Factor out fall back to legacy -drive cyls=...

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblockdev: Don't limit DriveInfo serial to 20 characters
Markus Armbruster [Wed, 11 Jul 2012 13:08:38 +0000 (15:08 +0200)]
blockdev: Don't limit DriveInfo serial to 20 characters

All current users (IDE, SCSI and virtio-blk) happen to share this 20
characters limit.  Still, it should be left to device models.  They
already enforce their limits.  They have to, as the DriveInfo limit
only affects legacy -drive serial=..., not the qdev properties.

usb-storage, which doesn't limit serial number length, also uses
DriveInfo for -usbdevice.  But that doesn't provide access to
DriveInfo serial.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohw/block-common: Factor out fall back to legacy -drive serial=...
Markus Armbruster [Wed, 11 Jul 2012 13:08:37 +0000 (15:08 +0200)]
hw/block-common: Factor out fall back to legacy -drive serial=...

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohw/block-common: Move BlockConf & friends from block.h
Markus Armbruster [Wed, 11 Jul 2012 13:08:36 +0000 (15:08 +0200)]
hw/block-common: Move BlockConf & friends from block.h

This stuff doesn't belong to block layer, and was put there only
because a better home didn't exist then.  Now it does.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoRelax IDE CHS limits from 16383,16,63 to 65535,16,255
Markus Armbruster [Tue, 10 Jul 2012 09:12:55 +0000 (11:12 +0200)]
Relax IDE CHS limits from 16383,16,63 to 65535,16,255

New limits straight from ATA4 6.2 Register delivered data transfer
command sector addressing.

I figure the old sector limit 63 was blindly copied from the BIOS
int 13 limit.  Doesn't apply to the hardware.  No idea where the old
cylinder limit comes from.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblockdev: Drop redundant CHS validation for if=ide
Markus Armbruster [Tue, 10 Jul 2012 09:12:54 +0000 (11:12 +0200)]
blockdev: Drop redundant CHS validation for if=ide

Leave it to ide_init_drive().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agohd-geometry: Compute BIOS CHS translation in one place
Markus Armbruster [Tue, 10 Jul 2012 09:12:53 +0000 (11:12 +0200)]
hd-geometry: Compute BIOS CHS translation in one place

Currently, it is split between hd_geometry_guess() and
pc_cmos_init_late().  Confusing.  info qtree shows the result of the
former.  Also confusing.

Fold the part done in pc_cmos_init_late() into hd_geometry_guess().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqtest: Test we don't put hard disk info into CMOS for a CD-ROM
Markus Armbruster [Tue, 10 Jul 2012 09:12:52 +0000 (11:12 +0200)]
qtest: Test we don't put hard disk info into CMOS for a CD-ROM

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoide pc: Put hard disk info into CMOS only for hard disks
Markus Armbruster [Tue, 10 Jul 2012 09:12:51 +0000 (11:12 +0200)]
ide pc: Put hard disk info into CMOS only for hard disks

In particular, don't set disk type and geometry when a CD-ROM on bus
ide.0 has media during CMOS initialization.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>