[Libguestfs] [PATCH API PROPOSAL 0/2] inspection: Add network interfaces to inspection data.

Richard W.M. Jones rjones at redhat.com
Tue Oct 2 09:10:55 UTC 2018


On Mon, Oct 01, 2018 at 07:00:17PM +0200, Pino Toscano wrote:
> On Monday, 1 October 2018 13:28:26 CEST Richard W.M. Jones wrote:
> > As part of the fix for:
> > 
> > https://bugzilla.redhat.com/show_bug.cgi?id=1626503
> > 
> > I'm proposing to add two new APIs to fetch information about the list
> > of network interfaces of an existing guest.  These two patches outline
> > the proposed API but with no implementation or tests.  However they
> > can be applied and compiled.
> > 
> > Please see the second patch for the proposed API.
> > 
> > I have a mostly working implementation for Red Hat-style ifcfg-*
> > files, and both Debian /etc/network/interfaces and Windows registry
> > look do-able using the same architecture.
> 
> It is hard to see whether this API is enough to cover the use case,
> without an actual implementation.
> 
> I remember RFCs for virt-builder/virt-customize to change the network
> configuration of a guest, and even just determining the actual
> configuration that a guest will have is very hard: you can have
> multiple network-related daemon installed in the guest, different
> available configurations (even stale ones, if they were not cleaned
> when their system was removed), and so on.
> Hence, I am notsure whether trying to get any data is better than just
> not provide any at all...

I posted v2 of this patch last night which includes a single working
implementation, but I also meant to reply to this message with some
more detail.

I'm not expecting we'll be able to model every detail of guest network
configuration.  However a simple list of interfaces is useful for
several purposes:

* The virt-v2v bug (see above).

* Answering the "what IP does the guest have" question which comes up
  again and again.

* A way to tie external devices presented by the hypervisor to
  internal device drivers provided by the guest.

For Linux it's true that multiple network services can be installed,
although only one is likely to be used and it's not too much work to
find out which one is used (although the current patch set does punt
on this question and makes some assumptions).  For Windows the answer
is much clearer and simpler: there's just a list of network devices in
the registry and that's what we present through the inspection data.

Another thing which may not be clear from the patch posted: The list
of parameters should be canonicalized, so that for example the Windows
registry key "IPAddress" is translated to "ipaddr".  In all cases I'll
try to use the name of the thing used by the ifcfg-* files.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list