OSDN Git Service

qmiga/qemu.git
7 years agosm501: Add support for panel layer
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Add support for panel layer

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 2029a276362c0c3a14c78acb56baa9466848dd51.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: Misc clean ups
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Misc clean ups

- Rename a variable
- Move variable declarations out of loop to the beginning in draw_hwc_line

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 187c9e4e09d9bc2967b2454b36bb088ceef0b8bc.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: Fix hardware cursor
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Fix hardware cursor

Rework HWC handling to simplify it and fix cursor not updating on
screen as needed. Previously cursor was not updated because checking
for changes in a line overrode the update flag set for the cursor but
fixing this is not enough because the cursor should also be updated if
its shape or location changes. Introduce hwc_invalidate() function to
handle that similar to other display controller models.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 6970a5e9868b7246656c1d02038dc5d5fa369507.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: Fix device endianness
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Fix device endianness

We only emulate the sysbus device in its default LE mode and PCI is LE
as well so specify this for registers and framebuffer memory.

Note that though the Linux kernel driver has code which claims to
handle both big and little endian, it is obviously bogus for 16 bit
and cannot be trusted as a source of information on the framebuffer
pixel format. This is our best guess about device behaviour based on
the specs and testing with MorphOS that is known to work on real HW.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 8b9605a569f8bf54074e15903620b18cd9967c89.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: Add emulation of chip connected via PCI
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Add emulation of chip connected via PCI

Only the display controller part is created automatically on PCI

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 647d292c6f5abba8b2a614687229949b5dcb864e.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: Get rid of base address in draw_hwc_line
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Get rid of base address in draw_hwc_line

Do not use the base address to access data in local memory. This is in
preparation to allow chip connected via PCI where base address depends
on where the BAR is mapped so it will be unknown.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 79dab21bc6ec4d563aabf265c3bab40e2e95aae8.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: QOMify
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: QOMify

Adding vmstate saving is not in this patch because the state structure
will be changed in further patches, then another patch will add
vmstate descriptor after those changes.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: a32b7fc981a20205f96d530d8e958f12ace1104c.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: Add missing arbitration control register
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Add missing arbitration control register

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: d1eaf3b19c40aeb32a343a211f2b56664a67f948.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: Use defined constants instead of literal values where available
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Use defined constants instead of literal values where available

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 31205c2df623e7b133ef942ff4f5e95fff800a14.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agosm501: Fixed code style and a few typos in comments
BALATON Zoltan [Fri, 21 Apr 2017 15:18:09 +0000 (17:18 +0200)]
sm501: Fixed code style and a few typos in comments

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
Message-id: 36288b703e7d56822c818567193ff28cdc47377e.1492787889.git.balaton@eik.bme.hu
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging
Peter Maydell [Mon, 24 Apr 2017 10:32:02 +0000 (11:32 +0100)]
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging

Update OpenBIOS images

# gpg: Signature made Sat 22 Apr 2017 07:36:01 BST
# gpg:                using RSA key 0x5BC2C56FAE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-openbios-signed:
  Update OpenBIOS images to 04898e8 built from submodule.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoMerge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging
Peter Maydell [Mon, 24 Apr 2017 08:43:03 +0000 (09:43 +0100)]
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging

qemu-sparc update

# gpg: Signature made Fri 21 Apr 2017 20:09:35 BST
# gpg:                using RSA key 0x5BC2C56FAE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-sparc-signed:
  tcx: switch to load_image_mr() and remove prom_addr hack
  tcx: use tcx_set_dirty() for accelerated ops
  tcx: remove primitives for non-32-bit surfaces
  tcx: remove TARGET_PAGE_SIZE from tcx24_update_display()
  tcx: remove TARGET_PAGE_SIZE from tcx_update_display()
  tcx: remove page24 and cpage from tcx24_update_display()
  tcx: alter tcx24_reset_dirty() to accept address and length parameters
  tcx: alter tcx24_check_dirty() to accept address and length parameters
  tcx: ensure tcx_set_dirty() also invalidates the 24-bit plane and cplane
  tcx: alter tcx_set_dirty() to accept address and length parameters
  cg3: switch to load_image_mr() and remove prom-addr hack
  cg3: fix up size parameter for memory_region_get_dirty()
  cg3: remove TARGET_PAGE_SIZE rounding on dirty page detection

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7 years agoUpdate OpenBIOS images to 04898e8 built from submodule.
Mark Cave-Ayland [Sat, 22 Apr 2017 06:26:16 +0000 (07:26 +0100)]
Update OpenBIOS images to 04898e8 built from submodule.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
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 agotcx: switch to load_image_mr() and remove prom_addr hack
Mark Cave-Ayland [Wed, 5 Apr 2017 08:02:47 +0000 (09:02 +0100)]
tcx: switch to load_image_mr() and remove prom_addr hack

Previous to the existence of load_image_mr(), the only way to load in the
FCode ROM image was to pass in its physical address via qdev properties
and use load_image_targphys().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agotcx: use tcx_set_dirty() for accelerated ops
Mark Cave-Ayland [Wed, 5 Apr 2017 08:02:47 +0000 (09:02 +0100)]
tcx: use tcx_set_dirty() for accelerated ops

Rather than calling memory_region_set_dirty() directly, make sure that we call
tcx_set_dirty() instead. This ensures that the 24-bit plane and cplane are
also invalidated correctly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agotcx: remove primitives for non-32-bit surfaces
Mark Cave-Ayland [Wed, 5 Apr 2017 08:02:47 +0000 (09:02 +0100)]
tcx: remove primitives for non-32-bit surfaces

As all surfaces in QEMU are now either shared or 32-bit ARGB regardless of
the guest depth, remove all non-32-bit primitives from tcx_update_display()
and consequence their implementation which are no longer required.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agotcx: remove TARGET_PAGE_SIZE from tcx24_update_display()
Mark Cave-Ayland [Wed, 5 Apr 2017 08:02:47 +0000 (09:02 +0100)]
tcx: remove TARGET_PAGE_SIZE from tcx24_update_display()

Now that page alignment is handled by the memory API, there is no need to
duplicate the code 4 times (4 * 1024 == 4096 == TARGET_PAGE_SIZE).

Finally we have now removed all traces of TARGET_PAGE_SIZE.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agotcx: remove TARGET_PAGE_SIZE from tcx_update_display()
Mark Cave-Ayland [Wed, 5 Apr 2017 08:02:47 +0000 (09:02 +0100)]
tcx: remove TARGET_PAGE_SIZE from tcx_update_display()

Now that page alignment is handled by the memory API, there is no need to
duplicate the code 4 times (4 * 1024 == 4096 == TARGET_PAGE_SIZE).

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agotcx: remove page24 and cpage from tcx24_update_display()
Mark Cave-Ayland [Wed, 5 Apr 2017 08:02:47 +0000 (09:02 +0100)]
tcx: remove page24 and cpage from tcx24_update_display()

Since all of the tcx_*_dirty() functions now calculate the 24-bit and
cplane offsets themselves from the base address, these variables are no
longer needed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agotcx: alter tcx24_reset_dirty() to accept address and length parameters
Mark Cave-Ayland [Wed, 5 Apr 2017 08:02:46 +0000 (09:02 +0100)]
tcx: alter tcx24_reset_dirty() to accept address and length parameters

This can now be used by both the 8-bit and 24-bit display code, so rename
to tcx_check_dirty().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>