]> git.ipfire.org Git - thirdparty/qemu.git/commit
migration: avoid divide by zero in xbzrle cache miss rate
authorMichael Chapman <mike@very.puzzling.org>
Wed, 15 Apr 2015 03:59:14 +0000 (13:59 +1000)
committerJuan Quintela <quintela@redhat.com>
Thu, 7 May 2015 16:31:54 +0000 (18:31 +0200)
commit27ff42e29a1d12e9d9dbc473bbca36a50baf278b
tree4573c773995ee4538fd0caa288d98e8dbce0d4f5
parent50e9a629c6c92e73260cd3d7c2e3f5bfd84e47e2
migration: avoid divide by zero in xbzrle cache miss rate

This bug manifested itself as a VM that could not be resumed by libvirt
following a migration:

  # virsh resume example
  error: Failed to resume domain example
  error: internal error: cannot parse json {"return":
    {"xbzrle-cache":
      {..., "cache-miss-rate": -nan, ...},
      ...
    }
  }: lexical error: malformed number, a digit is required after the minus sign.

This patch also ensures xbzrle_cache_miss_prev and iterations_prev are
cleared at the start of the migration.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
arch_init.c