<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This is a followup to the excellent 
patch which allows static IP address assignment.  The problem with 
that patch is that you can only set the host name and cannot set a FQDN because 
dnsmasq will, as a security measure, not allow it unless --domain is 
specified.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This patch adds support for adding <domain 
name="my.domain" /> to the network config file.  With that stanza, one 
can then use FQDNs on the static host assignments, and this should be the domain 
reported for any clients that request it.  If <domain name .. ./> is 
not specified in the config file, then there is no change in 
behaviour.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>As a special case, you can also set the domain 
name to "#", whereupon dnsmasq interprets that to use the domain of 
the host OS.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Example default.xml:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><network><BR>  
<name>default</name><BR>  
<uuid>0098abb7-ff94-4df9-aa78-e4c3fe636a3d</uuid><BR>  
<bridge name="virbr0" /><BR>  <domain name="mynet.net" 
/><BR>  <forward/><BR>  <ip address="192.168.122.1" 
netmask="255.255.255.0"><BR>    
<dhcp><BR>      <host name="vm1.mynet.net" 
mac="00:16:3e:24:a5:84" ip="192.168.122.101" 
/><BR>      <host name='vm2.mynet.net' 
mac="00:16:3e:1f:9a:95" ip="192.168.122.102" 
/><BR>      <range start="192.168.122.2" 
end="192.168.122.99" /><BR>    </dhcp><BR>  
</ip><BR></network><BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here is the patch:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>diff -r -U 3 libvirt-0.4.4/src/network_conf.c 
libvirt-0.4.4jjr/src/network_conf.c<BR>--- 
libvirt-0.4.4/src/network_conf.c    2008-08-20 09:20:01.000000000 
-0400<BR>+++ libvirt-0.4.4jjr/src/network_conf.c 2008-09-06 14:03:56.000000000 
-0400<BR>@@ -326,6 +326,9 @@<BR>         
VIR_FREE(tmp);<BR>     }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>+    /* Parse network domain 
information */<BR>+    def->domain = virXPathString(conn, 
"string(./domain[1]/@name)", ctxt);<BR>+<BR>     /* Parse 
bridge information */<BR>     def->bridge = 
virXPathString(conn, "string(./bridge[1]/@name)", 
ctxt);<BR>     tmp = virXPathString(conn, 
"string(./bridge[1]/@stp)", ctxt);<BR>diff -r -U 3 
libvirt-0.4.4/src/network_conf.h libvirt-0.4.4jjr/src/network_conf.h<BR>--- 
libvirt-0.4.4/src/network_conf.h    2008-08-20 09:20:01.000000000 
-0400<BR>+++ libvirt-0.4.4jjr/src/network_conf.h 2008-09-06 14:03:56.000000000 
-0400<BR>@@ -57,6 +57,7 @@<BR>     char *name;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>     char 
*bridge;       /* Name of bridge device 
*/<BR>+    char *domain;<BR>     unsigned 
long delay;   /* Bridge forward delay (ms) 
*/<BR>     int stp : 1; /* Spanning tree protocol 
*/</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>diff -r -U 3 libvirt-0.4.4/src/qemu_driver.c 
libvirt-0.4.4jjr/src/qemu_driver.c<BR>--- 
libvirt-0.4.4/src/qemu_driver.c     2008-08-29 
03:20:02.000000000 -0400<BR>+++ libvirt-0.4.4jjr/src/qemu_driver.c  
2008-09-06 14:15:28.000000000 -0400<BR>@@ -1105,6 +1105,7 
@@<BR>         1 + /* 
--keep-in-foreground */<BR>         1 + 
/* --strict-order */<BR>         1 + /* 
--bind-interfaces */<BR>+        
(network->def->domain?2:0) + /* --domain name 
*/<BR>         2 + /* --pid-file "" 
*/<BR>         2 + /* --conf-file "" 
*/<BR>         /*2 + *//* --interface 
virbr0 */<BR>@@ -1136,6 +1137,11 @@<BR>     
APPEND_ARG(*argv, i++, "--strict-order");<BR>     
APPEND_ARG(*argv, i++, "--bind-interfaces");</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>+    if (network->def->domain) 
{<BR>+       APPEND_ARG(*argv, i++, 
"--domain");<BR>+       APPEND_ARG(*argv, i++, 
network->def->domain);<BR>+    
}<BR>+<BR>     APPEND_ARG(*argv, i++, 
"--pid-file");<BR>     APPEND_ARG(*argv, i++, 
"");</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>-JJ Reynolds</FONT></DIV></BODY></HTML>