qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] Disconecting /dev/nbdX leaves stale partitions and devi


From: Eric Blake
Subject: Re: [Qemu-block] Disconecting /dev/nbdX leaves stale partitions and device
Date: Fri, 27 Jul 2018 10:18:40 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/27/2018 10:07 AM, Richard W.M. Jones wrote:

Does it work also for running vms?

I've not actually tried, but it's built into the qemu raw-format block
driver (see qemu.git/block/raw-format.c) so it should work.  Note AIUI
it'll only work for raw format drives, not qcow2 which is probably a
critical drawback for oVirt.

Not necessarily. You can always layer BDS in qemu, so instead of the normal:

qcow2 -> file

or

raw -> file

you can instead request:

qcow2 -> raw -> file

from the command line and/or QMP, in order to interpret qcow2 format from a subset of the overall file with the raw layer doing the offset translation. Libvirt doesn't have enough hooks to declare such layering, though, so that may be a limitation.


Example use case:

1. Attach LUN or activate LV
2. wipe start of the block device, or write some header
3. Start guest with the block device with an offset, so guest see the disk
starting at offset.

What about patthrough? can we attach a host device to a guest using an
offset?

Passthrough likely not.  If qemu isn't processing each block of data
then the qemu block driver wouldn't be able to change offsets.

If you are trying to do passthrough of a host device, can you convince the kernel to expose a subset of the host device (aka a partition) as needed?

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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