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

Re: [libvirt] [libguestfs] Options for hotplugging

On Tue, Aug 21, 2012 at 10:32:51AM +0100, Daniel P. Berrange wrote:
> On Mon, Aug 20, 2012 at 10:07:43PM +0100, Richard W.M. Jones wrote:
> > In the first case (using "/dev/sdX" names), some magic already happens
> > translating these to the real names underneath, but currently that
> > magic is just "/dev/sdX" -> "/dev/vdX" for the virtio case.
> Ah I didn't realize that you already do device name remapping
> between what the kernel shows & what the API shows.

I maybe wasn't completely clear.  We only (currently) do the mapping
for parameters.  Return values contain the kernel device names.  So we
don't rewrite the output of guestfs_list_devices, we just suppress the
device corresponding to the appliance root filesystem.

This both is and isn't a problem at the moment.  If you treat the
returned strings as opaque blobs, you can pass them back to API

However if you want to print them it's a different matter, and lots of
tools try to canonicalize the names before printing them, eg: consider
the following code in an old version of virt-filesystems:


In fact this canonicalization code was used so widely, I added it to
the API in later versions:


For parameters, the mapping process is documented here:


The main reason for mapping parameters is so you can write guestfish
scripts which are portable across many versions of libguestfs, eg:

  guestfish -a foo.img -m /dev/sda1

will just work.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.

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