Somehow libvirt (virsh) is not checking the block-job execution:

<while the first "virsh blockcommit" is stuck, I can do this...>

inaddy@(kvm02):~$ virsh qemu-monitor-command guest --pretty -- '{ "execute": 
"query-block-jobs" }'
{
    "return": [
        {
            "io-status": "ok",
            "device": "drive-virtio-disk0",
            "busy": false,
            "len": 32212254720,
            "offset": 32212254720,
            "paused": false,
            "speed": 0,
            "type": "commit"
        }
    ],
    "id": "libvirt-511"
}

inaddy@(kvm02):~$ virsh blockjob guest /var/lib/libvirt/images/guest.1487158333
Block Commit: [100 %]

With "query-block-jobs" you can see if it finished (offset - len = 0).
Virsh is not doing this, so I have to finish the job by hand:

inaddy@(kvm02):~$ virsh qemu-monitor-command guest --pretty -- '{ "execute": 
"block-job-complete", "arguments": { "device": "drive-virtio-disk0" } }'
{
    "return": {

    },
    "id": "libvirt-859"
}

And the command returns:

inaddy@(kvm02):~$ virsh blockcommit --domain guest vda --base 
/var/lib/libvirt/images/guest.qcow2 --top 
/var/lib/libvirt/images/guest.1487158333 --wait --verbose
Block Commit: [100 %]
Commit complete

Problem is that QEMU has the correct answer for the backing file:

inaddy@(kvm02):~$ virsh qemu-monitor-command guest --pretty -- '{ "execute": 
"query-block" }'
{
    "return": [
        {
            "io-status": "ok",
            "device": "drive-virtio-disk0",
            "locked": false,
            "removable": false,
            "inserted": {
                "iops_rd": 0,
                "image": {
                    "virtual-size": 32212254720,
                    "filename": "/var/lib/libvirt/images/guest.qcow2",
                    "cluster-size": 65536,
                    "format": "qcow2",
                    "actual-size": 5328867328,
                    "format-specific": {
                        "type": "qcow2",
                        "data": {
                            "compat": "1.1",
                            "lazy-refcounts": false
                        }
                    },
                    "dirty-flag": false
                },
                "iops_wr": 0,
                "ro": false,
                "backing_file_depth": 0,
                "drv": "qcow2",
                "iops": 0,
                "bps_wr": 0,
                "encrypted": false,
                "bps": 0,
                "bps_rd": 0,
                "file": "/var/lib/libvirt/images/guest.qcow2",
                "encryption_key_missing": false
            },
            "type": "unknown"
        },
        {
            "io-status": "ok",
            "device": "drive-ide0-0-0",
            "locked": false,
            "removable": true,
            "tray_open": false,
            "type": "unknown"
        }
    ],
    "id": "libvirt-861"
}

But libvirt still thinks its using the old un-merged snapshot:

inaddy@(kvm02):~$ virsh domblklist --domain guest
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/guest.1487158333
hda        -

Will work on libvirt to fix this....

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1317491

Title:
  virsh blockcommit hangs at 100%

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1317491/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to