[PATCH 0/4] qemu: fix block jobs when copy_on_read is enabled

Peter Krempa pkrempa at redhat.com
Thu Jan 23 15:57:01 UTC 2020

QEMU requires us to pass the topmost node(-name) in the backing chain as
the 'device' argument for the blockdev-mirror/block-commit commands.
Otherwise QEMU complains:

 "Need a root block node"

Since libvirt always puts the copy-on-read driver on top of the backing
chain, blockjobs on disks which use "copy_on_read" fail.

The series below fixes that by passing the proper node. This fixes it
just fine for the mirror, but for block-commit we still get another
error due to a bug in qemu:

 "'libvirt-4-format' is not in this backing file chain"

Additionally one weird thing happens with block-stream (blockpull). If I
pass the layer below the copy-on-read as 'device', everything works.
This is kind of weird as the documentation for that is the same. If I
pass the nodename of copy-on-read.

Max, Kevin, could you please comment on the block-stream part and
possibly also on the plans to fix the issue with block-commit?

Cc: Max Reitz <mreitz at redhat.com>
CC: Kevin Wolf <kwolf at redhat.com>


Peter Krempa (4):
  qemu: blockcopy: Actually unplug unused images when mirror job fails
    to start
  qemu: domain: Extract code to determine topmost nodename to
  qemu: Fix value of 'device' argument for blockdev-mirror
  qemu: Fix value of 'device' argument for block-commit

 src/qemu/qemu_domain.c    | 38 ++++++++++++++++++++++++++------------
 src/qemu/qemu_domain.h    |  4 ++++
 src/qemu/qemu_driver.c    |  6 +++---
 src/qemu/qemu_migration.c |  2 +-
 4 files changed, 34 insertions(+), 16 deletions(-)


More information about the libvir-list mailing list