OSDN Git Service

qmiga/qemu.git
7 years agoerror: Apply error_propagate_null.cocci again
Fam Zheng [Fri, 21 Apr 2017 12:27:10 +0000 (20:27 +0800)]
error: Apply error_propagate_null.cocci again

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-15-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agoqga: Make errp the last parameter of qga_vss_fsfreeze
Fam Zheng [Fri, 21 Apr 2017 12:27:09 +0000 (20:27 +0800)]
qga: Make errp the last parameter of qga_vss_fsfreeze

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-14-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agomigration: Make errp the last parameter of local functions
Fam Zheng [Fri, 21 Apr 2017 12:27:08 +0000 (20:27 +0800)]
migration: Make errp the last parameter of local functions

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-13-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agoscsi: Make errp the last parameter of virtio_scsi_common_realize
Fam Zheng [Fri, 21 Apr 2017 12:27:07 +0000 (20:27 +0800)]
scsi: Make errp the last parameter of virtio_scsi_common_realize

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-12-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agofdc: Make errp the last parameter of fdctrl_connect_drives
Fam Zheng [Fri, 21 Apr 2017 12:27:06 +0000 (20:27 +0800)]
fdc: Make errp the last parameter of fdctrl_connect_drives

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-11-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agonfs: Make errp the last parameter of nfs_client_open
Fam Zheng [Fri, 21 Apr 2017 12:27:05 +0000 (20:27 +0800)]
nfs: Make errp the last parameter of nfs_client_open

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-10-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agoblock: Make errp the last parameter of commit_active_start
Fam Zheng [Fri, 21 Apr 2017 12:27:04 +0000 (20:27 +0800)]
block: Make errp the last parameter of commit_active_start

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-9-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agomirror: Make errp the last parameter of mirror_start_job
Fam Zheng [Fri, 21 Apr 2017 12:27:03 +0000 (20:27 +0800)]
mirror: Make errp the last parameter of mirror_start_job

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-8-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agocrypto: Make errp the last parameter of functions
Fam Zheng [Fri, 21 Apr 2017 12:27:02 +0000 (20:27 +0800)]
crypto: Make errp the last parameter of functions

Move opaque to 2nd instead of the 2nd to last, so that compilers help
check with the conversion.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-7-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message typo corrected]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agoblock: Make errp the last parameter of bdrv_img_create
Fam Zheng [Fri, 21 Apr 2017 12:27:01 +0000 (20:27 +0800)]
block: Make errp the last parameter of bdrv_img_create

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-6-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agosocket: Make errp the last parameter of vsock_connect_saddr
Fam Zheng [Fri, 21 Apr 2017 12:27:00 +0000 (20:27 +0800)]
socket: Make errp the last parameter of vsock_connect_saddr

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-5-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agosocket: Make errp the last parameter of unix_connect_saddr
Fam Zheng [Fri, 21 Apr 2017 12:26:59 +0000 (20:26 +0800)]
socket: Make errp the last parameter of unix_connect_saddr

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-4-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agosocket: Make errp the last parameter of inet_connect_saddr
Fam Zheng [Fri, 21 Apr 2017 12:26:58 +0000 (20:26 +0800)]
socket: Make errp the last parameter of inet_connect_saddr

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-3-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agosocket: Make errp the last parameter of socket_connect
Fam Zheng [Fri, 21 Apr 2017 12:26:57 +0000 (20:26 +0800)]
socket: Make errp the last parameter of socket_connect

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170421122710.15373-2-famz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agoutil/error: Fix leak in error_vprepend()
Max Reitz [Thu, 13 Apr 2017 16:09:52 +0000 (18:09 +0200)]
util/error: Fix leak in error_vprepend()

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20170413160952.29918-1-mreitz@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
7 years agoMerge remote-tracking branch 'remotes/juanquintela/tags/migration/20170421' into...
Peter Maydell [Fri, 21 Apr 2017 14:59:27 +0000 (15:59 +0100)]
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170421' into staging

migration/next for 20170421

# gpg: Signature made Fri 21 Apr 2017 11:28:13 BST
# gpg:                using RSA key 0xF487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>"
# gpg:                 aka "Juan Quintela <quintela@trasno.org>"
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* remotes/juanquintela/tags/migration/20170421: (65 commits)
  hmp: info migrate_parameters format tunes
  hmp: info migrate_capability format tunes
  migration: rename max_size to threshold_size
  migration: set current_active_state once
  virtio-rng: stop virtqueue while the CPU is stopped
  migration: don't close a file descriptor while it can be in use
  ram: Remove migration_bitmap_extend()
  migration: Disable hotplug/unplug during migration
  qdev: Move qdev_unplug() to qdev-monitor.c
  qdev: Export qdev_hot_removed
  qdev: qdev_hotplug is really a bool
  migration: Remove MigrationState parameter from migration_is_idle()
  ram: Use RAMBitmap type for coherence
  ram: rename last_ram_offset() last_ram_pages()
  ram: Use ramblock and page offset instead of absolute offset
  ram: Change offset field in PageSearchStatus to page
  ram: Remember last_page instead of last_offset
  ram: Use page number instead of an address for the bitmap operations
  ram: reorganize last_sent_block
  ram: ram_discard_range() don't use the mis parameter
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Peter Maydell [Fri, 21 Apr 2017 13:36:45 +0000 (14:36 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging

# gpg: Signature made Fri 21 Apr 2017 10:52:18 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/tracing-pull-request:
  simpletrace: document Analyzer method signatures
  trace: Put all trace.o into libqemuutil.a
  configure: eliminate Python dependency for --help

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Fri, 21 Apr 2017 13:02:10 +0000 (14:02 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

# gpg: Signature made Fri 21 Apr 2017 10:43:04 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  MAINTAINERS: update my email address
  MAINTAINERS: update Wen's email address
  migration/block: use blk_pwrite_zeroes for each zero cluster
  throttle: make throttle_config(throttle_get_config()) symmetric
  throttle: do not use invalid config in test
  qemu-options: explain disk I/O throttling options

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20170421' into staging
Peter Maydell [Fri, 21 Apr 2017 11:59:42 +0000 (12:59 +0100)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20170421' into staging

The first batch of s390x changes for 2.10:
- the new compat machine
- several cleanups and optimizations
- introspection for css ids

# gpg: Signature made Fri 21 Apr 2017 08:36:25 BST
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20170421:
  s390x: Drop useless casts
  s390x: register I/O adapters per ISC during init
  s390x/flic: cache flic in s390_get_flic
  s390x: initialize flic before I/O subsystems
  s390x: use enum for adapter type and standardize its naming
  s390x/css: consolidate the devno property for ccw devices
  s390x/css: provide introspection for virtual subchannel and device busid
  s390x/css: introduce read-only property type for device ids
  s390x/pci: make printf always compile in debug output
  s390x/kvm: make printf always compile in debug output
  s390x: introduce 2.10 compat machine

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-qdev-2017-04-21' into staging
Peter Maydell [Fri, 21 Apr 2017 10:42:03 +0000 (11:42 +0100)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-qdev-2017-04-21' into staging

qdev patches for 2017-04-21

# gpg: Signature made Fri 21 Apr 2017 06:37:19 BST
# gpg:                using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qdev-2017-04-21:
  qdev: remove cannot_destroy_with_object_finalize_yet
  versatile: remove cannot_destroy_with_object_finalize_yet
  ppc: remove cannot_destroy_with_object_finalize_yet
  arm: remove remaining cannot_destroy_with_object_finalize_yet

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agohmp: info migrate_parameters format tunes
Peter Xu [Sat, 1 Apr 2017 08:18:45 +0000 (16:18 +0800)]
hmp: info migrate_parameters format tunes

Do the same (one per line) to the parameter list.

CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agohmp: info migrate_capability format tunes
Peter Xu [Sat, 1 Apr 2017 08:18:44 +0000 (16:18 +0800)]
hmp: info migrate_capability format tunes

Dump the info in a single line is hard to read. Do it one per line.
Also, the first "capabilities:" didn't help much. Let's remove it.

CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agomigration: rename max_size to threshold_size
Peter Xu [Sat, 1 Apr 2017 08:18:43 +0000 (16:18 +0800)]
migration: rename max_size to threshold_size

In migration codes (especially in migration_thread()), max_size is used
in many place for the threshold value that we will start to do the final
flush and jump to the next stage to dump the whole rest things to
destination. However its name is confusing to first readers. Let's
rename it to "threshold_size" when proper and add a comment for it. No
functional change is made.

CC: Juan Quintela <quintela@redhat.com>
CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agomigration: set current_active_state once
Peter Xu [Sat, 1 Apr 2017 08:18:42 +0000 (16:18 +0800)]
migration: set current_active_state once

We set it right above this one. No need to set it twice.

CC: Juan Quintela <quintela@redhat.com>
CC: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agovirtio-rng: stop virtqueue while the CPU is stopped
Laurent Vivier [Wed, 12 Apr 2017 13:53:12 +0000 (15:53 +0200)]
virtio-rng: stop virtqueue while the CPU is stopped

If we modify the virtio-rng virqueue while the
vmstate is already migrated we can have some
inconsistencies between the virtqueue state and
the memory content.

To avoid this, stop the virtqueue while the CPU
is stopped.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Amit Shah <amit@kernel.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agomigration: don't close a file descriptor while it can be in use
Laurent Vivier [Wed, 12 Apr 2017 13:53:11 +0000 (15:53 +0200)]
migration: don't close a file descriptor while it can be in use

If we close the QEMUFile descriptor in process_incoming_migration_co()
while it has been stopped by an error, the postcopy_ram_listen_thread()
can try to continue to use it. And as the memory has been freed
it is working with an invalid pointer and crashes.

Fix this by releasing the memory after having managed the error
case (which, in fact, calls exit())

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Amit Shah <amit@kernel.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agoram: Remove migration_bitmap_extend()
Juan Quintela [Wed, 22 Mar 2017 16:42:01 +0000 (17:42 +0100)]
ram: Remove migration_bitmap_extend()

We have disabled memory hotplug, so we don't need to handle
migration_bitamp there.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
7 years agomigration: Disable hotplug/unplug during migration
Juan Quintela [Wed, 22 Mar 2017 16:34:27 +0000 (17:34 +0100)]
migration: Disable hotplug/unplug during migration

Until we have reviewed what can/can't be hotplugged during migration,
disable it.  We can enable it later for the things that we know that
work.  For instance, memory hotplug during postcopy doesn't work
currently.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
--

- Fix typo.  Thanks Thomas.
- Delay migration check after we have checked that we can hotplug that
  device.
- more typos

7 years agoqdev: Move qdev_unplug() to qdev-monitor.c
Juan Quintela [Tue, 28 Mar 2017 09:22:51 +0000 (11:22 +0200)]
qdev: Move qdev_unplug() to qdev-monitor.c

It is not used by linux-user, otherwise I need to to create one stub
for migration_is_idle() on following patch.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
7 years agoqdev: Export qdev_hot_removed
Juan Quintela [Tue, 28 Mar 2017 09:22:10 +0000 (11:22 +0200)]
qdev: Export qdev_hot_removed

I need to move qdev_unplug to qdev-monitor in the following patch, and
it needs access to this variable.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
7 years agoqdev: qdev_hotplug is really a bool
Juan Quintela [Tue, 28 Mar 2017 09:08:52 +0000 (11:08 +0200)]
qdev: qdev_hotplug is really a bool

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agomigration: Remove MigrationState parameter from migration_is_idle()
Juan Quintela [Wed, 22 Mar 2017 16:36:57 +0000 (17:36 +0100)]
migration: Remove MigrationState parameter from migration_is_idle()

Only user don't have a MigrationState handly.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Use RAMBitmap type for coherence
Juan Quintela [Tue, 21 Mar 2017 17:03:49 +0000 (18:03 +0100)]
ram: Use RAMBitmap type for coherence

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: rename last_ram_offset() last_ram_pages()
Juan Quintela [Tue, 21 Mar 2017 16:44:30 +0000 (17:44 +0100)]
ram: rename last_ram_offset() last_ram_pages()

We always use it as pages anyways.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Use ramblock and page offset instead of absolute offset
Juan Quintela [Tue, 21 Mar 2017 15:19:05 +0000 (16:19 +0100)]
ram: Use ramblock and page offset instead of absolute offset

This removes the needto pass also the absolute offset.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Change offset field in PageSearchStatus to page
Juan Quintela [Tue, 21 Mar 2017 14:36:51 +0000 (15:36 +0100)]
ram: Change offset field in PageSearchStatus to page

We are moving everything to work on pages, not addresses.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Remember last_page instead of last_offset
Juan Quintela [Tue, 21 Mar 2017 14:23:31 +0000 (15:23 +0100)]
ram: Remember last_page instead of last_offset

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
--

Improve comment
Fix typo

7 years agoram: Use page number instead of an address for the bitmap operations
Juan Quintela [Tue, 21 Mar 2017 14:18:05 +0000 (15:18 +0100)]
ram: Use page number instead of an address for the bitmap operations

We use an unsigned long for the page number.  Notice that our bitmaps
already got that for the index, so we have that limit.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
--

rename page to page_abs everywhere.
fix trace types for pages

7 years agoram: reorganize last_sent_block
Juan Quintela [Tue, 21 Mar 2017 10:45:01 +0000 (11:45 +0100)]
ram: reorganize last_sent_block

We were setting it far away of when we changed it.  Now everything is
done inside save_page_header.  Once there, reorganize code to pass
RAMState.  We also set CONTINUE flag in a single place.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: ram_discard_range() don't use the mis parameter
Juan Quintela [Tue, 21 Mar 2017 10:35:24 +0000 (11:35 +0100)]
ram: ram_discard_range() don't use the mis parameter

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Pass RAMBlock to bitmap_sync
Juan Quintela [Tue, 21 Mar 2017 08:35:04 +0000 (09:35 +0100)]
ram: Pass RAMBlock to bitmap_sync

We change the meaning of start to be the offset from the beggining of
the block.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Add page-size to output in 'info migrate'
Chao Fan [Tue, 21 Mar 2017 02:22:43 +0000 (10:22 +0800)]
ram: Add page-size to output in 'info migrate'

The number of dirty pages is output in 'pages' in the command
'info migrate', so add page-size to calculate the number of dirty
pages in bytes.

Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agoram: Rename qemu_target_page_bits() to qemu_target_page_size()
Juan Quintela [Tue, 21 Mar 2017 08:09:14 +0000 (09:09 +0100)]
ram: Rename qemu_target_page_bits() to qemu_target_page_size()

It was used as a size in all cases except one.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: We don't need MigrationState parameter anymore
Juan Quintela [Mon, 20 Mar 2017 21:29:07 +0000 (22:29 +0100)]
ram: We don't need MigrationState parameter anymore

Remove it from callers and callees.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agomigration: Remove MigrationState from migration_in_postcopy
Juan Quintela [Mon, 20 Mar 2017 21:25:28 +0000 (22:25 +0100)]
migration: Remove MigrationState from migration_in_postcopy

We need to call for the migrate_get_current() in more that half of the
uses, so call that inside.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Remove compression_switch and inline its logic
Juan Quintela [Thu, 16 Mar 2017 20:29:34 +0000 (21:29 +0100)]
ram: Remove compression_switch and inline its logic

We can calculate its value, so we don't create a variable for it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
--

After Peter and Dave review, I dropped the variable and just inlined
the condition.

Fix typo

7 years agoram: Move QEMUFile into RAMState
Juan Quintela [Wed, 15 Mar 2017 10:00:51 +0000 (11:00 +0100)]
ram: Move QEMUFile into RAMState

We receive the file from save_live operations and we don't use it
until 3 or 4 levels of calls down.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Add QEMUFile to RAMState
Juan Quintela [Wed, 15 Mar 2017 08:16:57 +0000 (09:16 +0100)]
ram: Add QEMUFile to RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Move postcopy_requests into RAMState
Juan Quintela [Tue, 14 Mar 2017 17:41:03 +0000 (18:41 +0100)]
ram: Move postcopy_requests into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move dirty_pages_rate to RAMState
Juan Quintela [Tue, 14 Mar 2017 17:20:30 +0000 (18:20 +0100)]
ram: Move dirty_pages_rate to RAMState

Treat it like the rest of ram stats counters.  Export its value the
same way.  As an added bonus, no more MigrationState used in
migration_bitmap_sync();

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--

Again, dave was the one reviewing it

7 years agoram: Remove dirty_bytes_rate
Juan Quintela [Tue, 14 Mar 2017 17:10:16 +0000 (18:10 +0100)]
ram: Remove dirty_bytes_rate

It can be recalculated from dirty_pages_rate.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--

Dave was the one that reviewed it O:-)

7 years agoram: Create ram_dirty_sync_count()
Juan Quintela [Tue, 14 Mar 2017 17:01:38 +0000 (18:01 +0100)]
ram: Create ram_dirty_sync_count()

This is a ram field that was inside MigrationState.  Move it to
RAMState and make it the same that the other ram stats.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move src_page_req* to RAMState
Juan Quintela [Mon, 20 Mar 2017 21:12:40 +0000 (22:12 +0100)]
ram: Move src_page_req* to RAMState

This are the last postcopy fields still at MigrationState.  Once there
Move MigrationSrcPageRequest to ram.c and remove MigrationState
parameters where appropiate.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move last_req_rb to RAMState
Juan Quintela [Tue, 14 Mar 2017 12:48:42 +0000 (13:48 +0100)]
ram: Move last_req_rb to RAMState

It was on MigrationState when it is only used inside ram.c for
postcopy.  Problem is that we need to access it without being able to
pass it RAMState directly.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Remove ram_save_remaining
Juan Quintela [Tue, 14 Mar 2017 11:02:16 +0000 (12:02 +0100)]
ram: Remove ram_save_remaining

Just unfold it.  Move ram_bytes_remaining() with the rest of exported
functions.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Use the RAMState bytes_transferred parameter
Juan Quintela [Tue, 14 Mar 2017 09:27:31 +0000 (10:27 +0100)]
ram: Use the RAMState bytes_transferred parameter

Somewhere it was passed by reference, just use it from RAMState.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move bytes_transferred into RAMState
Juan Quintela [Mon, 13 Mar 2017 20:58:11 +0000 (21:58 +0100)]
ram: Move bytes_transferred into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move migration_bitmap_rcu into RAMState
Juan Quintela [Mon, 13 Mar 2017 20:51:55 +0000 (21:51 +0100)]
ram: Move migration_bitmap_rcu into RAMState

Once there, rename the type to be shorter.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move migration_bitmap_mutex into RAMState
Juan Quintela [Mon, 13 Mar 2017 20:38:09 +0000 (21:38 +0100)]
ram: Move migration_bitmap_mutex into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Everything was init to zero, so use memset
Juan Quintela [Mon, 13 Mar 2017 20:29:54 +0000 (21:29 +0100)]
ram: Everything was init to zero, so use memset

And then init only things that are not zero by default.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move migration_dirty_pages to RAMState
Juan Quintela [Mon, 13 Mar 2017 20:21:41 +0000 (21:21 +0100)]
ram: Move migration_dirty_pages to RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move xbzrle_overflows into RAMState
Juan Quintela [Mon, 13 Mar 2017 20:07:03 +0000 (21:07 +0100)]
ram: Move xbzrle_overflows into RAMState

Once there, remove the now unused AccountingInfo struct and var.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move xbzrle_cache_miss_rate into RAMState
Juan Quintela [Mon, 13 Mar 2017 20:04:16 +0000 (21:04 +0100)]
ram: Move xbzrle_cache_miss_rate into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move xbzrle_cache_miss into RAMState
Juan Quintela [Mon, 13 Mar 2017 20:02:08 +0000 (21:02 +0100)]
ram: Move xbzrle_cache_miss into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move xbzrle_pages into RAMState
Juan Quintela [Mon, 13 Mar 2017 19:59:32 +0000 (20:59 +0100)]
ram: Move xbzrle_pages into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--

Comment why we need bytes and pages

7 years agoram: Move xbzrle_bytes into RAMState
Juan Quintela [Mon, 13 Mar 2017 19:57:27 +0000 (20:57 +0100)]
ram: Move xbzrle_bytes into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Move iterations into RAMState
Juan Quintela [Mon, 13 Mar 2017 19:51:34 +0000 (20:51 +0100)]
ram: Move iterations into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Remove norm_mig_bytes_transferred
Juan Quintela [Mon, 13 Mar 2017 19:43:34 +0000 (20:43 +0100)]
ram: Remove norm_mig_bytes_transferred

Its value can be calculated by other exported.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Move norm_pages to RAMState
Juan Quintela [Mon, 13 Mar 2017 19:40:53 +0000 (20:40 +0100)]
ram: Move norm_pages to RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Remove unused pages_skipped variable
Juan Quintela [Mon, 13 Mar 2017 19:35:54 +0000 (20:35 +0100)]
ram: Remove unused pages_skipped variable

For compatibility, we need to still send a value, but just specify it
and comment the fact.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Remove unused dup_mig_bytes_transferred()
Juan Quintela [Mon, 13 Mar 2017 19:33:01 +0000 (20:33 +0100)]
ram: Remove unused dup_mig_bytes_transferred()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move dup_pages into RAMState
Juan Quintela [Mon, 13 Mar 2017 19:30:21 +0000 (20:30 +0100)]
ram: Move dup_pages into RAMState

Once there rename it to its actual meaning, zero_pages.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move iterations_prev into RAMState
Juan Quintela [Mon, 13 Mar 2017 18:51:13 +0000 (19:51 +0100)]
ram: Move iterations_prev into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agoram: Move xbzrle_cache_miss_prev into RAMState
Juan Quintela [Mon, 13 Mar 2017 18:49:19 +0000 (19:49 +0100)]
ram: Move xbzrle_cache_miss_prev into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agoram: Change num_dirty_pages_period type to uint64_t
Juan Quintela [Tue, 28 Mar 2017 13:05:53 +0000 (15:05 +0200)]
ram: Change num_dirty_pages_period type to uint64_t

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move num_dirty_pages_period into RAMState
Juan Quintela [Tue, 28 Mar 2017 13:02:43 +0000 (15:02 +0200)]
ram: Move num_dirty_pages_period into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Change byte_xfer_{prev,now} type to uint64_t
Juan Quintela [Tue, 28 Mar 2017 12:59:54 +0000 (14:59 +0200)]
ram: Change byte_xfer_{prev,now} type to uint64_t

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move bytes_xfer_prev into RAMState
Juan Quintela [Tue, 28 Mar 2017 12:59:01 +0000 (14:59 +0200)]
ram: Move bytes_xfer_prev into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Move start time into RAMState
Juan Quintela [Mon, 13 Mar 2017 18:44:57 +0000 (19:44 +0100)]
ram: Move start time into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--

Renamed start_time to time_last_bitmap_sync(peterx suggestion)

7 years agoram: Move bitmap_sync_count into RAMState
Juan Quintela [Mon, 13 Mar 2017 18:39:02 +0000 (19:39 +0100)]
ram: Move bitmap_sync_count into RAMState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Add dirty_rate_high_cnt to RAMState
Juan Quintela [Mon, 13 Mar 2017 18:35:50 +0000 (19:35 +0100)]
ram: Add dirty_rate_high_cnt to RAMState

We need to add a parameter to several functions to make this work.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Create RAMState
Juan Quintela [Mon, 13 Mar 2017 18:26:29 +0000 (19:26 +0100)]
ram: Create RAMState

We create a struct where to put all the ram state

Start with the following fields:

last_seen_block, last_sent_block, last_offset, last_version and
ram_bulk_stage are globals that are really related together.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--

Fix typo and warnings

7 years agoram: Rename block_name to rbname
Juan Quintela [Thu, 23 Mar 2017 14:11:59 +0000 (15:11 +0100)]
ram: Rename block_name to rbname

So all places are consistent on the naming of a block name parameter.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agoram: Rename flush_page_queue() to migration_page_queue_free()
Juan Quintela [Mon, 3 Apr 2017 20:06:54 +0000 (22:06 +0200)]
ram: Rename flush_page_queue() to migration_page_queue_free()

It reflects better what it does.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agoram: Update all functions comments
Juan Quintela [Thu, 23 Mar 2017 14:06:39 +0000 (15:06 +0100)]
ram: Update all functions comments

Added doc comments for existing functions comment and rewrite them in
a common style.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--

Fix Peter Xu comments
Improve postcopy comments as per reviews.

7 years agosimpletrace: document Analyzer method signatures
Stefan Hajnoczi [Tue, 11 Apr 2017 09:56:54 +0000 (10:56 +0100)]
simpletrace: document Analyzer method signatures

Users can inherit from the simpletrace.Analyzer class and receive
callbacks when events of interest occur in a trace file.  The method
signature is a little magic because the timestamp and pid arguments are
optional.  Document this.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20170411095654.18383-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agotrace: Put all trace.o into libqemuutil.a
Xu, Anthony [Tue, 4 Apr 2017 21:39:39 +0000 (21:39 +0000)]
trace: Put all trace.o into libqemuutil.a

Currently all trace.o are linked into qemu-system, qemu-img,
qemu-nbd, qemu-io etc., even the corresponding components
are not included.
Put all trace.o into libqemuutil.a that the linker would only pull in .o
files containing symbols that are actually referenced by the
program.

Signed-off -by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoconfigure: eliminate Python dependency for --help
Stefan Hajnoczi [Tue, 28 Mar 2017 13:44:18 +0000 (14:44 +0100)]
configure: eliminate Python dependency for --help

The ./configure script should produce --help output even if Python is
not installed.

Listing trace backends is simple: show the names of all Python modules
in scripts/tracetool/backend/ whose source code contains 'PUBLIC =
True'.

Perform the backend enumeration in shell instead of Python so that we
can move the Python check until after ./configure --help.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20170328134418.3426-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMAINTAINERS: update my email address
Zhang Chen [Fri, 21 Apr 2017 07:12:47 +0000 (15:12 +0800)]
MAINTAINERS: update my email address

I'm leaving my job at Fujitsu, this email address will stop working
this week. Update it to one that I will have access to later.

Signed-off-by: Xie Changlong <xiecl.fnst@cn.fujitsu.com>
Message-id: 1492758767-19716-1-git-send-email-xiecl.fnst@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMAINTAINERS: update Wen's email address
Changlong Xie [Tue, 18 Apr 2017 03:08:13 +0000 (11:08 +0800)]
MAINTAINERS: update Wen's email address

So he can get CC'ed on future patches and bugs for this feature

Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Message-id: 1492484893-23435-1-git-send-email-xiecl.fnst@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agomigration/block: use blk_pwrite_zeroes for each zero cluster
Lidong Chen [Thu, 13 Apr 2017 02:34:28 +0000 (10:34 +0800)]
migration/block: use blk_pwrite_zeroes for each zero cluster

BLOCK_SIZE is (1 << 20), qcow2 cluster size is 65536 by default,
this may cause the qcow2 file size to be bigger after migration.
This patch checks each cluster, using blk_pwrite_zeroes for each
zero cluster.

[Initialize cluster_size to BLOCK_SIZE to prevent a gcc uninitialized
variable compiler warning.  In reality we always initialize cluster_size
in a conditional but gcc doesn't know that.
--Stefan]

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Lidong Chen <lidongchen@tencent.com>
Message-id: 1492050868-16200-1-git-send-email-lidongchen@tencent.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agothrottle: make throttle_config(throttle_get_config()) symmetric
Stefan Hajnoczi [Wed, 1 Mar 2017 11:50:26 +0000 (11:50 +0000)]
throttle: make throttle_config(throttle_get_config()) symmetric

Throttling has a weird property that throttle_get_config() does not
always return the same throttling settings that were given with
throttle_config().  In other words, the set and get functions aren't
symmetric.

If .max is 0 then the throttling code assigns a default value of .avg /
10 in throttle_config().  This is an implementation detail of the
throttling algorithm.  When throttle_get_config() is called the .max
value returned should still be 0.

Users are exposed to this quirk via "info block" or "query-block"
monitor commands.  This has caused confusion because it looks like a bug
when an unexpected value is reported.

This patch hides the .max value adjustment in throttle_get_config() and
updates test-throttle.c appropriately.

Reported-by: Nini Gu <ngu@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20170301115026.22621-4-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agothrottle: do not use invalid config in test
Stefan Hajnoczi [Wed, 1 Mar 2017 11:50:25 +0000 (11:50 +0000)]
throttle: do not use invalid config in test

The (burst) max parameter cannot be smaller than the avg parameter.
There is a test case that uses avg = 56, max = 1 and gets away with it
because no input validation is performed by the test case.

This patch switches to valid test input parameters.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20170301115026.22621-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoqemu-options: explain disk I/O throttling options
Stefan Hajnoczi [Wed, 1 Mar 2017 11:50:24 +0000 (11:50 +0000)]
qemu-options: explain disk I/O throttling options

The disk I/O throttling options have been listed for a long time but
never explained on the QEMU man page.

Suggested-by: Nini Gu <ngu@redhat.com>
Cc: Alberto Garcia <berto@igalia.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-id: 20170301115026.22621-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/machine-pull-request' into staging
Peter Maydell [Fri, 21 Apr 2017 09:23:56 +0000 (10:23 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-pull-request' into staging

Machine queue for 2.10

# gpg: Signature made Thu 20 Apr 2017 19:44:27 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/machine-pull-request:
  qdev: Constify local variable returned by blk_bs
  qdev: Constify value passed to qdev_prop_set_macaddr
  hostmem: use host_memory_backend_mr_inited() where proper
  hostmem: introduce host_memory_backend_mr_inited()
  hw/core/null-machine: Print error message when using the -kernel parameter
  qdev: Make "hotplugged" property read-only
  intel_iommu: enable remote IOTLB
  intel_iommu: allow dynamic switch of IOMMU region
  intel_iommu: provide its own replay() callback
  intel_iommu: use the correct memory region for device IOTLB notification
  memory: add MemoryRegionIOMMUOps.replay() callback
  memory: introduce memory_region_notify_one()
  memory: provide iommu_replay_all()
  memory: provide IOMMU_NOTIFIER_FOREACH macro
  memory: add section range info for IOMMU notifier

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agos390x: Drop useless casts
Eric Blake [Wed, 5 Apr 2017 19:47:31 +0000 (14:47 -0500)]
s390x: Drop useless casts

An upcoming Coccinelle cleanup script wanted to reformat the casts
present in this file - but on closer look, we don't need the casts
at all because C automatically converts void* to any other pointer.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20170405194741.18956-4-eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x: register I/O adapters per ISC during init
Fei Li [Thu, 24 Nov 2016 10:10:39 +0000 (11:10 +0100)]
s390x: register I/O adapters per ISC during init

The I/O adapters should exist as soon as the bus/infrastructure
exists, and not only when the guest is actually trying to do something
with them. While the lazy allocation was not wrong, allocating at init
time is cleaner, both for the architecture and the code. Let's adjust
this by having each device type (currently for PCI and virtio-ccw)
register the adapters for each ISC (as now we don't know which ISC the
guest will use) as soon as it initializes.

Use a two-dimensional array io_adapters[type][isc] to store adapters
in ChannelSubSys, so that we can conveniently get the adapter id by
the helper function css_get_adapter_id(type, isc).

Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x/flic: cache flic in s390_get_flic
Fei Li [Fri, 17 Mar 2017 09:28:30 +0000 (10:28 +0100)]
s390x/flic: cache flic in s390_get_flic

s390_get_flic() is called many times to obtain the flic. This wastes a
lot of time as it calls object_resolve_path() every time. Let's cache
S390FLICState by defining it as static.

Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x: initialize flic before I/O subsystems
Fei Li [Fri, 2 Dec 2016 08:37:48 +0000 (09:37 +0100)]
s390x: initialize flic before I/O subsystems

Let's have a flic before we move on to initialize more specific
subsystems that make use of it.

Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x: use enum for adapter type and standardize its naming
Fei Li [Fri, 25 Nov 2016 06:45:14 +0000 (07:45 +0100)]
s390x: use enum for adapter type and standardize its naming

Let's use an enum for io adapter type, and standardize its naming to
CSS_IO_ADAPTER_* by changing S390_PCIPT_ADAPTER to CSS_IO_ADAPTER_PCI.

Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>