Commit graph

42531 commits

Author SHA1 Message Date
Denis V. Lunev e9ff957ac2 snapshot: create helper to test that block drivers supports snapshots
The patch enforces proper locking for this operation.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
Tested-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-11-19 11:50:00 +01:00
Dr. David Alan Gilbert 5df5416e63 Unneeded NULL check
The check is unneccesary, we read the value at the start of the
thread, use it, and never change it.  The value is checked to be
non-NULL before thread creation.

Spotted by coverity, CID 1339211

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-11-19 11:49:53 +01:00
Dr. David Alan Gilbert 95a7788b2f migration: Dead assignment of current_time
I set current_time before the postcopy test but never use it;
(I think this was from the original version where it was time based).
Spotted by coverity, CID 1339208

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-11-19 11:49:53 +01:00
Dr. David Alan Gilbert 84e7b80a05 Set last_sent_block
In a82d593b61 I accidentally removed the setting of
last_sent_block,  put it back.

Symptoms:
  Multithreaded compression only uses one thread.
  Migration is a bit less efficient since it won't use 'cont' flags.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Fixes: a82d593b61
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-11-19 11:49:53 +01:00
Daniel P. Berrange 8c4d156c18 qom: Add a test case for complex property finalization
Devices have some quite complex object child/link relationships
which place some requirements on the object_property_del_all()
function to consider that properties can be modified while
being iterated over.

This extends the QOM property test case to replicate the
device like structure and expose any potential bugs in the
object_property_del_all() function.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:13:49 +01:00
Daniel P. Berrange 456fb0bfe0 net: Convert net filter code to use object property iterators
Stop directly accessing the Object::properties field data
structure and instead use the formal object property iterator
APIs. This insulates the code from future data structure
changes in the Object struct.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:13:49 +01:00
Daniel P. Berrange 9a842f7d3c ppc: Convert spapr code to use object property iterators
Stop directly accessing the Object::properties field data
structure and instead use the formal object property iterator
APIs. This insulates the code from future data structure
changes in the Object struct.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:13:49 +01:00
Daniel P. Berrange 2465bc564d vl: Convert machine help code to use object property iterators
Stop directly accessing the Object::properties field data
structure and instead use the formal object property iterator
APIs. This insulates the code from future data structure
changes in the Object struct.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:13:48 +01:00
Daniel P. Berrange 1b30c094dc qmp: Convert QMP code to use object property iterators
Stop directly accessing the Object::properties field data
structure and instead use the formal object property iterator
APIs. This insulates the code from future data structure
changes in the Object struct.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:13:48 +01:00
Daniel P. Berrange a00c948241 qom: Introduce ObjectPropertyIterator struct for iteration
Some users of QOM need to be able to iterate over properties
defined against an object instance. Currently they are just
directly using the QTAIL macros against the object properties
data structure.

This is bad because it exposes them to changes in the data
structure used to store properties, as well as changes in
functionality such as ability to register properties against
the class.

This provides an ObjectPropertyIterator struct which will
insulate the callers from the particular data structure
used to store properties. It can be used thus

  ObjectProperty *prop;
  ObjectPropertyIterator *iter;

  iter = object_property_iter_init(obj);
  while ((prop = object_property_iter_next(iter))) {
      ... do something with prop ...
  }
  object_property_iter_free(iter);

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Tested-by: Pavel Fedin <p.fedin@samsung.com>
[AF: Fixed examples, style cleanups]
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:13:38 +01:00
Ildar Isaev 3b6ca4022d qdev: Change Property::offset field to ptrdiff_t type
Property::offset field is calculated as a diff between two pointers:

  arrayprop->prop.offset = eltptr - (void *)dev;

If offset is declared as int, this subtraction can cause type overflow,
thus leading to failure of the subsequent assertion:

  assert(qdev_get_prop_ptr(dev, &arrayprop->prop) == eltptr);

So ptrdiff_t should be used instead.

Signed-off-by: Ildar Isaev <ild@inbox.ru>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2015-11-18 21:11:55 +01:00
Peter Maydell 8f28030903 Block layer patches
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWTJkgAAoJEH8JsnLIjy/Ws8sP/0eeTsbuaYcMbyh5/G7ORqAk
 l1IjEgpKs2d9+QwZACPOcb72m2S5mhXxEQ1LvMK3qNd+GhlTgDTD9Kxiyiqw3m+D
 5EBA/wcIJUyZFgTJmWfpURmHaw1JUAUGcli6ag1HxA7lKcUG+qgl7b2EE73UwfJ8
 zyCYT8PBUm4mUFua77LTNxwCjiU+lG1r0b8BzeOgaxwj4UaUgmZiq5X6t2luznBH
 H1NEmiRi0TUZbIeQaUCrgdqHFMoPmkXIWPdXMWHVEeiB/Q2eBsX2jrR4STseW39d
 FDrjTil3+1CoLuTW1dwHbEdvqcJN9GFc2bf+vLR797WURiENUvpIP8X1ijNtnMym
 Tv1DwuW4Vd8/MPwDIrswWF0iTPLGCfLLc6xBzUKecMxInS7JiyfrYgN1uVpI55Vw
 LdLzX2UtsCExsehZL+DnMG9p5XuEtvmodE2pkQ/nznwMIhvKUm2l3voPch8CeuSI
 SJ/RFgDwED3zPDcl55brS3TdkJfLUCbjeUEObEh6L9qtEtAXbwNh2BIMXk1ZodRT
 9CvMxZN4fr4g1a9SVVtf1yyrhptPZ3U1v2gyESbQLO192etqyo/g1OPFGze/NyFn
 uX4kOfarwl8LyWMh59nYt7WEhRPvkXEmIcT2Z6hJUQI8v6ghm9rjy5sL6JONa+uO
 44YdbaFXZqDoARv8Qu6H
 =4VZP
 -----END PGP SIGNATURE-----

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

Block layer patches

# gpg: Signature made Wed 18 Nov 2015 15:28:32 GMT using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream:
  block: Call external_snapshot_clean after blockdev-snapshot
  blockdev: Add missing bdrv_unref() in drive-backup
  iotests: fix race in 030
  nand: fix address overflow

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-18 17:07:24 +00:00
Michael S. Tsirkin 48854f57ce vhost-user: fix log size
commit 2b8819c6ee
("vhost-user: modify SET_LOG_BASE to pass mmap size and offset")
passes log size in units of 4 byte chunks instead of the
expected size in bytes.

Fix this up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-18 18:49:27 +02:00
Michael S. Tsirkin 72018d1e19 vhost-user: ignore qemu-only features
Some features (such as ctrl vq) are supported
by qemu without need to communicate with the
backend.

Drop them from the feature mask so we set them
unconditionally.

Reported-by: Victor Kaplansky <vkaplans@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-18 18:49:12 +02:00
Peter Maydell 7199c89d8c Pull qcrypto fixes 2015/11/18 v1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJWTJzHAAoJEL6G67QVEE/fB/AP/0KsXZRVD8oqhT+8lUjuCmUw
 EZvNOn4zG1xiQxmrls2fAoo/AzrjDt0MApxUljvfvI7z3hlmVGKv/i9d3vid15El
 5HmJTubNWEJ7pdFtd678J+3TMnXwageWEFUUEVttGTL59ztCiB7vnjWlLntMypyb
 vOxFgWnkBfp93NK8+5Cs5aCZcuRoCkt2okdcNFthjRNbQwiLaWzj/qWyw6CIycAb
 LNU3qma696392A+jAl3sIk4REXbUkdjp1j1cfuil+O7WJwzZHhXHkuEHttIqZlA/
 2TsevfWEkszF5V9NNQ9ScJHgHBRCdgABQ+GkWlDYgm1T6EN16fdVPYcfzMxd5jpB
 mbP+yvDxV7/eDufAuZcOQpzyyP4z3aC+rwPoPt69lZFwLdnap7HBVLYlOUwY+zHv
 DAret/W32u2iFbIOv7ET4tGh7ynBNIX5mbS9TK4mfQQwbrCXokiypxuymLzXEfOS
 3fit0F/sqaXBmetsr121OEhD0hrWwv8kHsBbcIgyNO5J05wwFwEN6L0zjIyizt/E
 w8aNA9cU8VksgLXrlUb9oZOuLzP+AN6RGHZUFwsY39QPY9aXipyHyKPc/q5oQ2lM
 tUVgfPCvaXNAG1Dh7tfQ8mCzvPkXogGKxAF676XrAto3qmx1eVQeUO1IEAChAEPN
 nXt4N5DeKrCVIqN/ZVGV
 =NS6A
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/berrange/tags/qcrypto-fixes-20151118-1' into staging

Pull qcrypto fixes 2015/11/18 v1

# gpg: Signature made Wed 18 Nov 2015 15:44:07 GMT using RSA key ID 15104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>"
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>"

* remotes/berrange/tags/qcrypto-fixes-20151118-1:
  crypto: avoid passing NULL to access() syscall
  crypto: fix leaks in TLS x509 helper functions
  crypto: fix mistaken setting of Error in success code path
  crypto: fix leak of gnutls_dh_params_t data on credential unload

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-18 16:27:15 +00:00
Daniel P. Berrange 08cb175a24 crypto: avoid passing NULL to access() syscall
The qcrypto_tls_creds_x509_sanity_check() checks whether
certs exist by calling access(). It is valid for this
method to be invoked with certfile==NULL though, since
for client credentials the cert is optional. This caused
it to call access(NULL), which happens to be harmless on
current Linux, but should none the less be avoided.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-18 15:42:26 +00:00
Kevin Wolf ca4fa82fe6 One block patch for qemu 2.5-rc1.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQEcBAABCAAGBQJWTJjDAAoJEDuxQgLoOKytLkwH/3s1eD2BVC57+ytjJRWJ/GpU
 BhX2arGIIHak+CN+O3UpgNcnoyeVGWwM+ClKgCpXd5X1dlFOR1nrhrZVLYPPF6XV
 uMYkMdV8b3Cm1FZzNPnVU9ex4M5MUoypTXC54w4hxL2olIVehS2iodzpOt4JccUT
 vHxZ94IeIet870lTliwRcsNGyxYk4tK8a4y0sKUkc432diA0ENAFKNDcdhFPNXWa
 x/azxb79ZJm09PAwq1ujXb355uxsq2SYa10T3FYWAHaZFeBocewvRKKuj8OsPLUN
 /hbI/DGrpRJfayxCR2uy7v0tXLRd/i4ydZkaxx7Zdag3SXgrMk799axtED9AJNc=
 =7GGL
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2015-11-18' into queue-block

One block patch for qemu 2.5-rc1.

# gpg: Signature made Wed Nov 18 16:26:59 2015 CET using RSA key ID E838ACAD
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>"

* mreitz/tags/pull-block-for-kevin-2015-11-18:
  block: Call external_snapshot_clean after blockdev-snapshot

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-18 16:27:44 +01:00
Alberto Garcia 4ad6f3db7d block: Call external_snapshot_clean after blockdev-snapshot
Otherwise the AioContext will never be released.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 1447419624-21918-1-git-send-email-berto@igalia.com
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-18 16:26:15 +01:00
Max Reitz 0702d3d88c blockdev: Add missing bdrv_unref() in drive-backup
All error paths after a successful bdrv_open() of target_bs should
contain a bdrv_unref(target_bs). This one did not yet, so add it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-18 16:05:56 +01:00
Daniel P. Berrange 7b35030eed crypto: fix leaks in TLS x509 helper functions
The test_tls_get_ipaddr() method forgot to free the returned data
from getaddrinfo().

The test_tls_write_cert_chain() method forgot to free the allocated
buffer holding the certificate data after writing it out to a file.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-18 14:56:58 +00:00
Daniel P. Berrange 6ef8cd7a41 crypto: fix mistaken setting of Error in success code path
The qcrypto_tls_session_check_certificate() method was setting
an Error even when the ACL check suceeded. This didn't affect
the callers detection of errors because they relied on the
function return status, but this did cause a memory leak since
the caller would not free an Error they did not expect to be
set.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-18 14:56:58 +00:00
Daniel P. Berrange 61b9251a3a crypto: fix leak of gnutls_dh_params_t data on credential unload
The QCryptoTLSCredsX509 object was not free'ing the allocated
gnutls_dh_params_t data when unloading the credentials

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-11-18 14:56:58 +00:00
John Snow 01809194a0 iotests: fix race in 030
the stop_test case tests that we can resume a block-stream
command after it has stopped/paused due to error. We cannot
always reliably query it before it finishes after resume, though,
so make this a conditional.

The important thing is that we are still testing that it has stopped,
and that it finishes successfully after we send a resume command.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-18 15:54:15 +01:00
Rabin Vincent a184e74f24 nand: fix address overflow
The shifts of the address mask and value shift beyond 32 bits when there
are 5 address cycles.

Cc: qemu-stable@nongnu.org
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-18 15:54:15 +01:00
Peter Maydell ab9b872ab3 qemu-ga patch queue for 2.5
* fixes for guest-exec gspawn() usage:
   - inherit default lookup path by default instead of
     explicitly defining it as being empty.
   - don't inherit default PATH when PATH/ENV are explicit
 
 v2:
 
 * added fix for w32 'make install' target
 * added version check for new g_spawn() flag
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWS6sfAAoJEDNTyc7xCLWETyAH/R0gd9nJVJt4EXT5vX+7mp/Q
 n+Uw056wT7TnnFhvCkdYniO45F4K5JCrNw1ocrYmWSKRAUBuuCEZTut2X5fJZjRd
 8FWnidA3KawewDatCIRArHtdcaX1vKt5KMOpEXGmKof+R5Sqdp4y8Pj+EpJTZDdi
 Nha9dZOgwq/8OedeVXyeEjaMWCIMQxH7nN1r3uf7KVWCJ3b4fdXy13Y3MU7ynvx6
 WQry1zW3Ll/5O6wEBfX+0PAZEGQKFc5xG+gmTeUssvfhu8S+lI4Y2zF+Ko9lEQyq
 /9318f41EFLl8/hsmzhAgaQ6JX5tfgPrqOtPSZKEo0gfbTm3bjRsScwcNorD2Sw=
 =+qcv
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2015-11-13-v2-tag' into staging

qemu-ga patch queue for 2.5

* fixes for guest-exec gspawn() usage:
  - inherit default lookup path by default instead of
    explicitly defining it as being empty.
  - don't inherit default PATH when PATH/ENV are explicit

v2:

* added fix for w32 'make install' target
* added version check for new g_spawn() flag

# gpg: Signature made Tue 17 Nov 2015 22:33:03 GMT using RSA key ID F108B584
# gpg: Good signature from "Michael Roth <flukshun@gmail.com>"
# gpg:                 aka "Michael Roth <mdroth@utexas.edu>"
# gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>"

* remotes/mdroth/tags/qga-pull-2015-11-13-v2-tag:
  makefile: fix w32 install target for qemu-ga
  qga: allow to lookup in PATH from the passed envp for guest-exec
  qga: fix for default env processing for guest-exec

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-18 12:47:29 +00:00
Peter Maydell 6b79f253a3 -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
 
 iQIcBAABAgAGBQJWS4jiAAoJEH3vgQaq/DkO3mUP/0IimHuqvBWLNEa0Ie6zmGko
 GkkjZWgDVfEvVQ23vQIAJAEbxfx3xvZprInQr9RBL8xkYXV8ny7MqtjW/oJPjX0S
 /Ctr8TvAnjnocqhYjdQFN8R/DT7Ws5bxmrWVj9hKiOFr/lLIfvCTWLcszipBdk8y
 MtVlkTtoP2FoIY13rDxiJCc0U622rQZL3Z0Oeo2iaz2ZmF01U8I1GeAp14R+ztC+
 AGxNqekg3r2pr+ohSzghg7H++aFm8sYbq1eWH0zs8UD5B4Hzj27Z+IS4VhYsusOl
 jfBt3YRATjdkBRakH8kcXl0AHK1qyqsgfdQVe8vVbf6/Q9NLAzRY7P2PB4o6MpZh
 W2DSiZ8HfDxHNWhFYaaQnT81Weu4zdlet9lhpyp/AfY0WB/SFqRMT5pw7GkHX5hs
 GrB3kJdchtRFUlWgfVW9GcwfcfLzjaHHT8nNbLhKZ86mK8J3D1wk/iFv57mQ3a7k
 1bwIA7AaVuquS+O9za5hRV8i2WRr6LDwjS9X1vzw+7oaIKkzycZxLAHKGdXMFBwn
 laFkACHstWB9E8k/eYSsVKnmqs6HN7fS50UPDo3o2UvxVlyPZ6uFpL1HBimCexA8
 XA/nRdkArQ7eoQN47Z9S/DNKBrPeXMNRrDQHIadBULP+j+rCgOKK/wM57B3L5U3w
 m1myR1sdjh3y1VwcyhTg
 =f1CW
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging

# gpg: Signature made Tue 17 Nov 2015 20:06:58 GMT using RSA key ID AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"

* remotes/jnsnow/tags/ide-pull-request:
  ide: enable buffered requests for PIO read requests
  ide: enable buffered requests for ATAPI devices
  ide: orphan all buffered requests on DMA cancel
  ide: add support for IDEBufferedRequest
  block: add blk_abort_aio_request
  ide/atapi: make PIO read requests async

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-18 12:16:14 +00:00
Michael Roth ab59e3ecb2 makefile: fix w32 install target for qemu-ga
fafcaf1 added a 'qemu-ga' install target on w32, which can be used
in place of the existing qemu-ga.exe target to also handle dealing
with other components such as DLLs for VSS/fsfreeze and generating
an MSI package if appropriate configure options are present.

As part of that, qemu-ga$(EXESUF) was removed from $TOOLS in favor
of this new qemu-ga target.

The install rule however relies on a direct mapping of the $TOOLS
entry to the actual resulting binary. In the case of w32, qemu-ga
is not identical to qemu-ga$(EXESUF), and the install recipe fails
to find the 'qemu-ga' binary.

Fix this by essentially remapping 'qemu-ga' back to 'qemu-ga.exe'
in the install recipe.

This raises the question of whether or not qemu-ga should continue
to live in TOOLS as opposed to its own special target, but as a
late fix for a regression in 2.5 this commit should be safer, since
we rely on qemu-ga's presence in $TOOLS in several places throughout
Makefile.

Reported-by: Stefan Weil <sw@weilnetz.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2015-11-17 16:32:27 -06:00
Yuri Pudgorodskiy 0be4083951 qga: allow to lookup in PATH from the passed envp for guest-exec
This was original behaviour before GLIB gspawn() rework and we rely on
this behaviour.

Signed-off-by: Yuri Pudgorodskiy <yur@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Michael Roth <mdroth@linux.vnet.ibm.com>
* add version check (2.33.2) for G_SPAWN_SEARCH_PATH_FROM_ENVP
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2015-11-17 16:24:18 -06:00
Yuri Pudgorodskiy 02a4d82e8c qga: fix for default env processing for guest-exec
envp == NULL must be passed inside gspawn() if it was not passed with
the command line. Original code inherits environment from the QGA,
which is wrong.

Signed-off-by: Yuri Pudgorodskiy <yur@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2015-11-17 16:24:18 -06:00
Peter Maydell 55db5eeeb7 X86 fixes, 2015-11-17
Two X86 fixes, hopefully in time for -rc1.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJWS3rNAAoJECgHk2+YTcWm34gP/2H2kzNYQMKOib7dXIarV+Sg
 8fAN+wyL2px5GUjTuwzfT81q2aaoTnHIwcKjrVUt6hy5KLPuwKc2ZlaR66Smu6LZ
 6RgPtaDE8NvUmaxOz+Vv9xic8X7YxpoqDJUIGc8apG0/nf+3ta0UY/kMg9zH9Zrb
 iYHtZlKfVyHwXZNGKs1k8RWLWaWKmAwHpreXpIJ6sxmKb8Q7ngRz+UdRTGkPEsoo
 Jyyt0X29J67Q9HtJKyaufjBl6XLo7tpfR2L8ups8Gi8+PEizBCNe4G1J+B8jEHqf
 wXM5elEjnLG5nwWh8mc5CTvi7OLmQz3TjY33aMlw1iuxol6VH2ApGgy6/XCBmFOO
 NhBsFwZqN/rCKsd+vRUt1BQzD/czFt/f2ln6AGm77skr9/QV07KIAZ8A7kos3l2q
 OKVYD0CpYtyKupEYWZrMqXYP9uHzG5TqqWsMqeFvmbIB2rijORnngCnkcMl6QNJi
 kViYDM5X15aeIQbB+al+rqwsB0NIkeLOrqJO1GYu4udhkYLLqVrCORWpWLWYaq1c
 iNBdEdlPjOSaipO8HKperZKSHrQKnOQmvOCvRtbpusNoHqnQZ8w6AhzsAv0S25kA
 0WKJBkNh386sfj5lcL8WSBiJgKhNBrCmbehr2HI0zMynnpHBFzM28GpRMUfAlzhk
 8gRURPaw0zDs6xLL7/dA
 =IkkR
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging

X86 fixes, 2015-11-17

Two X86 fixes, hopefully in time for -rc1.

# gpg: Signature made Tue 17 Nov 2015 19:06:53 GMT using RSA key ID 984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"

* remotes/ehabkost/tags/x86-pull-request:
  target-i386: Disable rdtscp on Opteron_G* CPU models
  target-i386: Fix mulx for identical target regs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-17 22:00:46 +00:00
Peter Lieven d66a8fa83b ide: enable buffered requests for PIO read requests
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1447345846-15624-7-git-send-email-pl@kamp.de
Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17 15:06:39 -05:00
Peter Lieven 02506b20b6 ide: enable buffered requests for ATAPI devices
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1447345846-15624-6-git-send-email-pl@kamp.de
Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17 15:06:33 -05:00
Peter Lieven 7cda62087c ide: orphan all buffered requests on DMA cancel
If the guests canceles a DMA request we can prematurely
invoke all callbacks of buffered requests and flag all them
as orphaned. Ideally this avoids the need for draining all
requests. For CDROM devices this works in 100% of all cases.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1447345846-15624-5-git-send-email-pl@kamp.de
Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17 15:06:29 -05:00
Peter Lieven 1d8c11d631 ide: add support for IDEBufferedRequest
this patch adds a new aio readv compatible function which copies
all data through a bounce buffer. These buffered requests can be
flagged as orphaned which means that their original callback has
already been invoked and the request has just not been completed
by the backend storage. The bounce buffer guarantees that guest
memory corruption is avoided when such a orphaned request is
completed by the backend at a later stage.

This trick only works for read requests as a write request completed
at a later stage might corrupt data as there is no way to control
if and what data has already been written to the storage.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1447345846-15624-4-git-send-email-pl@kamp.de
Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17 15:06:25 -05:00
Peter Lieven ca78ecfa72 block: add blk_abort_aio_request
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 1447345846-15624-3-git-send-email-pl@kamp.de
Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17 15:06:21 -05:00
Peter Lieven 5f81724d80 ide/atapi: make PIO read requests async
PIO read requests on the ATAPI interface used to be sync blk requests.
This has two significant drawbacks. First the main loop hangs util an
I/O request is completed and secondly if the I/O request does not
complete (e.g. due to an unresponsive storage) Qemu hangs completely.

Note: Due to possible race conditions requests during an ongoing
elementary transfer are still sync.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1447345846-15624-2-git-send-email-pl@kamp.de
Signed-off-by: John Snow <jsnow@redhat.com>
2015-11-17 15:06:15 -05:00
Eduardo Habkost 33b5e8c03a target-i386: Disable rdtscp on Opteron_G* CPU models
KVM can't virtualize rdtscp on AMD CPUs yet, so there's no point
in enabling it by default on AMD CPU models, as all we are
getting are confused users because of the "host doesn't support
requested feature" warnings.

Disable rdtscp on Opteron_G* models, but keep compatibility on
pc-*-2.4 and older (just in case there are people are doing funny
stuff using AMD CPU models on Intel hosts).

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-11-17 17:05:59 -02:00
Richard Henderson 9ecac5dad1 target-i386: Fix mulx for identical target regs
The Intel specification clearly indicates that the low part
of the result is written first and the high part of the result
is written second; thus if ModRM:reg and VEX.vvvv are identical,
the final result should be the high part of the result.

At present, TCG may either produce incorrect results or crash
with --enable-checking.

Reported-by: Toni Nedialkov <farmdve@gmail.com>
Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-11-17 17:05:59 -02:00
Michael S. Tsirkin 7ebcfe5692 specs/vhost-user: fix spec to match reality
We wanted to start/stop rings on VRING_ENABLE, but that is not what QEMU
does. Rather than tweaking code some more, with risk to stability, let's
just document it as it is.

We'll be  able to fix this in the future with a new protocol feature bit.

Reported-by: Victor Kaplansky <victork@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-17 15:41:13 +02:00
Victor Kaplansky 5c93c47338 tests/vhost-user-bridge: implement logging of dirty pages
During migration devices continue writing to the guest's memory.
The writes has to be reported to QEMU. This change implements
minimal support in vhost-user-bridge required for successful
migration of a guest with virtio-net device.

Signed-off-by: Victor Kaplansky <victork@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-17 15:41:13 +02:00
Bandan Das 8d211f622b i440fx: print an error message if user tries to enable iommu
There's no indication of any sort that i440fx doesn't support
"iommu=on"

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
2015-11-17 15:41:13 +02:00
Bandan Das 1f8431f42d q35: Check propery to determine if iommu is set
The helper function machine_iommu() isn't necesary. We can
directly check for the property.

Signed-off-by: Bandan Das <bsd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
2015-11-17 15:41:13 +02:00
Peter Maydell c27e9014d5 vnc: buffer code improvements, bugfixes.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJWShBCAAoJEEy22O7T6HE4/L4P/j2do44O18ni7OfloXQvCa5q
 xI21F/FqWZvpNVQnuhkFaBP8j9ggHIaKHJCMzQqSTs/ub+izKvsgFVWu5M9NAMPx
 OOhT20enigsBxP/WPrpjUknrMmjcnEXfYQfRhVREOZCkak95jfP8cLEAg1W81ehf
 /xS5TAJtGkxpxhQNpv94jXV5WdJmBYtKSUfUtHaEA2mgUeUrvUYlCQUUJrb23foG
 2LKGiv1GMqtNGHtl+uvBBc4XDdRrBR2iMgjjhj6IWniDCL2uxHojEN+Z23d1ldSK
 DXnNvoCVb5qzhSVVxJW34P0V2WJ8fClc0gvMWxtOvA4vLn/jnJw/Ig2MV1n4iQNu
 6vm3ZUUbz4f18eB63xy35AN4C63YgZ5xduGQ55HVMyMUtcyxkNv4SFA4NEY8Osj3
 Iy1TR+zXvdjH3d4K26J/s8/Lc1MVWlvGw6JzQn6gCF5x4ig8uKbA89S19skNw0Fe
 IXm5qHjUNNRwzG6/eGB1xpNz4O+yqGXfBAErsb0IbLBUdlweGLCZHvek2FCOUWiF
 7DY+dutFSW+nRjdOEKbRsHZL7ENB6vMzXFD3RH/EzWyvjveYl2yj2CshvHhBWxcx
 B4us35hQd7+KnkbcOQAcq5hxeXN9ZxLXjuOVB/3he+blH9uVPWo4BX6bQ71sXUpa
 kgIsPhzxCo+Bto/7P93F
 =oNDV
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20151116-1' into staging

vnc: buffer code improvements, bugfixes.

# gpg: Signature made Mon 16 Nov 2015 17:20:02 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-vnc-20151116-1:
  vnc: fix mismerge
  buffer: allow a buffer to shrink gracefully
  buffer: factor out buffer_adj_size
  buffer: factor out buffer_req_size
  vnc: recycle empty vs->output buffer
  vnc: fix local state init
  vnc: only alloc server surface with clients connected
  vnc: use vnc_{width,height} in vnc_set_area_dirty
  vnc: factor out vnc_update_server_surface
  vnc: add vnc_width+vnc_height helpers
  vnc: zap dead code
  vnc-jobs: move buffer reset, use new buffer move
  vnc: kill jobs queue buffer
  vnc: attach names to buffers
  buffer: add tracing
  buffer: add buffer_shrink
  buffer: add buffer_move
  buffer: add buffer_move_empty
  buffer: add buffer_init
  buffer: make the Buffer capacity increase in powers of two

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-17 12:34:07 +00:00
Peter Maydell 9be060f527 -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
 
 iQEcBAABAgAGBQJWSwvBAAoJEJykq7OBq3PIfUkIAJ/7NQlFTFwDnxG9cZA63h1Q
 Rq6B9dbzNmyBdtKSMIDgDOOLFiPIV6D978pd5isBhlJrQB1QZQoyn94TBN1u+kHE
 8eCYSsLjcdh2Vcn8nVTJCRAEdt42Fv6EFZAJ5cJGbI/dgrSrGAYvSj+BHOLFFseC
 5bHJ33Sdcb6iGg9IJqWct00sHfawUsVznR1grySbYOJoCmN4ReUwzBu2fCGK60dW
 0am0QLv5CVcy6Ulj1yndhmuHUyaR3jwTQqP6WlIrXsrVjoCfpMH9i6QJ65kYOKqg
 XnIeTI/DqKY6EKSSfEX1oR2G6obS7GbmSU0NjtsnruFXEPTNjhC7N4b98eaoE+Y=
 =NHaw
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

# gpg: Signature made Tue 17 Nov 2015 11:13:05 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"

* remotes/stefanha/tags/block-pull-request:
  virtio-blk: Fix double completion for werror=stop
  block: make 'stats-interval' an array of ints instead of a string
  aio-epoll: Fix use-after-free of node
  disas/arm: avoid clang shifting negative signed warning
  tpm: avoid clang shifting negative signed warning
  tests: Ignore recent test binaries
  docs: update bitmaps.md

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-17 11:33:38 +00:00
Fam Zheng 10f5a72f70 virtio-blk: Fix double completion for werror=stop
When a request R is absorbed by request M, it is appended to the
"mr_next" queue led by M, and is completed together with the completion
of M, in virtio_blk_rw_complete.

During DMA restart in virtio_blk_dma_restart_bh, requests in s->rq are
parsed and submitted again, possibly with a stale req->mr_next. It could
be a problem if the request merging in virtio_blk_handle_request hasn't
refreshed every mr_next pointer, in which case, virtio_blk_rw_complete
could walk through unexpected requests following the stale pointers.

Fix this by unsetting the pointer in virtio_blk_rw_complete. It is safe
because this req is either completed and freed right away, or it will be
restarted and parsed from scratch out of the vq later.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17 18:35:57 +08:00
Alberto Garcia 40119effc5 block: make 'stats-interval' an array of ints instead of a string
This is the natural JSON representation and prevents us from having to
decode the list manually.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 0e3da8fa206f4ab534ae3ce6086e75fe84f1557e.1447665472.git.berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17 18:35:57 +08:00
Fam Zheng 0ed39f3df2 aio-epoll: Fix use-after-free of node
aio_epoll_update needs the fields in node, so delay the free.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1447655534-13974-1-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17 18:35:57 +08:00
Stefan Hajnoczi 02460c3b42 disas/arm: avoid clang shifting negative signed warning
clang 3.7.0 on x86_64 warns about the following:

  disas/arm.c:1782:17: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    imm |= (-1 << 7);
            ~~ ^

Note that this patch preserves the tab indent in this source file
because the surrounding code still uses tabs.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17 18:35:56 +08:00
Stefan Hajnoczi 886ce6f8b6 tpm: avoid clang shifting negative signed warning
clang 3.7.0 on x86_64 warns about the following:

  hw/tpm/tpm_tis.c:1000:36: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
            tis->loc[c].iface_id = TPM_TIS_IFACE_ID_SUPPORTED_FLAGS1_3;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  hw/tpm/tpm_tis.c:144:10: note: expanded from macro 'TPM_TIS_IFACE_ID_SUPPORTED_FLAGS1_3'
     (~0 << 4)/* all of it is don't care */)
      ~~ ^

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17 18:35:56 +08:00
Eric Blake a12e52a151 tests: Ignore recent test binaries
Commits 6c6f312d and bd797fc1 added new tests (test-blockjob-txn
and test-timed-average, respectively), but did not mark them for
exclusion in .gitignore.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1447386423-13160-1-git-send-email-eblake@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2015-11-17 18:35:56 +08:00