[libvirt] Issues with qemu-nbd over AF_UNIX and virDomainAttachDevice

Paolo Bonzini pbonzini at redhat.com
Mon May 27 14:47:54 UTC 2013


Il 27/05/2013 15:41, Deepak C Shetty ha scritto:
>>
> 
> Tried putting the above nbdxml usign virsh edit <domname> as an addnl
> disk and domain booted fine
> It throws the same error if u add format=qcow2 under <driver>...
> 
> So looks like the right way to use NBD is *not* to specify format and
> let QEMU autosense it ?

No, the format for NBD will in general be raw.  qemu-nbd takes care of
qcow2.  This is because NBD lets you make the VM description agnostic of
the format, which in general is desirable.  Hence, raw is what you
should specify most of the time; leaving format probing to QEMU will
usually work but it is highly insecure.

Older versions of qemu-nbd will always autosense the format; but because
autosensing is insecure, newer versions (1.4.1 and newer) have a "-f"
option to specify the format manually.

In the newer versions that have "-f", the same option can be used if you
want to specify the format option in the device XML; to do so, specify
"-f raw" and add back the <driver> element to the XML.  This however is
generally not what you want to do.

Paolo




More information about the libvir-list mailing list