qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hot replace of blockdev backend of paused VM?


From: L User
Subject: Hot replace of blockdev backend of paused VM?
Date: Sun, 12 Feb 2023 16:18:37 +0000

I'm running a VM by libvirt, and uses qemu/kvm as virtualizor. It has a block device backed by a real device (/dev/sda). Unfortunately the physical drive is not so solid so it just breaks the communication with host, resulting the removal of /dev/sda and a new host device /dev/sdb. The VM then just paused as expected, and keeps pausing back instantly after resuming.

I want to cheat the VM as if the drive is never failed, rather than forcing poweroff on it. I've tried QMP commands including `blockdev-del`, `blockdev-change-medium` and even `change-backing-file`. But all commands failed. Any hint on it? Or is this operation not possible?

Commands and outputs: (executed by `virsh qemu-monitor-command domain [command]`)
```
> {"execute":"blockdev-del","arguments":{"node-name":"libvirt-1-format"}}
< {"id":"libvirt-1","error":{"class":"GenericError","desc":"Node libvirt-1-format is in use"}}
> {"execute":"blockdev-del","arguments":{"node-name":"libvirt-1-backend"}}
< {"id":"libvirt-2","error":{"class":"GenericError","desc":"Failed to find node with node-name='libvirt-1-backend'"}}
> {"execute":"blockdev-change-medium","arguments":{"id":"/machine/peripheral/virtio-disk0/virtio-backend","filename":"/dev/sdb","format":"raw"}}
< {"id":"libvirt-3","error":{"class":"GenericError","desc":"Could not open '/dev/sdb': Operation not permitted"}}
```

reply via email to

[Prev in Thread] Current Thread [Next in Thread]