]> Git Repo - qemu.git/log
qemu.git
7 years agoi386/cpu: use get_uint() for "min-level"/"min-xlevel" properties
Marc-André Lureau [Wed, 7 Jun 2017 16:36:31 +0000 (20:36 +0400)]
i386/cpu: use get_uint() for "min-level"/"min-xlevel" properties

These are properties of TYPE_X86_CPU, defined with DEFINE_PROP_UINT32()

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agonuma: use get_uint() for "size" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:30 +0000 (20:36 +0400)]
numa: use get_uint() for "size" property

"size" is a property of TYPE_MEMORY_BACKEND.
host_memory_backend_get_size() and host_memory_backend_set_size() use
visit_type_size().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agopnv-core: use get_uint() for "core-pir" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:29 +0000 (20:36 +0400)]
pnv-core: use get_uint() for "core-pir" property

This is an alias of TYPE_PNV_CORE's property "pir", which is defined
with DEFINE_PROP_UINT32()

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agopvpanic: use get_uint() for "ioport" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:28 +0000 (20:36 +0400)]
pvpanic: use get_uint() for "ioport" property

TYPE_ISA_PVPANIC_DEVICE's property PVPANIC_IOPORT_PROP is defined with
DEFINE_PROP_UINT16().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoauxbus: use get_uint() for "addr" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:27 +0000 (20:36 +0400)]
auxbus: use get_uint() for "addr" property

This is TYPE_MEMORY_REGION's property.  Its getter
memory_region_get_addr() uses visit_type_uint64().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoarm: use get_uint() for "mp-affinity" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:26 +0000 (20:36 +0400)]
arm: use get_uint() for "mp-affinity" property

TYPE_ARM_CPU's property "mp-affinity" is defined with
DEFINE_PROP_UINT64().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoxen: use get_uint() for "max-ram-below-4g" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:25 +0000 (20:36 +0400)]
xen: use get_uint() for "max-ram-below-4g" property

TYPE_PC_MACHINE's property PC_MACHINE_MAX_RAM_BELOW_4G's getter and
setter pc_machine_get_max_ram_below_4g() and
pc_machine_set_max_ram_below_4g() use visit_type_size()

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agopc: use get_uint() for "hpet-intcap" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:24 +0000 (20:36 +0400)]
pc: use get_uint() for "hpet-intcap" property

TYPE_HPET's property HPET_INTCAP is defined with DEFINE_PROP_UINT32().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agopc: use get_uint() for "apic-id" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:23 +0000 (20:36 +0400)]
pc: use get_uint() for "apic-id" property

TYPE_X86_CPU's property "apic-id" is defined with DEFINE_PROP_UINT32().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agopc: use get_uint() for "iobase" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:22 +0000 (20:36 +0400)]
pc: use get_uint() for "iobase" property

TYPE_ISA_FDC's property "iobase" is defined with DEFINE_PROP_UINT32().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoacpi: use get_uint() for "pci-hole*" properties
Marc-André Lureau [Wed, 7 Jun 2017 16:36:21 +0000 (20:36 +0400)]
acpi: use get_uint() for "pci-hole*" properties

Those properties use visit_type_uint*()

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoacpi: use get_uint() for various acpi properties
Marc-André Lureau [Wed, 7 Jun 2017 16:36:20 +0000 (20:36 +0400)]
acpi: use get_uint() for various acpi properties

PIIX4: piix4_pm_add_propeties() defines these with
object_property_add_uint*_ptr().

Q35: ich9_lpc_add_properties() and ich9_pm_add_properties() define them
similarly, except for ACPI_PM_PROP_GPE0_BLK().  That one's getter
ich9_pm_get_gpe0_blk() uses visit_type_uint32().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoacpi: use get_uint() for "acpi-pcihp-io*" properties
Marc-André Lureau [Wed, 7 Jun 2017 16:36:19 +0000 (20:36 +0400)]
acpi: use get_uint() for "acpi-pcihp-io*" properties

Those are defined with object_property_add_uint16_ptr()

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoplatform-bus: use get_uint() for "addr" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:18 +0000 (20:36 +0400)]
platform-bus: use get_uint() for "addr" property

This is TYPE_MEMORY_REGION's property.  Its getter
memory_region_get_addr() uses visit_type_uint64().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agobcm2835_fb: use {get, set}_uint() for "vcram-size" and "vcram-base"
Marc-André Lureau [Wed, 7 Jun 2017 16:36:17 +0000 (20:36 +0400)]
bcm2835_fb: use {get, set}_uint() for "vcram-size" and "vcram-base"

Both properties are defined with DEFINE_PROP_UINT32().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoaspeed: use {set, get}_uint() for "ram-size" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:16 +0000 (20:36 +0400)]
aspeed: use {set, get}_uint() for "ram-size" property

This property is an alias for device TYPE_ASPEED_SDMC's property
"ram-size", which is defined with DEFINE_PROP_UINT64().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agopcihp: use get_uint() for "bsel" property
Marc-André Lureau [Wed, 7 Jun 2017 16:36:15 +0000 (20:36 +0400)]
pcihp: use get_uint() for "bsel" property

The property is defined with object_property_add_uint32_ptr()

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agopc-dimm: make "size" property uint64
Marc-André Lureau [Wed, 7 Jun 2017 16:36:14 +0000 (20:36 +0400)]
pc-dimm: make "size" property uint64

This carries the memory_region_size() value without implicit cast.

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agopc-dimm: use get_uint() for dimm properties
Marc-André Lureau [Wed, 7 Jun 2017 16:36:13 +0000 (20:36 +0400)]
pc-dimm: use get_uint() for dimm properties

TYPE_PC_DIMM's property PC_DIMM_ADDR_PROP is defined with
DEFINE_PROP_UINT64().

TYPE_PC_DIMM's property PC_DIMM_NODE_PROP is defined with
DEFINE_PROP_UINT32().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoisa: use get_uint() for "io-base"
Marc-André Lureau [Wed, 7 Jun 2017 16:36:12 +0000 (20:36 +0400)]
isa: use get_uint() for "io-base"

The property is defined with DEFINE_PROP_UINT32().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqdev: Use appropriate getter/setters type
Marc-André Lureau [Wed, 7 Jun 2017 16:36:11 +0000 (20:36 +0400)]
qdev: Use appropriate getter/setters type

Based on the underlying type of the data accessed, use the appropriate
getters/setters:

* AcpiPmInfo members s3_disabled, s4_disabled are bool, member s4_val is
  an uint8_t

* Property ACPI_PCIHP_IO_PROP is defined with
  object_property_add_uint32_ptr()

* Property PCIE_HOST_MCFG_SIZE is implemented with visit_type_uint64()

* PCIDevice property "addr" is backed by PCIDevice member devfn, which
  is an int32_t

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[More verbose commit message]
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoapic-common: make "id" property a uint32
Marc-André Lureau [Wed, 7 Jun 2017 16:36:10 +0000 (20:36 +0400)]
apic-common: make "id" property a uint32

The getter and setter of TYPE_APIC_COMMON property "id" are
apic_common_get_id() and apic_common_set_id().

apic_common_get_id() reads either APICCommonState member uint32_t
initial_apic_id or uint8_t id into an int64_t local variable.  It then
passes this variable to visit_type_int().

apic_common_set_id() uses visit_type_int() to read the value into a
local variable, which it then assigns both to initial_apic_id and id.

While the state backing the property is two unsigned members, 8 and 32
bits wide, the actual visitor is 64 bits signed.

Change getter and setter to use visit_type_uint32().  Then everything's
uint32_t, except for @id.

Suggested-by: Markus Armbruster <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqdev: avoid type casts between signed and unsigned
Marc-André Lureau [Wed, 7 Jun 2017 16:36:09 +0000 (20:36 +0400)]
qdev: avoid type casts between signed and unsigned

Modify the unsigned type for various properties to use QNUM_U64, to
avoid type casts.

There are a few empty lines added to improve code reading/style.

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[Change to set_default_value_enum() dropped]
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqdev: wrap default property value in an union
Marc-André Lureau [Wed, 7 Jun 2017 16:36:08 +0000 (20:36 +0400)]
qdev: wrap default property value in an union

Wrap the Property default value (an int64_t) in a union, to prepare
for the next patch adding a uint64_t.

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqdev: Rename DEFINE_PROP_DEFAULT() to DEFINE_PROP_SIGNED()
Marc-André Lureau [Wed, 7 Jun 2017 16:36:07 +0000 (20:36 +0400)]
qdev: Rename DEFINE_PROP_DEFAULT() to DEFINE_PROP_SIGNED()

The rename prepares for the patch after next's DEFINE_PROP_UNSIGNED().

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoobject: use more specific property type names
Marc-André Lureau [Wed, 7 Jun 2017 16:36:06 +0000 (20:36 +0400)]
object: use more specific property type names

Use the actual unsigned integer type name.

The type name change impacts the following externally visible area:

* vl.c's machine_help_func() puts it in help for -machine NAME,help.

* QMP command qom-list exposes it in ObjectPropertyInfo member @type.

* QMP command device-list-properties exposes it in DevicePropertyInfo
  member @type.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoq35: fix get_mmcfg_size to use uint64 visitor
Marc-André Lureau [Wed, 7 Jun 2017 16:36:05 +0000 (20:36 +0400)]
q35: fix get_mmcfg_size to use uint64 visitor

e->size is hwaddr, i.e. uint64_t. We silently truncate.

Signed-off-by: Marc-André Lureau <[email protected]>
Suggested-by: Markus Armbruster <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoobject: add uint property setter/getter
Marc-André Lureau [Wed, 7 Jun 2017 16:36:04 +0000 (20:36 +0400)]
object: add uint property setter/getter

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqapi: update the qobject visitor to use QNUM_U64
Marc-André Lureau [Wed, 7 Jun 2017 16:36:03 +0000 (20:36 +0400)]
qapi: update the qobject visitor to use QNUM_U64

Switch to use QNum/uint where appropriate to remove i64 limitation.

The input visitor will cast i64 input to u64 for compatibility
reasons (existing json QMP client already use negative i64 for large
u64, and expect an implicit cast in qemu).

Note: before the patch, uint64_t values above INT64_MAX are sent over
json QMP as negative values, e.g. UINT64_MAX is sent as -1. After the
patch, they are sent unmodified.  Clearly a bug fix, but we have to
consider compatibility issues anyway.  libvirt should cope fine,
because its parsing of unsigned integers accepts negative values
modulo 2^64.  There's hope that other clients will, too.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
[check_native_list() tweaked for consistency with signed case]
Signed-off-by: Markus Armbruster <[email protected]>
7 years agojson: learn to parse uint64 numbers
Marc-André Lureau [Wed, 7 Jun 2017 16:36:02 +0000 (20:36 +0400)]
json: learn to parse uint64 numbers

Switch strtoll() usage to qemu_strtoi64() helper while at it.

Add a few tests for large numbers.

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqnum: add uint type
Marc-André Lureau [Wed, 7 Jun 2017 16:36:01 +0000 (20:36 +0400)]
qnum: add uint type

In order to store integer values between INT64_MAX and UINT64_MAX, add
a uint64_t internal representation.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agotests: remove /{qnum, qlist, dict}/destroy test
Marc-André Lureau [Wed, 7 Jun 2017 16:36:00 +0000 (20:36 +0400)]
tests: remove /{qnum, qlist, dict}/destroy test

The tests aren't really useful, or already covered by other simple tests.

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqapi: Remove visit_start_alternate() parameter promote_int
Marc-André Lureau [Wed, 7 Jun 2017 16:35:59 +0000 (20:35 +0400)]
qapi: Remove visit_start_alternate() parameter promote_int

Before the previous commit, parameter promote_int = true made
visit_start_alternate() with an input visitor avoid QTYPE_QINT
variants and create QTYPE_QFLOAT variants instead.  This was used
where QTYPE_QINT variants were invalid.

The previous commit fused QTYPE_QINT with QTYPE_QFLOAT, rendering
promote_int useless and unused.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqapi: merge QInt and QFloat in QNum
Marc-André Lureau [Wed, 7 Jun 2017 16:35:58 +0000 (20:35 +0400)]
qapi: merge QInt and QFloat in QNum

We would like to use a same QObject type to represent numbers, whether
they are int, uint, or floats. Getters will allow some compatibility
between the various types if the number fits other representations.

Add a few more tests while at it.

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[parse_stats_intervals() simplified a bit, comment in
test_visitor_in_int_overflow() tidied up, suppress bogus warnings]
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqapi: Clean up qobject_input_type_number() control flow
Marc-André Lureau [Wed, 7 Jun 2017 16:35:57 +0000 (20:35 +0400)]
qapi: Clean up qobject_input_type_number() control flow

Use the more common pattern to error out.

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <[email protected]>
7 years agotests: add more int/number ranges checks
Marc-André Lureau [Wed, 7 Jun 2017 16:35:56 +0000 (20:35 +0400)]
tests: add more int/number ranges checks

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20170607163635[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[test_visitor_in_uint() tightened slightly]
Signed-off-by: Markus Armbruster <[email protected]>
7 years agotests: Remove test cases for alternates of 'number' and 'int'
Marc-André Lureau [Wed, 7 Jun 2017 16:35:55 +0000 (20:35 +0400)]
tests: Remove test cases for alternates of 'number' and 'int'

Alternates with both a 'number' and an 'int' branch will become
invalid when the next patch merges of QFloat and QInt into QNum.
More sophisticated alternate code could keep them valid, but since
we have no users outside tests, simply drop the tests.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoobject: fix potential leak in getters
Marc-André Lureau [Wed, 7 Jun 2017 16:35:54 +0000 (20:35 +0400)]
object: fix potential leak in getters

If the property is not of the requested type, the getters will leak a
QObject.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoqdev: remove PropertyInfo.qtype field
Marc-André Lureau [Wed, 7 Jun 2017 16:35:53 +0000 (20:35 +0400)]
qdev: remove PropertyInfo.qtype field

Remove dependency on qapi qtype, replace a field by a few PropertyInfo
callbacks to set the default value type (introduced in commit 4f2d3d7).

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20170607163635[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-s390-20170613' into staging
Peter Maydell [Thu, 15 Jun 2017 12:45:15 +0000 (13:45 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-s390-20170613' into staging

Queued s390 patches

# gpg: Signature made Tue 13 Jun 2017 21:22:41 BST
# gpg:                using RSA key 0xAD1270CC4DD0279B
# gpg: Good signature from "Richard Henderson <[email protected]>"
# gpg:                 aka "Richard Henderson <[email protected]>"
# gpg:                 aka "Richard Henderson <[email protected]>"
# Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC  16A4 AD12 70CC 4DD0 279B

* remotes/rth/tags/pull-s390-20170613:
  s390x/cpumodel: wire up cpu type + id for TCG
  target/s390x: rework PGM interrupt psw.addr handling
  target/s390x: correctly indicate PER nullification

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/juanquintela/tags/migration/20170614' into...
Peter Maydell [Thu, 15 Jun 2017 08:43:12 +0000 (09:43 +0100)]
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170614' into staging

migration/next for 20170614

# gpg: Signature made Wed 14 Jun 2017 11:16:21 BST
# gpg:                using RSA key 0xF487EF185872D723
# gpg: Good signature from "Juan Quintela <[email protected]>"
# gpg:                 aka "Juan Quintela <[email protected]>"
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* remotes/juanquintela/tags/migration/20170614:
  migration: Don't create decompression threads if not enabled
  migration: Test for disabled features on reception
  migration: Remove unneeded includes
  migration: fix incorrect enable return path
  migration: Fix compilation with older compilers

Signed-off-by: Peter Maydell <[email protected]>
7 years agomigration: Don't create decompression threads if not enabled
Juan Quintela [Wed, 20 Apr 2016 09:56:01 +0000 (11:56 +0200)]
migration: Don't create decompression threads if not enabled

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
--

I removed the [HACK] part because previous patch just check that
compression pages are not received.

7 years agomigration: Test for disabled features on reception
Juan Quintela [Wed, 2 Nov 2016 11:40:46 +0000 (12:40 +0100)]
migration: Test for disabled features on reception

Right now, if we receive a compressed page while this features are
disabled, Bad Things (TM) can happen.  Just add a test for them.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
--

I had XBZRLE here also, but it don't need extra resources on
destination, only on source.  Additionally libvirt don't enable it on
destination, so don't put it here.

- initialize invalid_flags at declaration time.
- remove extra space (peter)

7 years agomigration: Remove unneeded includes
Juan Quintela [Mon, 24 Apr 2017 14:51:10 +0000 (16:51 +0200)]
migration: Remove unneeded includes

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
7 years agomigration: fix incorrect enable return path
Peter Xu [Wed, 14 Jun 2017 07:55:58 +0000 (15:55 +0800)]
migration: fix incorrect enable return path

0425dc9 is actually v1 of that patch, but it was accidentally
merged (while there was a v2). That will cause problem when we try to
migrate to some old QEMUs when return path is not really there. Let's
fix it, then squashing this patch with 0425dc9 will be exactly patch
content of v2.

Fixes: 0425dc9 ("migration: isolate return path on src")
Signed-off-by: Peter Xu <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
7 years agomigration: Fix compilation with older compilers
Juan Quintela [Wed, 14 Jun 2017 08:34:34 +0000 (10:34 +0200)]
migration: Fix compilation with older compilers

That typedefs are needed on both files.  New compilers (F25 where I
work) don't complain about repeating a typedef.  But older ones
complain.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
7 years agos390x/cpumodel: wire up cpu type + id for TCG
David Hildenbrand [Fri, 9 Jun 2017 13:34:26 +0000 (15:34 +0200)]
s390x/cpumodel: wire up cpu type + id for TCG

Let's properly expose the CPU type (machine-type number) via "STORE CPU
ID" and "STORE SUBSYSTEM INFORMATION".

As TCG emulates basic mode, the CPU identification number has the format
"Annnnn", whereby A is the CPU address, and n are parts of the CPU serial
number (0 for us for now).

A specification exception will be injected if the address is not aligned
to a double word. Low address protection will not be checked as
we're missing some more general support for that.

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170609133426[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
7 years agotarget/s390x: rework PGM interrupt psw.addr handling
David Hildenbrand [Fri, 9 Jun 2017 14:21:56 +0000 (16:21 +0200)]
target/s390x: rework PGM interrupt psw.addr handling

We can tell from the program interrupt code, whether a program interrupt
has to forward the address in the PGM new PSW
(suppressing/terminated/completed) to point at the next instruction, or
if it is nullifying and the PSW address does not have to be incremented.

So let's not modify the PSW address outside of the injection path and
handle this internally. We just have to handle instruction length
auto detection if no valid instruction length can be provided.

This should fix various program interrupt injection paths, where the
PSW was not properly forwarded.

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170609142156[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
7 years agotarget/s390x: correctly indicate PER nullification
David Hildenbrand [Fri, 9 Jun 2017 14:21:55 +0000 (16:21 +0200)]
target/s390x: correctly indicate PER nullification

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170609142156[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20170613' into...
Peter Maydell [Tue, 13 Jun 2017 14:49:07 +0000 (15:49 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20170613' into staging

target-arm queue:
 * vITS: Support save/restore
 * timer/aspeed: Fix timer enablement when reload is not set
 * aspped: add temperature sensor device
 * timer.h: Provide better monotonic time on ARM hosts
 * exynos4210: various cleanups
 * exynos4210: support system poweroff

# gpg: Signature made Tue 13 Jun 2017 15:05:49 BST
# gpg:                using RSA key 0x3C2525ED14360CDE
# gpg: Good signature from "Peter Maydell <[email protected]>"
# gpg:                 aka "Peter Maydell <[email protected]>"
# gpg:                 aka "Peter Maydell <[email protected]>"
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20170613:
  hw/intc/arm_gicv3_its: Allow save/restore
  hw/intc/arm_gicv3_kvm: Implement pending table save
  hw/intc/arm_gicv3_its: Implement state save/restore
  kvm-all: Pass an error object to kvm_device_access
  timer/aspeed: fix timer enablement when a reload is not set
  aspeed: add a temp sensor device on I2C bus 3
  hw/misc: add a TMP42{1, 2, 3} device model
  timer.h: Provide better monotonic time
  hw/misc/exynos4210_pmu: Add support for system poweroff
  hw/intc/exynos4210_gic: Constify array of combiner interrupts
  hw/arm/exynos: Use type define instead of hard-coded a9mpcore_priv string
  hw/arm/exynos: Declare local variables in some order
  hw/arm/exynos: Move DRAM initialization next boards
  hw/timer/exynos4210_mct: Remove unused defines
  hw/timer/exynos4210_mct: Cleanup indentation and empty new lines
  hw/timer/exynos4210_mct: Fix checkpatch style errors
  hw/intc/exynos4210_gic: Use more meaningful name for local variable

Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/intc/arm_gicv3_its: Allow save/restore
Eric Auger [Tue, 13 Jun 2017 13:57:01 +0000 (14:57 +0100)]
hw/intc/arm_gicv3_its: Allow save/restore

We change the restoration priority of both the GICv3 and ITS. The
GICv3 must be restored before the ITS and the ITS needs to be restored
before PCIe devices since it translates their MSI transactions.

Signed-off-by: Eric Auger <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Message-id: 1497023553[email protected]
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/intc/arm_gicv3_kvm: Implement pending table save
Eric Auger [Tue, 13 Jun 2017 13:57:00 +0000 (14:57 +0100)]
hw/intc/arm_gicv3_kvm: Implement pending table save

This patch adds the flush of the LPI pending bits into the
redistributor pending tables. This happens on VM stop.

There is no explicit restore as the tables are implicitly sync'ed
on ITS table restore and on LPI enable at redistributor level.

Signed-off-by: Eric Auger <[email protected]>
Message-id: 1497023553[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/intc/arm_gicv3_its: Implement state save/restore
Eric Auger [Tue, 13 Jun 2017 13:57:00 +0000 (14:57 +0100)]
hw/intc/arm_gicv3_its: Implement state save/restore

We need to handle both registers and ITS tables. While
register handling is standard, ITS table handling is more
challenging since the kernel API is devised so that the
tables are flushed into guest RAM and not in vmstate buffers.

Flushing the ITS tables on device pre_save() is too late
since the guest RAM is already saved at this point.

Table flushing needs to happen when we are sure the vcpus
are stopped and before the last dirty page saving. The
right point is RUN_STATE_FINISH_MIGRATE but sometimes the
VM gets stopped before migration launch so let's simply
flush the tables each time the VM gets stopped.

For regular ITS registers we just can use vmstate pre_save()
and post_load() callbacks.

Signed-off-by: Eric Auger <[email protected]>
Message-id: 1497023553[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agokvm-all: Pass an error object to kvm_device_access
Eric Auger [Tue, 13 Jun 2017 13:57:00 +0000 (14:57 +0100)]
kvm-all: Pass an error object to kvm_device_access

In some circumstances, we don't want to abort if the
kvm_device_access fails. This will be the case during ITS
migration, in case the ITS table save/restore fails because
the guest did not program the vITS correctly. So let's pass an
error object to the function and return the ioctl value. New
callers will be able to make a decision upon this returned
value.

Existing callers pass &error_abort which will cause the
function to abort on failure.

Signed-off-by: Eric Auger <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Message-id: 1497023553[email protected]
[PMM: wrapped long line]
Signed-off-by: Peter Maydell <[email protected]>
7 years agotimer/aspeed: fix timer enablement when a reload is not set
Cédric Le Goater [Tue, 13 Jun 2017 13:57:00 +0000 (14:57 +0100)]
timer/aspeed: fix timer enablement when a reload is not set

When a timer is enabled before a reload value is set, the controller
waits for a reload value to be set before starting decrementing. This
fix tries to cover that case by changing the timer expiry only when
a reload value is valid.

Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Andrew Jeffery <[email protected]>
Message-id: 1496739312[email protected]
Signed-off-by: Peter Maydell <[email protected]>
7 years agoaspeed: add a temp sensor device on I2C bus 3
Cédric Le Goater [Tue, 13 Jun 2017 13:56:59 +0000 (14:56 +0100)]
aspeed: add a temp sensor device on I2C bus 3

Temperatures can be changed from the monitor with :

(qemu) qom-set /machine/unattached/device[2] temperature0 12000

Signed-off-by: Cédric Le Goater <[email protected]>
Message-id: 1496739230[email protected]
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
7 years agohw/misc: add a TMP42{1, 2, 3} device model
Cédric Le Goater [Tue, 13 Jun 2017 13:56:59 +0000 (14:56 +0100)]
hw/misc: add a TMP42{1, 2, 3} device model

Largely inspired by the TMP105 temperature sensor, here is a model for
the TMP42{1,2,3} temperature sensors.

Specs can be found here :

http://www.ti.com/lit/gpn/tmp421

Signed-off-by: Cédric Le Goater <[email protected]>
Message-id: 1496739230[email protected]
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
7 years agotimer.h: Provide better monotonic time
Pranith Kumar [Tue, 13 Jun 2017 13:56:59 +0000 (14:56 +0100)]
timer.h: Provide better monotonic time

Tested and confirmed that the stretch i386 debian qcow2 image on a
raspberry pi 2 works.

Fixes: LP#: 893208 <https://bugs.launchpad.net/qemu/+bug/893208/>
Signed-off-by: Pranith Kumar <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Message-id: 20170418191817[email protected]
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/misc/exynos4210_pmu: Add support for system poweroff
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:58 +0000 (14:56 +0100)]
hw/misc/exynos4210_pmu: Add support for system poweroff

On all Exynos-based boards, the system powers down itself by driving
PS_HOLD signal low - eight bit in PS_HOLD_CONTROL register of PMU.
Handle writing to respective PMU register to fix power off failure:

    reboot: Power down
    Unable to poweroff system
    shutdown: 31 output lines suppressed due to ratelimiting
    Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000

    CPU: 0 PID: 1 Comm: shutdown Not tainted 4.11.0-rc8 #846
    Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
    [<c031050c>] (unwind_backtrace) from [<c030ba6c>] (show_stack+0x10/0x14)
    [<c030ba6c>] (show_stack) from [<c05b2800>] (dump_stack+0x88/0x9c)
    [<c05b2800>] (dump_stack) from [<c03d3140>] (panic+0xdc/0x268)
    [<c03d3140>] (panic) from [<c0343614>] (do_exit+0xa90/0xab4)
    [<c0343614>] (do_exit) from [<c035f2dc>] (SyS_reboot+0x164/0x1d0)
    [<c035f2dc>] (SyS_reboot) from [<c0307c80>] (ret_fast_syscall+0x0/0x3c)

Additionally the initial value of PS_HOLD has to be changed because
recent Linux kernel (v4.12-rc1) uses regmap cache for this access.
When the register is kept at reset value, the kernel will not issue a
write to it.  Usually the bootloader sets the eight bit of PS_HOLD high
so mimic its existence here.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/intc/exynos4210_gic: Constify array of combiner interrupts
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:58 +0000 (14:56 +0100)]
hw/intc/exynos4210_gic: Constify array of combiner interrupts

The static array of interrupt combiner mappings is not modified so it
can be made const for code safeness.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/arm/exynos: Use type define instead of hard-coded a9mpcore_priv string
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:58 +0000 (14:56 +0100)]
hw/arm/exynos: Use type define instead of hard-coded a9mpcore_priv string

Use a define for a9mpcore_priv device type name instead of hard-coded
string.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/arm/exynos: Declare local variables in some order
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:57 +0000 (14:56 +0100)]
hw/arm/exynos: Declare local variables in some order

Bring some more readability by declaring local function variables: first
initialized ones and then the rest (with reversed-christmas-tree order).

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/arm/exynos: Move DRAM initialization next boards
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:57 +0000 (14:56 +0100)]
hw/arm/exynos: Move DRAM initialization next boards

Before QOM-ifying the Exynos4 SoC model, move the DRAM initialization
from exynos4210.c to exynos4_boards.c because DRAM is board specific,
not SoC.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/timer/exynos4210_mct: Remove unused defines
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:57 +0000 (14:56 +0100)]
hw/timer/exynos4210_mct: Remove unused defines

Remove defines not used anywhere.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/timer/exynos4210_mct: Cleanup indentation and empty new lines
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:57 +0000 (14:56 +0100)]
hw/timer/exynos4210_mct: Cleanup indentation and empty new lines

Statements under 'case' were in some places wrongly indented bringing
confusion and making the code less readable.  Remove also few unneeded
blank lines.  No functional changes.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/timer/exynos4210_mct: Fix checkpatch style errors
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:56 +0000 (14:56 +0100)]
hw/timer/exynos4210_mct: Fix checkpatch style errors

Fix checkpatch errors:
1. ERROR: spaces required around that '+' (ctx:VxV)
2. ERROR: spaces required around that '&' (ctx:VxV)

No functional changes.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/intc/exynos4210_gic: Use more meaningful name for local variable
Krzysztof Kozlowski [Tue, 13 Jun 2017 13:56:56 +0000 (14:56 +0100)]
hw/intc/exynos4210_gic: Use more meaningful name for local variable

There are to SysBusDevice variables in exynos4210_gic_realize()
function: one for the device itself and second for arm_gic device.  Add
a prefix "gic" to the second one so it will be easier to understand the
code.

While at it, put local uninitialized 'i' variable at the end, next to
other uninitialized ones.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Peter Maydell [Tue, 13 Jun 2017 13:40:17 +0000 (14:40 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging

# gpg: Signature made Tue 13 Jun 2017 14:35:25 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>"
# gpg:                 aka "Stefan Hajnoczi <[email protected]>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/tracing-pull-request:
  monitor: resurrect handle_qmp_command trace event
  monitor: add handle_hmp_command trace event

Signed-off-by: Peter Maydell <[email protected]>
7 years agomonitor: resurrect handle_qmp_command trace event
Stefan Hajnoczi [Mon, 5 Jun 2017 10:42:16 +0000 (11:42 +0100)]
monitor: resurrect handle_qmp_command trace event

Commit 104fc3027960dd2aa9d310936a6cb201c60e1088 ("qmp: Drop duplicated
QMP command object checks") removed the call to
trace_handle_qmp_command() while eliminating code duplication.

This patch brings the trace event back so QEMU-internal trace events can
be correlated with the QMP commands that caused them.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170605104216[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
7 years agomonitor: add handle_hmp_command trace event
Stefan Hajnoczi [Mon, 5 Jun 2017 10:42:15 +0000 (11:42 +0100)]
monitor: add handle_hmp_command trace event

It is often useful to correlate QEMU-internal events with monitor
commands that caused them.  Trace the full HMP command being executed.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170605104216[email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/juanquintela/tags/migration/20170613' into...
Peter Maydell [Tue, 13 Jun 2017 12:51:29 +0000 (13:51 +0100)]
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170613' into staging

migration/next for 20170613

# gpg: Signature made Tue 13 Jun 2017 10:01:45 BST
# gpg:                using RSA key 0xF487EF185872D723
# gpg: Good signature from "Juan Quintela <[email protected]>"
# gpg:                 aka "Juan Quintela <[email protected]>"
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* remotes/juanquintela/tags/migration/20170613:
  migration: Move migration.h to migration/
  migration: Move remaining exported functions to migration/misc.h
  migration: create global_state.c
  migration: ram_control_* are implemented in qemu_file
  migration: Commands are only used inside migration.c
  migration: Move constants to savevm.h
  migration: Move dump_vmsate_json_to_file() to misc.h
  migration: Split registration functions from vmstate.h
  migration: Move self_announce_delay() to misc.h
  migration: Remove MigrationState from migration_channel_incomming()
  ram: Now POSTCOPY_ACTIVE is the same that STATUS_ACTIVE
  ram: Print block stats also in the complete case
  migration: Don't try to set *errp directly
  migration: isolate return path on src

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging
Peter Maydell [Tue, 13 Jun 2017 11:55:47 +0000 (12:55 +0100)]
Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging

# gpg: Signature made Fri 09 Jun 2017 13:41:59 BST
# gpg:                using RSA key 0xBDBE7B27C0DE3057
# gpg: Good signature from "Jeffrey Cody <[email protected]>"
# gpg:                 aka "Jeffrey Cody <[email protected]>"
# gpg:                 aka "Jeffrey Cody <[email protected]>"
# Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057

* remotes/cody/tags/block-pull-request:
  block/gluster.c: Handle qdict_array_entries() failure

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170609' into staging
Peter Maydell [Tue, 13 Jun 2017 10:56:00 +0000 (11:56 +0100)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170609' into staging

ppc patch queue 2017-06-09

This batch contains more patches to rework the pseries machine hotplug
infrastructure, plus an assorted batch of bugfixes.

It contains a start on fixes to restore migration from older machine
types on older versions which was broken by some xics changes.  There
are still a few missing pieces here, though.

# gpg: Signature made Fri 09 Jun 2017 06:26:03 BST
# gpg:                using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <[email protected]>"
# gpg:                 aka "David Gibson (Red Hat) <[email protected]>"
# gpg:                 aka "David Gibson (ozlabs.org) <[email protected]>"
# gpg:                 aka "David Gibson (kernel.org) <[email protected]>"
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.10-20170609:
  Revert "spapr: fix memory hot-unplugging"
  xics: drop ICPStateClass::cpu_setup() handler
  xics: setup cpu at realize time
  xics: pass appropriate types to realize() handlers.
  xics: introduce macros for ICP/ICS link properties
  hw/cpu: core.c can be compiled as common object
  hw/ppc/spapr: Adjust firmware name for PCI bridges
  xics: add reset() handler to ICPStateClass
  pnv_core: drop reference on ICPState object during CPU realization
  spapr: Rework DRC name handling
  spapr: Fold spapr_phb_{add,remove}_pci_device() into their only callers
  spapr: Change DRC attach & detach methods to functions
  spapr: Clean up handling of DR-indicator
  spapr: Clean up RTAS set-indicator
  spapr: Don't misuse DR-indicator in spapr_recover_pending_dimm_state()
  spapr: Clean up DR entity sense handling
  pseries: Correct panic behaviour for pseries machine type
  spapr: fix memory leak in spapr_memory_pre_plug()
  target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok()
  target/ppc: pass const string to kvmppc_is_mem_backend_page_size_ok()

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Tue, 13 Jun 2017 10:14:06 +0000 (11:14 +0100)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc, pci, vhost: fixes

Some fixes all over the place.

Signed-off-by: Michael S. Tsirkin <[email protected]>
# gpg: Signature made Thu 08 Jun 2017 20:04:24 BST
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <[email protected]>"
# gpg:                 aka "Michael S. Tsirkin <[email protected]>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  hw/pcie: fix the generic pcie root port to support migration
  nvdimm acpi: fix region format interface code
  vhost-user-bridge: fix iov_restore_front() warning

Signed-off-by: Peter Maydell <[email protected]>
7 years agomigration: Move migration.h to migration/
Juan Quintela [Mon, 24 Apr 2017 18:07:27 +0000 (20:07 +0200)]
migration: Move migration.h to migration/

Nothing uses it outside of migration.h

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agomigration: Move remaining exported functions to migration/misc.h
Juan Quintela [Mon, 24 Apr 2017 17:02:44 +0000 (19:02 +0200)]
migration: Move remaining exported functions to migration/misc.h

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
7 years agomigration: create global_state.c
Juan Quintela [Mon, 24 Apr 2017 16:53:30 +0000 (18:53 +0200)]
migration: create global_state.c

It don't belong anywhere else, just the global state where everybody
can stick other things.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agomigration: ram_control_* are implemented in qemu_file
Juan Quintela [Mon, 24 Apr 2017 16:24:28 +0000 (18:24 +0200)]
migration: ram_control_* are implemented in qemu_file

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agomigration: Commands are only used inside migration.c
Juan Quintela [Mon, 24 Apr 2017 15:37:14 +0000 (17:37 +0200)]
migration: Commands are only used inside migration.c

So, move them there.  Notice that we export functions that send
commands, not the command themselves.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agomigration: Move constants to savevm.h
Juan Quintela [Mon, 24 Apr 2017 15:36:46 +0000 (17:36 +0200)]
migration: Move constants to savevm.h

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agomigration: Move dump_vmsate_json_to_file() to misc.h
Juan Quintela [Mon, 24 Apr 2017 11:51:10 +0000 (13:51 +0200)]
migration: Move dump_vmsate_json_to_file() to misc.h

It was not from vmstate.c to start with.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agomigration: Split registration functions from vmstate.h
Juan Quintela [Mon, 24 Apr 2017 11:42:55 +0000 (13:42 +0200)]
migration: Split registration functions from vmstate.h

They are indpendent, and nowadays almost every device register things
with qdev->vmsd.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
7 years agomigration: Move self_announce_delay() to misc.h
Juan Quintela [Fri, 21 Apr 2017 15:39:30 +0000 (17:39 +0200)]
migration: Move self_announce_delay() to misc.h

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agomigration: Remove MigrationState from migration_channel_incomming()
Juan Quintela [Mon, 17 Apr 2017 15:15:02 +0000 (17:15 +0200)]
migration: Remove MigrationState from migration_channel_incomming()

All callers were calling migrate_get_current(), so do it inside the function.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agoram: Now POSTCOPY_ACTIVE is the same that STATUS_ACTIVE
Juan Quintela [Tue, 6 Jun 2017 17:21:29 +0000 (19:21 +0200)]
ram: Now POSTCOPY_ACTIVE is the same that STATUS_ACTIVE

Merge them.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
7 years agoram: Print block stats also in the complete case
Juan Quintela [Thu, 4 May 2017 08:21:46 +0000 (10:21 +0200)]
ram: Print block stats also in the complete case

Once there, create populate_disk_info.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
--

- create populate_disk_info instead of "abusing" populate_ram_info

7 years agomigration: Don't try to set *errp directly
Eduardo Habkost [Thu, 8 Jun 2017 13:39:05 +0000 (10:39 -0300)]
migration: Don't try to set *errp directly

Assigning directly to *errp is not valid, as errp may be NULL,
&error_fatal, or &error_abort.  Use error_propagate() instead.

Cc: Juan Quintela <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
7 years agomigration: isolate return path on src
Peter Xu [Wed, 31 May 2017 10:35:34 +0000 (18:35 +0800)]
migration: isolate return path on src

There are some places that binded "return path" with postcopy. Let's be
prepared for its usage even without postcopy. This patch mainly did this
on source side.

Signed-off-by: Peter Xu <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/borntraeger/tags/s390x-20170608' into staging
Peter Maydell [Tue, 13 Jun 2017 08:27:17 +0000 (09:27 +0100)]
Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20170608' into staging

s390x: misc fixes

bunch of fixes
- reject MIDA accesses for CCWs
- cpumodel fixes
- cross-build fix for bios
- migration improvements

# gpg: Signature made Thu 08 Jun 2017 14:10:29 BST
# gpg:                using RSA key 0x117BBC80B5A61C7C
# gpg: Good signature from "Christian Borntraeger (IBM) <[email protected]>"
# Primary key fingerprint: F922 9381 A334 08F9 DBAB  FBCA 117B BC80 B5A6 1C7C

* remotes/borntraeger/tags/s390x-20170608:
  s390x/cpumodel: improve defintion search without an IBC
  s390x/cpumodel: take care of the cpuid format bit for KVM
  pc-bios/s390-ccw: use STRIP variable in Makefile
  s390x/css: fence off MIDA
  s390x/css: catch section mismatch on load

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/elmarco/tags/char-pull-request' into staging
Peter Maydell [Mon, 12 Jun 2017 18:26:49 +0000 (19:26 +0100)]
Merge remote-tracking branch 'remotes/elmarco/tags/char-pull-request' into staging

# gpg: Signature made Thu 08 Jun 2017 15:12:11 BST
# gpg:                using RSA key 0xDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <[email protected]>"
# gpg:                 aka "Marc-André Lureau <[email protected]>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/char-pull-request:
  test-char: start a /char/serial test
  chardev: don't use alias names in parse_compat()
  char: fix alias devices regression

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Peter Maydell [Mon, 12 Jun 2017 13:51:30 +0000 (14:51 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging

# gpg: Signature made Wed 07 Jun 2017 19:55:32 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>"
# gpg:                 aka "Stefan Hajnoczi <[email protected]>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/tracing-pull-request:
  simpletrace: Improve the error message if event is not declared

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Mon, 12 Jun 2017 13:14:42 +0000 (14:14 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

# gpg: Signature made Wed 07 Jun 2017 19:06:51 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>"
# gpg:                 aka "Stefan Hajnoczi <[email protected]>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  configure: split c and cxx extra flags
  coroutine-lock: do not touch coroutine after another one has been entered
  .gdbinit: load QEMU sub-commands when gdb starts
  coccinelle: fix typo in comment
  oslib: strip trailing '\n' from error_setg() string argument

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Mon, 12 Jun 2017 09:43:32 +0000 (10:43 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches

# gpg: Signature made Fri 09 Jun 2017 12:47:31 BST
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <[email protected]>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  block: fix external snapshot abort permission error
  block/qcow.c: Fix memory leak in qcow_create()
  qemu-iotests: Test automatic commit job cancel on hot unplug
  commit: Fix use after free in completion
  qemu-iotests: Block migration test
  migration/block: Clean up BBs in block_save_complete()
  migration: Inactivate images after .save_live_complete_precopy()
  block: Fix anonymous BBs in blk_root_inactivate()

Signed-off-by: Peter Maydell <[email protected]>
7 years agoblock/gluster.c: Handle qdict_array_entries() failure
Peter Maydell [Mon, 5 Jun 2017 17:01:38 +0000 (18:01 +0100)]
block/gluster.c: Handle qdict_array_entries() failure

In qemu_gluster_parse_json(), the call to qdict_array_entries()
could return a negative error code, which we were ignoring
because we assigned the result to an unsigned variable.
Fix this by using the 'int' type instead, which matches the
return type of qdict_array_entries() and also the type
we use for the loop enumeration variable 'i'.

(Spotted by Coverity, CID 1360960.)

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: 1496682098[email protected]
Signed-off-by: Jeff Cody <[email protected]>
7 years agoblock: fix external snapshot abort permission error
Jeff Cody [Wed, 7 Jun 2017 13:55:22 +0000 (09:55 -0400)]
block: fix external snapshot abort permission error

In external_snapshot_abort(), we try to undo what was done in
external_snapshot_prepare() calling bdrv_replace_node() to swap the
nodes back.  However, we receive a permissions error as writers are
blocked on the old node, which is now the new node backing file.

An easy fix (initially suggested by Kevin Wolf) is to call
bdrv_set_backing_hd() on the new node, to set the backing node to NULL.

Signed-off-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
7 years agoblock/qcow.c: Fix memory leak in qcow_create()
Peter Maydell [Mon, 5 Jun 2017 13:55:54 +0000 (14:55 +0100)]
block/qcow.c: Fix memory leak in qcow_create()

Coverity points out that the code path in qcow_create() for
the magic "fat:" backing file name leaks the memory used to
store the filename (CID 1307771). Free the memory before
we overwrite the pointer.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
7 years agoqemu-iotests: Test automatic commit job cancel on hot unplug
Kevin Wolf [Fri, 2 Jun 2017 21:10:10 +0000 (23:10 +0200)]
qemu-iotests: Test automatic commit job cancel on hot unplug

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: John Snow <[email protected]>
7 years agocommit: Fix use after free in completion
Kevin Wolf [Fri, 2 Jun 2017 21:04:55 +0000 (23:04 +0200)]
commit: Fix use after free in completion

The final bdrv_set_backing_hd() could be working on already freed nodes
because the commit job drops its references (through BlockBackends) to
both overlay_bs and top already a bit earlier.

One way to trigger the bug is hot unplugging a disk for which
blockdev_mark_auto_del() cancels the block job.

Fix this by taking BDS-level references while we're still using the
nodes.

Cc: [email protected]
Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: John Snow <[email protected]>
7 years agoqemu-iotests: Block migration test
Kevin Wolf [Tue, 23 May 2017 12:53:10 +0000 (14:53 +0200)]
qemu-iotests: Block migration test

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
7 years agomigration/block: Clean up BBs in block_save_complete()
Kevin Wolf [Mon, 22 May 2017 15:17:49 +0000 (17:17 +0200)]
migration/block: Clean up BBs in block_save_complete()

We need to release any block migrations BlockBackends on the source
before successfully completing the migration because otherwise
inactivating the images will fail (inactivation only tolerates device
BBs).

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
This page took 0.088881 seconds and 4 git commands to generate.