Jeff Dike <[EMAIL PROTECTED]> writes:

> Given that you need to find the dhcp client and count on it having the
> lease file open on a particular descriptor, I would call this not very
> nice.

/8->

I think I can alter mconsole_kern::mconsole_proc so that it returns
data for directories the same way as it does for files.

Is there a reason that can't be done?

If that can be done I can do this:

  for i in `mconsole myid proc | grep -E '^[0-9]'`
  do
     if [ mconsole myid proc/$i/cmd | grep dhclient ]
     then
        for j in `mconsole myid proc/$i/fd`
        do
          find_lease_data
        done
     fi
  done

which is better than guessing the pids and fds.

I agree, it would be better to implement /proc/ipaddress but I can
probably do this quicker.


> Why don't you know the IP address already, since you're responsible
> for providing it?

I might not be. More importantly I don't _want_ to be. I want to have
the VM ask for it with DHCP and for it to just work. There are 2
scenarios:

- the guest's network is attached via a tun to a software ethernet
  bridge on the host; the guest will dhcp to a foreign host

- you run a dhcp server on a tun attached to which is the uml_switch;
  the guest's dhcp to the host and you mangle the packets if you
  want them to leave the host

The whole reason for doing this is that you want to be able to have a
process wrapping UMLs. One example is build integrated testing of some
application; say a Java app. The ant script builds the classes and
then creates a vm running a java app server where they are deployed
and tested against. The vm is then thrown away.

But any process like that will require knowledge of the IP. In _very_
simple situations (maybe like the build one described) you can simply
decide on a range of IPs and use them. But in more complex situations
you absolutely need to integrate with DHCP.


> grepping around /proc shows /proc/net/arp.  The UML arp cache won't
> have its own IP, but the host's will, if there has been traffic
> recently.  You need to know the UML's MAC, so I dunno if this is
> helpful.

I'm aware of this... but it's only if there has been traffic between
guest and host recently.

You need to be able to boot the guest and hang until you know it's IP
without particularly configuring the guest to do anything (dhcp is
pretty normal, pinging your host OS isn't).


-- 
Nic Ferrier
http://www.tapsellferrier.co.uk   for all your tapsell ferrier needs

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to