Commit Graph

38016 Commits

Author SHA1 Message Date
Fam Zheng
2034e324da virtio-scsi: Fix assert in virtio_scsi_push_event
Hotplugging a scsi-disk may trigger the assertion in qemu_sgl_concat.

    qemu-system-x86_64: qemu/hw/scsi/virtio-scsi.c:115: qemu_sgl_concat:
    Assertion `skip == 0' failed.

This is introduced by commit 55783a55 (virtio-scsi: work around bug in
old BIOSes) which didn't check out_num when accessing out_sg[0].iov_len
(the same to in sg). For virtio_scsi_push_event, looking into out_sg
doesn't make sense because 0 req_size is intended.

Cc: qemu-stable@nongnu.org
[Cc'ing qemu-stable because 55783a55 did it too]
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1426233354-525-1-git-send-email-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:07:27 +01:00
Paolo Bonzini
15564d85af build: pass .d file name to scripts/make_device_config.sh, fix makefile target
The .d file name must match exactly what is used in the SUBDIR_DEVICES_MAK_DEP
variable.  Instead of making assumptions in the make_device_config.sh script,
just pass it in.

Similarly, the makefile target may not match the output file name, because
Makefile uses a temporary file.  Instead of making assumptions on what the
Makefile does, emit the config-devices.mak file to stdout, and use the
passed-in destination as the makefile target

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:07:25 +01:00
Max Reitz
4adf4180f2 coroutine-io: Return -errno in case of error
In case qemu_co_sendv_recvv() fails without any data read, there is no
reason not to return the perfectly fine error number retrieved from
socket_error().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-16-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:07:21 +01:00
Max Reitz
0379f474dd nbd: Drop unexpected data for NBD_OPT_LIST
When requesting the list of exports, no data should be sent. If data is
sent, the NBD server should not just inform the client of the invalid
request, but also drop the data.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-22-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:07:16 +01:00
Max Reitz
48c7d80de8 nbd: Fix interpretation of the export flags
The export flags are a 16 bit value, so be16_to_cpu() has to be used to
interpret them correctly. This makes discard and flush actually work
for named NBD exports (they did not work before, because the client
always assumed them to be unsupported because of the bug fixed by this
patch).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-20-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:07:11 +01:00
Max Reitz
9c122adadb nbd: Fix nbd_receive_options()
The client flags are sent exactly once overall, not once per option.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-19-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:07:06 +01:00
Max Reitz
3f4726596d nbd: Set block size to BDRV_SECTOR_SIZE
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-13-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:07:01 +01:00
Max Reitz
ac97393dc7 nbd: Fix potential signed overflow issues
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-11-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:06:56 +01:00
Max Reitz
70d4739ef2 qemu-nbd: fork() can fail
It is very unlikely, but it is possible.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-10-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:06:54 +01:00
Max Reitz
98f44bbe70 nbd: Handle blk_getlength() failure
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-9-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:06:50 +01:00
Max Reitz
892f5a5270 nbd: Pass return value from nbd_handle_list()
While it does not make a difference in practice, nbd_receive_options()
generally returns -errno, so it should do that here as well; and the
easiest way to achieve this is by passing on the value returned by
nbd_handle_list().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-7-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:05:42 +01:00
Max Reitz
2b1f13b996 nbd: Fix nbd_establish_connection()'s return value
unix_connect_opts() and inet_connect_opts() do not necessarily set errno
(if at all); therefore, nbd_establish_connection() should not literally
return -errno on error.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-4-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:05:38 +01:00
Max Reitz
453b07b134 qemu-nbd: Detect unused partitions by system == 0
Unused partitions do not necessarily have a total sector count of 0
(although they should have), but they always do have the system field
set to 0, so use that for testing whether a partition is in use rather
than the sector count field alone.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-3-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:05:36 +01:00
Max Reitz
2b21233061 util/uri: Add overflow check to rfc3986_parse_port
And while at it, replace tabs by eight spaces in this function.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1424887718-10800-2-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:05:31 +01:00
Yik Fang
8b2f0abfd6 nbd: Fix overflow return value
The value of reply.error should be the type unsigned int.

Signed-off-by: Yik Fang <eric.fangyi@huawei.com>
Message-Id: <1423722111-12902-1-git-send-email-eric.fangyi@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-18 12:02:37 +01:00
Peter Maydell
cd232acfa0 Update version for v2.3.0-rc0 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-17 18:58:33 +00:00
Peter Maydell
d8e33fc980 migration/next for 20150317
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJVCDhaAAoJEPSH7xhYctcjCmUP/2OdZOznik2BwE+RXYjj+TGn
 YFaN7G7kwCmbxjrbZgq89QW+lmqUlf5K8L6t4v8oOt4NDGslgKiibYJRekRIbWKm
 G2xiThCQJFLX+62EJ90nSjAERAGvMF5m/w80nUsXba7f5Ryx19qz/fOqrBcipo5w
 y9pcJ1kGw/bPXB8Enedb6veREgHOOZHAirTVzsRoy7OD0kQsTYIxsjXlk0cYO7FK
 vcmMr/E3ahzMge8XdLFYHVaMDCf8DTNjLPl0ZeuQt+IS6PP5uEPTQ8hVllT0FeSr
 SzCXOrWU2GJB9SbSK6S0sg1DzZIc6+eXYV2djDKdj4AjHRvVuZ+L9L5OErNh3zsE
 RY7ArWQpkrCfCB9xGT0Iud/cKbgiF23V6+Zy6lrzruoQcvw7Dtj90CwXdLEFsTP3
 O0XMpkDCXnNjsuexj9DmyXcMs/1EJHUeYentoo3dj7YP2Dlxd2Zz5PEkE4BoYFa9
 n7dOpW/Gf+53Axx7ob0+aWcRUAskAc2FTuc4G16YTmMsnx3Jxpn7fwDcZKinHBtE
 WvgrEc9CCT+7tniXL9biRaETN1sr2fN5ZLgol2JymmXNvrXJNGiwQNUI3wWI/X4P
 atJcXLfUmR7yTBG5FM6kzl8jSV78MuKqSnxO02eF3GRW90lV4w/jc873W6gbv5Qj
 hAZtEkRB+5dgCl7iCAXk
 =baFB
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20150317' into staging

migration/next for 20150317

# gpg: Signature made Tue Mar 17 14:21:14 2015 GMT using RSA key ID 5872D723
# gpg: Can't check signature: public key not found

* remotes/juanquintela/tags/migration/20150317:
  migration: Expose 'cancelling' status to user
  migration: Convert 'status' of MigrationInfo to use an enum type
  hmp: Rename 'MigrationStatus' to 'HMPMigrationStatus'
  migration: Rename abbreviated macro MIG_STATE_* to MIGRATION_STATUS_*
  migration: Remove unused functions
  arch_init: Count the total number of pages by using helper function
  migrate_incoming: Cleanup/clarify error messages
  Warn against the use of the string as uri parameter to migrate-incoming
  migrate_incoming: use hmp_handle_error
  migration: Fix remaining 32 bit compiler errors
  migration: Fix some 32 bit compiler errors
  migration/rdma: clean up qemu_rdma_dest_init a bit
  migration: Avoid qerror_report_err() outside QMP command handlers

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-17 17:11:33 +00:00
Peter Maydell
ac738eadc4 QOM CPUState and X86CPU
* QTest for PC X86CPU
 * Confinement of ICC bridge X86CPU parenting to PC code
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJVCEbzAAoJEPou0S0+fgE/0CQQAK7LPJgLXD7tvbD7nhX+E+Vl
 8OeawRKag367b1yqHGgdAd4JxTSSFDzjqif67OYAG5xRuA53tZ6BdccWlnLUYYbW
 +v2931HR+E4KztVHato7qdq0lVmbv9N9kg44KQPPuX8cNvJIliT/ap3SKc9btSp3
 I10QtM41+KqzJYa6TBzkpij12AbzOD153STrdmiasIIQc4SMKuAZRA/A14fLazj9
 iraIRLQQ1gvKPuL/4eCGN65sxXHq93ga0LeU2L2slPxm8jJ1BzgzFTDJtcXSG4Sj
 CQCmDCAn8BFoom3HP5REg6u0p/d1+UbBCl9S/YjUiA5lDSrJh+8xSZ4zcwAGHcXQ
 LzRKxZ18TJnpg4qcohikl43NkDmCKpqbj1T5QRrFlUp5pcia7tqlREwOTJTu8YpX
 gMvdMrshJ0nM2BrdTXpkeQRP4hTKJ4pbaT15FIbxAFAqwihHW07pYU1mE0enmFb+
 cA4yJTT4D4qwUFGm3OJEk/jsQmEpAoD7lz2MSjBVZiX1Crprs7ETGKalVDxDYBga
 CaTxJp5nZhgwEbgmKx5/AxnohMVEs40+sXieNHkFhOZ8DOJ+/kAClBmqHakR8ENg
 G6B1/gN3Gr5fSTEdppXAbvDe7g8qpC9gWkV7kwFie/MykrmDWDnivvVKxt9PlRgC
 DUhHfcNCISWNvaBZWc31
 =fe5i
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/afaerber/tags/qom-cpu-for-peter' into staging

QOM CPUState and X86CPU

* QTest for PC X86CPU
* Confinement of ICC bridge X86CPU parenting to PC code

# gpg: Signature made Tue Mar 17 15:23:31 2015 GMT using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg:                 aka "Andreas Färber <afaerber@suse.com>"

* remotes/afaerber/tags/qom-cpu-for-peter:
  target-i386: Remove icc_bridge parameter from cpu_x86_create()
  tests: Add PC CPU test
  pc: Suppress APIC ID compatibility warning for QTest

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-17 16:19:13 +00:00
Peter Maydell
1a87e52770 QOM infrastructure fixes and device conversions
* Conversion of cadence_uart to QOM realize
 * qom-tree QMP script
 * qom-list and qom-set HMP commands to match their QMP counterparts
 * Basic qom-tree HMP command
 * Cleanups for /machine QOM composition tree
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJVCEIhAAoJEPou0S0+fgE/pswP/jJBPRXpE70MNpRr34Q3SloS
 ILmFbRGeodVvb/QgJq8p3xjBH56K9A0Pxz6yGYv0K57qU+mjogAN50zmGGa+pAQ8
 1hkV158aGQQVinOb6ILq9BObHXiqgKXqyLboIBORU+IgtmluVYSKyCP3MQtwOvKn
 L5DXETAj4NVPvaHChxQkZnQasWo5+BreC84nq9BCnBZPr9OGpI5zscrkafBY5TLl
 2OW35mSID2gu60aULWOLT7FYnkUJB8xqBoBdP+NhYRDSlmkNIofyKoypv0e4bNtL
 Sfmj3oMjxLfoShZLUaQRjxLyzhMUawf45RBJhlOGTlCkRn64K7H3HsI5LA2j3XNb
 XgJacvxX0SUr+Wj6w19nwaR1absI+BCPnF2k0dvFR6SsCu+p0S9DjIYq2BT2bR+x
 rl0akkdrRALADPDDhdYTOKzfHSzezWJMyLgcur/ytuRezruVSY4Dzsp8MWvWCM57
 ytZIuz9Jiu9+c2pY4IKvT6mOy/Zk3+ZQaczjzbGXXp+ZsM0UUW0P1aBIib8zsT22
 5Wvc3olt+she4fH6G/6nsWJEebXOr6tCTK5JDiTher8FIRskGgqniDRsIkCU88ml
 L432FvroRQDT9JnDrNvrw1dg95Gt2r+mTL6AVUSYUaxusRoU7rUHIBqOTl77+nFa
 8gL4dtjQLN4sP5tuSESK
 =o/sw
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging

QOM infrastructure fixes and device conversions

* Conversion of cadence_uart to QOM realize
* qom-tree QMP script
* qom-list and qom-set HMP commands to match their QMP counterparts
* Basic qom-tree HMP command
* Cleanups for /machine QOM composition tree

# gpg: Signature made Tue Mar 17 15:02:57 2015 GMT using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg:                 aka "Andreas Färber <afaerber@suse.com>"

* remotes/afaerber/tags/qom-devices-for-peter:
  qdev: Move owner-less IRQs to /machine/unattached
  memory: Move owner-less MemoryRegions to /machine/unattached
  qom: Implement info qom-tree HMP command
  qom: Implement qom-set HMP command
  qom: Implement qom-list HMP command
  scripts: Add qom-tree script
  cadence_uart: Convert to QOM realize()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-17 15:23:23 +00:00
zhanghailiang
cde63fbed8 migration: Expose 'cancelling' status to user
'cancelling' status was introduced by commit 51cf4c1a, mainly to avoid a
possible start of a new migration process while the previous one still exists.
But we didn't expose this status to user, instead we returned the 'active' state.

Here, we expose it to the user (such as libvirt), 'cancelling' status only
occurs for a short window before the migration aborts, so for users,
if they cancel a migration process, it will observe 'cancelling' status
occasionally.

Testing revealed that with older libvirt (anything 1.2.13 or less) will
print an odd error message if the state is seen, but that the migration
is still properly cancelled. Newer libvirt will be patched to recognize
the new state without the odd error message.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Cc: libvir-list@redhat.com
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
zhanghailiang
24b8c39b5c migration: Convert 'status' of MigrationInfo to use an enum type
The original 'status' is an open-coded 'str' type, convert it to use an
enum type.
This conversion is backwards compatible, better documented and
more convenient for future extensibility.

In addition, Fix a typo for qapi-schema.json (just remove the typo) :
s/'completed'. 'comppleted' (since 1.2)/'completed' (since 1.2)

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
zhanghailiang
e49f35bdb4 hmp: Rename 'MigrationStatus' to 'HMPMigrationStatus'
We will use the typename 'MigrationStatus' for publicly exported typename,
So here we rename the internal-only 'MigrationStatus' to
'HMPMigrationStatus'.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
zhanghailiang
3119473166 migration: Rename abbreviated macro MIG_STATE_* to MIGRATION_STATUS_*
Rename all macro MIG_STATE_* to  MIGRATION_STATUS_* except "MIG_STATE_ERROR",
we rename it to "MIGRATION_STATUS_FAILED" which will match the migration status
string 'failed'.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Thomas Huth
21cb4924f7 migration: Remove unused functions
migrate_rdma_pin_all() and qsb_clone() are completely unused and thus
can be deleted.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Juan Quintela <quintela@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
zhanghailiang
f54a235f9b arch_init: Count the total number of pages by using helper function
There is already a helper function ram_bytes_total(), we can use it to
help counting the total number of pages used by ram blocks.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Dr. David Alan Gilbert
4debb5f553 migrate_incoming: Cleanup/clarify error messages
Create a separate error for the case where migrate_incoming is
used after a succesful migrate_incoming.

Reword the error in the case where '-incoming defer' is missing
to omit the command name so it's right for both hmp and qmp.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Dr. David Alan Gilbert
d876053478 Warn against the use of the string as uri parameter to migrate-incoming
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Dr. David Alan Gilbert
1fa57f5543 migrate_incoming: use hmp_handle_error
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Stefan Weil
fbce8c25d8 migration: Fix remaining 32 bit compiler errors
Fix type casts between pointers and 64 bit integers.
Now 32 bit builds are possible again.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Stefan Weil
3ac040c0ef migration: Fix some 32 bit compiler errors
The current code won't compile on 32 bit hosts because there are lots
of type casts between pointers and 64 bit integers.

Fix some of them.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Michael Tokarev
1dbd2fd9cb migration/rdma: clean up qemu_rdma_dest_init a bit
Do not check for rdma->host being empty twice.  This removes a large
"if" block, so code indentation is changed.  While at it, remove an
ugly goto from the loop, replacing it with a cleaner if logic.  And
finally, there's no need to initialize `ret' variable since is always
has a value.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Tested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

--

fixed space detected by Dave
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Markus Armbruster
97baf9d9f7 migration: Avoid qerror_report_err() outside QMP command handlers
qerror_report_err() is a transitional interface to help with
converting existing monitor commands to QMP.  It should not be used
elsewhere.  Replace by error_report_err() in
process_incoming_migration_co().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-03-17 15:20:37 +01:00
Eduardo Habkost
e1570d0005 target-i386: Remove icc_bridge parameter from cpu_x86_create()
Instead of passing icc_bridge from the PC initialization code to
cpu_x86_create(), make the PC initialization code attach the CPU to
icc_bridge.

The only difference here is that icc_bridge attachment will now be done
after x86_cpu_parse_featurestr() is called. But this shouldn't make any
difference, as property setters shouldn't depend on icc_bridge.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:51:49 +01:00
Andreas Färber
7fe55c3cba tests: Add PC CPU test
Test non-default -smp core and thread counts and a non-default CPU model
on all PC machines except for isapc. Note that not all historic versions
actually supported this particular configuration, ignored for simplicity.

For machines pc-*-1.5+ test QMP cpu-add with monotonically increasing ID,
and test for graceful failure otherwise.

Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:50:44 +01:00
Andreas Färber
b1c12027f8 pc: Suppress APIC ID compatibility warning for QTest
This avoids cluttering GTester output with irrelevant warnings.

Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:50:44 +01:00
Andreas Färber
88950eeff5 qdev: Move owner-less IRQs to /machine/unattached
Move non-qdev-gpio[*] from /machine into /machine/unattached.
For the PC this moves 25 nodes from the stable namespace into the unstable.

Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:31:32 +01:00
Andreas Färber
210eb9364b memory: Move owner-less MemoryRegions to /machine/unattached
This cleans up the official /machine namespace. In particular
/machine/system[0] and /machine/io[0], as well as entries with
non-sanitized node names such as "/machine/qemu extended regs[0]".

The actual MemoryRegion names remain unchanged.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:31:26 +01:00
Andreas Färber
a01ff75fcd qom: Implement info qom-tree HMP command
To complement qdev's bus-oriented info qtree, info qom-tree
prints a hierarchical view of the QOM composition tree.

By default, the machine composition tree is shown. This can be overriden
by supplying a path argument, such as "info qom-tree /".

Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:31:21 +01:00
Andreas Färber
c0e6ee9e6f qom: Implement qom-set HMP command
Re-implemented based on qmp_qom_set() to facilitate argument parsing.

Warn about ambiguous path arguments.

Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:31:15 +01:00
Andreas Färber
89d7fa9eb4 qom: Implement qom-list HMP command
Implement it as a wrapper for QMP qom-list, but mimic the behavior of
scripts/qmp/qom-list in making the path argument optional and listing
the root if absent, to hint users what kind of path to pass.

Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:31:10 +01:00
Andreas Färber
eb60aa5737 scripts: Add qom-tree script
Functionally it is a recursive qom-list with qom-get per non-child<>
property. Some failures needed to be handled, such as trying to read a
pointer property, which is not representable in QMP. Those print a
literal "<EXCEPTION>".

Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:30:48 +01:00
Alistair Francis
96f209264f cadence_uart: Convert to QOM realize()
Use DeviceClass::realize() and TypeInfo::instance_init() instead of
the deprecated SysBusDevice::init().

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-03-17 14:06:36 +01:00
Peter Maydell
5a4992834d coverity: Fix g_malloc_n-like models
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVB/9UAAoJEDhwtADrkYZTI8kP/Az1xs69cnMh1cZP/ug4TBC3
 OEPPPdcSJqPaJwxW6PGhEKW2X1RuwVXluVF6jnMcXzLil6QRbnIOE0iG7YjN5q5c
 AwDuZHbj3UjkFXmSPKsp/f1/GFkMaE6FmZkkhWucAJkb6lkW3SORUA/e1T7gpSUx
 FbAxXL9L2A0+JP3QihDms4ck+sIsZ5GU6GgWKztcQYib93zlIfqn6dCejS3IbJHe
 satPgzyr9B7JE12BOXhj4LFQpcF0mCJ6+eCDHiFA6XIdH+2SsBlj5rcjZPl757nd
 R7SqPFXsaVU2CBEo5VLbI4r0axHqS0Wz0KG7x83LJCu1KlpeqCWllbPJl3tB3EQh
 QKJuYl6yKAPm6J9vvkoBp/QJu3OZf+fUVNKjoSrThBZLhypx1YkXUaUO209krhTl
 wKyEac/JSPQNm2TKdKtboYvvb86VU1r+V+5uWXqQ6hyPcymu4WQiNUSxnS45lVsN
 7BOiCHb7Gc1YnYBKx9q3S9FJwMbbLhCsuiejLaRTDT8ZtSqSITDODG7Tlf4bdCKC
 wgz4tCs0vqNl2K+tI0JYSzcMuHyUZINPlLDfiMrXJY6HYDzz67SRayIUjIBL2eBj
 pQ1eG0f/dM4l/ZYbTrO8Ts7Uz3/socvx9FJ7QpYq/sGW5HQgHZ0e05jERn6PhwQf
 HW+6EwhUUluIL5z7qxUs
 =+0u5
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-cov-model-2015-03-17' into staging

coverity: Fix g_malloc_n-like models

# gpg: Signature made Tue Mar 17 10:17:56 2015 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-cov-model-2015-03-17:
  coverity: Fix g_malloc_n-like models

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-17 11:43:00 +00:00
Peter Maydell
494a864e05 opengl: fix configure test
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJVB/3MAAoJEEy22O7T6HE48kAQAL1ZjnCQhd8cxPoHbwO5w+P+
 TW5hBGsScx8CPuxfJym8dR2w8VsrU68dLc8j7G4djX38cSzajlGm2yycNykkjiQ9
 m2lZ7URKMvjT9bNcdpHe3cETqg+OGgIP9XxCP+5ogCfBCl37PhEU2BqaGYpgr3vA
 z60NTgWQivNZkWXDfrgvSVtXPINxxbtxMFCYVr7rF+mTksthyE1XaqYfLbC4l6/n
 vHawU29jntJCdTLtPevmGWCX0Xc2dMwwLfNf1lPM4MbWVB4kzAODKn3Xh7hjoDSg
 +Hg4UCr/a16r0wIWx4o+fwRTYbAD3CgkeH9O1otuOieEY+BwPsxQ3xS6FzsKmWnz
 HikWRUrh1Wpk95ksEVce4abeAS2xZlOxBhRyJHPx2nE9e+5prAGwqPCZ/eBkbvaA
 LI8guxVRm6N3JBVSxYLqUa0ooD+cqUcO3Os372s9K8p9XmqHjl86jxhX984i7H2U
 PQY+8f1wV3f5mUySLz51tcHc9Di5NpbH0eefOuNFN+xKDGqU18lEj115uANU4DSY
 ZZyteG1z52RIc2SVTHHsMOrS9IpEQ0+TzlJXd+8mW8J8I744jk+r+AnUY9o0cwTa
 /HztcYFqkn9quPMJ6nXFNQS82JhNQlc0w2uus+FtV8dN6Yq/UDFK4k9eJdQb2D6I
 wf/qa+qJqYfYuwWq+RQE
 =h4VK
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-gl-20150317-1' into staging

opengl: fix configure test

# gpg: Signature made Tue Mar 17 10:11:24 2015 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-gl-20150317-1:
  opengl: fix configure test

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-17 10:26:09 +00:00
Gerd Hoffmann
b1546f3210 opengl: fix configure test
Re-add the glx compile test to configure.  We can't use pkg-config to
probe for glx, and as long as milkymist-tmu2 privately uses glx (due to
opengl infrastructure in qemu not being ready yet) we must continue to
test for glx to avoid build failures.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
2015-03-17 11:10:48 +01:00
Jan Kiszka
906b8bab8b coverity: Fix g_malloc_n-like models
Allocate the calculated overall size, not only the size of a single
element.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2015-03-17 09:29:39 +01:00
Peter Maydell
3521f76706 Block patches for 2.3-rc0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJVBwDLAAoJEH8JsnLIjy/WPRwP/A8mF/yaGnSIs1zKYzikWiPg
 CPoIcWZnU27Uc2fa0jW7vFh7mnrQ1+fgzQx4MJ/zxuDGI63Nr7QnkDSQqNDsKlFb
 bQjH5NNFYlqLqsTNqMEc7bV1NnUUqC3932oqgzcAcVeh1DphNU//Mu87bmTE+NVi
 ZHtnnasEN8eBWPsiLyphCqirQWO2mPRHAwYjEE0SwHEX+HEoV0Bx8GUJMmZ8J+oA
 4FXl1R3iZiqFGE4ExNFa+XKy/kXChRkLT7GWlCgB8ngRQ42OdLIz3vV/KMwnzndA
 luz0yywCYBkfDohAYZ0wAWSDsGYgSAG33/XOatIatQfdLE/MMm9Ab9EN4WO9oeVs
 XnYJAZzd5i7hCL4fH76jPHo4seMq6F/4Ou9bCmevMzjZc9o6I6qaUyIFgSY7zZqf
 j08soL3KqlnxwvZNh+kAjrRhoJNzjTOvsz4e5h9Y8b9McG0ObRR1uxKCFIMyHSJB
 hJs0bgZiFye4pn9FDFOC6dU4ShVOgL2AeuREdVUJpIUq5kBIjk6djCGvIRJky1Rx
 WujcLml5vzqcfYIqzRFmh1wZ6JEnpqU70r6g7O6yUOEJA3qJC+vkue+bxiXW4KAX
 uFDz2zCDwsNmbMOwfClDs1D9DPoyikElVOwovq92erDTIHTcOqThcbUS+SmIV/ps
 bO68612w4UJZKyXbndDT
 =XCJ5
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block patches for 2.3-rc0

# gpg: Signature made Mon Mar 16 16:11:55 2015 GMT using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream:
  block/vpc: remove disabled code from get_sector_offset
  block/vpc: rename footer->size -> footer->current_size
  block/vpc: make calculate_geometry spec conform
  vpc: Ignore geometry for large images
  block/vpc: optimize vpc_co_get_block_status
  block: Drop bdrv_find
  blockdev: Convert bdrv_find to blk_by_name
  migration: Convert bdrv_find to blk_by_name
  monitor: Convert bdrv_find to blk_by_name
  iotests: Test non-self-referential qcow2 refblocks
  iotests: Add tests for refcount table growth
  qcow2: Respect new_block in alloc_refcount_block()
  qemu-img: Avoid qerror_report_err() outside QMP handlers, again
  block: Fix block-set-write-threshold not to use funky error class
  block: Deprecate QCOW/QCOW2 encryption
  qemu-img: Fix convert, amend error messages for unknown options
  iotests: Update 051's reference output

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-16 19:19:04 +00:00
Peter Maydell
17b11a1406 TriCore RRR1, RRRR, RRRW, and SYS instructions
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCgAGBQJVBvzsAAoJEArSxjlracoU864QAMBAzk8SDV5Xxz5wF+iqfUUz
 ZgDXDjsInQIgfmKo+Fe6xdCcWMD3FEpEqJ0zjn2znr89vO10r7c/BByLwf0Z9/V4
 AoeCOntdtRXQfWxN+oVdxMxwbsQnGHXCzLyCzS/5tf4gweFcEM4yhRlOMoJeW879
 xPt+F785+MxkgvP1nR+/twx4XwzpdnhxXmiWMiTweTkGORhveELM7S0aiF8YbC69
 0GYy1ZPdJlZ8ozcLiorj1gE4ejZ0dhnpaOS1chAYRn6Zu5BwFNgGQeG9NLG5n9O9
 S8oePDj7tCde8eiKU0oS4mCppByg3iZ0590YHlFOLGKqKfLJJiYX2HDJAfHO2oL8
 qgsCxYjspgtkVVm3Kl3JQ2qOeJ+Ox4kzWLXXlYEt4TUdzB6423z0KRjtgUWUYMFU
 Mvc59+0kyhVeUuye6R05UtAPF1bbFUxHPTf+/ComSCmmrbbC7K3gmkxXOyiNNeej
 JktL71toAdEEEsE6XBtg8q1taDOySu/4oQMBzMNLpzSbOZw85o5eI5xv39VqbKWi
 jp3L5zQlwTE+fYa7/mvs9dXGsl7vJ5i3YkGPe/7DMe8xeRiideOK5X6PRxSBTn+H
 tA3sM6be3MRMeT9qmLJGrcy98U2gP/ZKBcNxI0LJs1FqnKCJcFZ7PEgaxcBW/9VV
 /AWKoh7/pdslOgQY+ZA7
 =HUhc
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bkoppelmann/tags/pull-tricore-20150316' into staging

TriCore RRR1, RRRR, RRRW, and SYS instructions

# gpg: Signature made Mon Mar 16 15:55:24 2015 GMT using RSA key ID 6B69CA14
# gpg: Good signature from "Bastian Koppelmann <kbastian@mail.uni-paderborn.de>"

* remotes/bkoppelmann/tags/pull-tricore-20150316:
  target-tricore: Add instructions of SYS opcode format
  target-tricore: Add instructions of RRRW opcode format
  target-tricore: Add instructions of RRRR opcode format
  target-tricore: Add instructions of RRR1 opcode format, which have 0xe3 as first opcode
  target-tricore: Add instructions of RRR1 opcode format, which have 0x63 as first opcode
  target-tricore: Add instructions of RRR1 opcode format, which have 0xa3 as first opcode

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-16 18:27:13 +00:00
Peter Maydell
9575234db1 tcg opt fix for or x,a,a
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVBvsHAAoJEK0ScMxN0CebtsoIANvZBGjO+dCF44jDe1e1tv6G
 6CPyrNW//uMVGHx0Q2KS7/JODnaId53znpe/0IAXS6SU9hR+X3lhk/5bCPe2v1f2
 Y02eMZuUGXvt3AWhVtrsqoNGWxueUYHpVfUtL/Y1XBFgh98sWBfeaBhwBvAvKt/B
 vIjG6cXzabcW4adCgZEQoHOa99Shu71hcvIUdPpi0jjuB/vh2ax05359cTbyKNkl
 6Ctu+vPyVFx84JvFzcbv4eIJ0ckfmVvv07S1nFhIR1rLuampfBa5NL7jd3lQrKkr
 2uHzq6RkTP/6rs9ggzf3nA59ZEPUKn//hBBE6g29QXtWN8guoE9e5721jc62Hdk=
 =7Jrr
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/rth/tags/tcg-pull-20150316' into staging

tcg opt fix for or x,a,a

# gpg: Signature made Mon Mar 16 15:47:19 2015 GMT using RSA key ID 4DD0279B
# gpg: Good signature from "Richard Henderson <rth7680@gmail.com>"
# gpg:                 aka "Richard Henderson <rth@redhat.com>"
# gpg:                 aka "Richard Henderson <rth@twiddle.net>"

* remotes/rth/tags/tcg-pull-20150316:
  tcg/optimize: Handle or r,a,a with constant a

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-16 17:22:33 +00:00
Kevin Wolf
47aced5078 Merge remote-tracking branch 'mreitz/block' into queue-block
* mreitz/block:
  block/vpc: remove disabled code from get_sector_offset
  block/vpc: rename footer->size -> footer->current_size
  block/vpc: make calculate_geometry spec conform
  vpc: Ignore geometry for large images
  block/vpc: optimize vpc_co_get_block_status
  block: Drop bdrv_find
  blockdev: Convert bdrv_find to blk_by_name
  migration: Convert bdrv_find to blk_by_name
  monitor: Convert bdrv_find to blk_by_name
  iotests: Test non-self-referential qcow2 refblocks
  iotests: Add tests for refcount table growth
  qcow2: Respect new_block in alloc_refcount_block()
2015-03-16 17:11:12 +01:00