Enclosed is a cleanup patch I applied, it corrects the XML api generation,
fixes warning in the XSLT stylesheet, add comments to a number of internal
functions, makes most function of the QEmu back-end static, fixes a few bugs
found in the way.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/
Index: docs/apibuild.py
===================================================================
RCS file: /data/cvs/libxen/docs/apibuild.py,v
retrieving revision 1.18
diff -u -p -r1.18 apibuild.py
--- docs/apibuild.py    26 Jun 2007 22:51:01 -0000      1.18
+++ docs/apibuild.py    29 Jun 2007 13:08:37 -0000
@@ -51,6 +51,17 @@ ignored_files = {
   "console.c": "internal code",
   "event.h": "internal code",
   "event.c": "internal code",
+  "iptables.h": "internal code",
+  "iptables.c": "internal code",
+  "buf.h": "internal code",
+  "buf.c": "internal code",
+  "qemu_driver.c": "internal code",
+  "remote_internal.c": "internal code",
+  "bridge.h": "internal code",
+  "bridge.c": "internal code",
+  "uuid.h": "internal code",
+  "uuid.c": "internal code",
+
 }
 
 ignored_words = {
Index: docs/newapi.xsl
===================================================================
RCS file: /data/cvs/libxen/docs/newapi.xsl,v
retrieving revision 1.6
diff -u -p -r1.6 newapi.xsl
--- docs/newapi.xsl     9 Feb 2006 17:45:12 -0000       1.6
+++ docs/newapi.xsl     29 Jun 2007 13:08:37 -0000
@@ -476,20 +476,19 @@
   </xsl:template>
 
   <xsl:template name="docomponents">
-    <xsl:param name="mode"/>
-    <xsl:apply-templates select="[EMAIL PROTECTED]'macro']" mode="$mode">
+    <xsl:apply-templates select="[EMAIL PROTECTED]'macro']">
       <xsl:sort select='@symbol'/>
     </xsl:apply-templates>
-    <xsl:apply-templates select="[EMAIL PROTECTED]'enum']" mode="$mode">
+    <xsl:apply-templates select="[EMAIL PROTECTED]'enum']">
       <xsl:sort select='@symbol'/>
     </xsl:apply-templates>
-    <xsl:apply-templates select="[EMAIL PROTECTED]'typedef']" mode="$mode">
+    <xsl:apply-templates select="[EMAIL PROTECTED]'typedef']">
       <xsl:sort select='@symbol'/>
     </xsl:apply-templates>
-    <xsl:apply-templates select="[EMAIL PROTECTED]'struct']" mode="$mode">
+    <xsl:apply-templates select="[EMAIL PROTECTED]'struct']">
       <xsl:sort select='@symbol'/>
     </xsl:apply-templates>
-    <xsl:apply-templates select="[EMAIL PROTECTED]'function']" mode="$mode">
+    <xsl:apply-templates select="[EMAIL PROTECTED]'function']">
       <xsl:sort select='@symbol'/>
     </xsl:apply-templates>
   </xsl:template>
Index: src/bridge.c
===================================================================
RCS file: /data/cvs/libxen/src/bridge.c,v
retrieving revision 1.1
diff -u -p -r1.1 bridge.c
--- src/bridge.c        27 Jun 2007 00:12:29 -0000      1.1
+++ src/bridge.c        29 Jun 2007 13:08:37 -0000
@@ -53,6 +53,15 @@ struct _brControl {
     int fd;
 };
 
+/**
+ * brInit:
+ * @ctlp: pointer to bridge control return value
+ *
+ * Initialize a new bridge layer. In case of success
+ * @ctlp will contain a pointer to the new bridge structure.
+ *
+ * Returns 0 in case of success, an error code otherwise.
+ */
 int
 brInit(brControl **ctlp)
 {
@@ -74,14 +83,22 @@ brInit(brControl **ctlp)
     }
 
     *ctlp = (brControl *)malloc(sizeof(struct _brControl));
-    if (!*ctlp)
+    if (!*ctlp) {
+        close(fd);
         return ENOMEM;
+    }
 
     (*ctlp)->fd = fd;
 
     return 0;
 }
 
+/**
+ * brShutdown:
+ * @ctl: pointer to a bridge control
+ *
+ * Shutdown the bridge layer and deallocate the associated structures
+ */
 void
 brShutdown(brControl *ctl)
 {
@@ -94,6 +111,19 @@ brShutdown(brControl *ctl)
     free(ctl);
 }
 
+/**
+ * brAddBridge:
+ * @ctl: bridge control pointer
+ * @nameOrFmt: the bridge name (or name template)
+ * @name: pointer to @maxlen bytes to store the bridge name
+ * @maxlen: size of @name array
+ *
+ * This function register a new bridge, @nameOrFmt can be either
+ * a fixed name or a name template with '%d' for dynamic name allocation.
+ * in either case the final name for the bridge will be stored in @name.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
 int
 brAddBridge(brControl *ctl,
             const char *nameOrFmt,
@@ -141,6 +171,15 @@ brAddBridge(brControl *ctl,
     return errno;
 }
 
+/**
+ * brDeleteBridge:
+ * @ctl: bridge control pointer
+ * @name: the bridge name
+ *
+ * Remove a bridge from the layer.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
 int
 brDeleteBridge(brControl *ctl,
                const char *name)
@@ -177,6 +216,16 @@ brAddDelInterface(brControl *ctl,
     return ioctl(ctl->fd, cmd, &ifr) == 0 ? 0 : errno;
 }
 
+/**
+ * brAddInterface:
+ * @ctl: bridge control pointer
+ * @bridge: the bridge name
+ * @iface: the network interface name
+ * 
+ * Adds an interface to a bridge
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
 int
 brAddInterface(brControl *ctl,
                const char *bridge,
@@ -185,6 +234,16 @@ brAddInterface(brControl *ctl,
     return brAddDelInterface(ctl, SIOCBRADDIF, bridge, iface);
 }
 
+/**
+ * brDeleteInterface:
+ * @ctl: bridge control pointer
+ * @bridge: the bridge name
+ * @iface: the network interface name
+ * 
+ * Removes an interface from a bridge
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
 int
 brDeleteInterface(brControl *ctl,
                   const char *bridge,
@@ -194,6 +253,21 @@ brDeleteInterface(brControl *ctl,
 }
 
 
+/**
+ * brAddTap:
+ * @ctl: bridge control pointer
+ * @bridge: the bridge name
+ * @ifname: the interface name (or name template)
+ * @maxlen: size of @ifname array
+ * @tapfd: file descriptor return value for the new tap device
+ *
+ * This function reates a new tap device on a bridge. @ifname can be either
+ * a fixed name or a name template with '%d' for dynamic name allocation.
+ * in either case the final name for the bridge will be stored in @ifname
+ * and the associated file descriptor in @tapfd.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
 int
 brAddTap(brControl *ctl,
          const char *bridge,
@@ -259,6 +333,16 @@ brAddTap(brControl *ctl,
     return errno;
 }
 
+/**
+ * brSetInterfaceUp:
+ * @ctl: bridge control pointer
+ * @ifname: the interface name
+ * @up: 1 for up, 0 for down
+ *
+ * Function to control if an interface is activated (up, 1) or not (down, 0)
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
 int
 brSetInterfaceUp(brControl *ctl,
                  const char *ifname,
@@ -294,6 +378,16 @@ brSetInterfaceUp(brControl *ctl,
     return 0;
 }
 
+/**
+ * brGetInterfaceUp:
+ * @ctl: bridge control pointer
+ * @ifname: the interface name
+ * @up: where to store the status
+ *
+ * Function to query if an interface is activated (1) or not (0)
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
 int
 brGetInterfaceUp(brControl *ctl,
                  const char *ifname,
@@ -302,7 +396,7 @@ brGetInterfaceUp(brControl *ctl,
     struct ifreq ifr;
     int len;
 
-    if (!ctl || !ifname)
+    if (!ctl || !ifname || !up)
         return EINVAL;
 
     if ((len = strlen(ifname)) >= BR_IFNAME_MAXLEN)
@@ -392,6 +486,19 @@ brGetInetAddr(brControl *ctl,
     return 0;
 }
 
+/**
+ * brSetInetAddress:
+ * @ctl: bridge control pointer
+ * @ifname: the interface name
+ * @addr: the string representation of the IP adress
+ *
+ * Function to bind the interface to an IP address, it should handle
+ * IPV4 and IPv6. The string for addr would be of the form
+ * "ddd.ddd.ddd.ddd" assuming the common IPv4 format.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
+
 int
 brSetInetAddress(brControl *ctl,
                  const char *ifname,
@@ -400,6 +507,20 @@ brSetInetAddress(brControl *ctl,
     return brSetInetAddr(ctl, ifname, SIOCSIFADDR, addr);
 }
 
+/**
+ * brGetInetAddress:
+ * @ctl: bridge control pointer
+ * @ifname: the interface name
+ * @addr: the array for the string representation of the IP adress
+ * @maxlen: size of @addr in bytes
+ *
+ * Function to get the IP address of an interface, it should handle
+ * IPV4 and IPv6. The returned string for addr would be of the form
+ * "ddd.ddd.ddd.ddd" assuming the common IPv4 format.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
+
 int
 brGetInetAddress(brControl *ctl,
                  const char *ifname,
@@ -409,6 +530,19 @@ brGetInetAddress(brControl *ctl,
     return brGetInetAddr(ctl, ifname, SIOCGIFADDR, addr, maxlen);
 }
 
+/**
+ * brSetInetNetmask:
+ * @ctl: bridge control pointer
+ * @ifname: the interface name
+ * @addr: the string representation of the netmask
+ *
+ * Function to set the netmask of an interface, it should handle
+ * IPV4 and IPv6 forms. The string for addr would be of the form
+ * "ddd.ddd.ddd.ddd" assuming the common IPv4 format.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
+
 int
 brSetInetNetmask(brControl *ctl,
                  const char *ifname,
@@ -417,6 +551,20 @@ brSetInetNetmask(brControl *ctl,
     return brSetInetAddr(ctl, ifname, SIOCSIFNETMASK, addr);
 }
 
+/**
+ * brGetInetNetmask:
+ * @ctl: bridge control pointer
+ * @ifname: the interface name
+ * @addr: the array for the string representation of the netmask
+ * @maxlen: size of @addr in bytes
+ *
+ * Function to get the netmask of an interface, it should handle
+ * IPV4 and IPv6. The returned string for addr would be of the form
+ * "ddd.ddd.ddd.ddd" assuming the common IPv4 format.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
+
 int
 brGetInetNetmask(brControl *ctl,
                  const char *ifname,
@@ -463,6 +611,17 @@ brctlSpawn(char * const *argv)
     return (WIFEXITED(status) && WEXITSTATUS(status) == 0) ? 0 : EINVAL;
 }
 
+/**
+ * brSetForwardDelay:
+ * @ctl: bridge control pointer
+ * @bridge: the bridge name
+ * @delay: delay in seconds
+ *
+ * Set the bridge forward delay
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
+ 
 int
 brSetForwardDelay(brControl *ctl ATTRIBUTE_UNUSED,
                   const char *bridge,
@@ -512,6 +671,17 @@ brSetForwardDelay(brControl *ctl ATTRIBU
     return retval;
 }
 
+/**
+ * brSetEnableSTP:
+ * @ctl: bridge control pointer
+ * @bridge: the bridge name
+ * @enable: 1 to enable, 0 to disable
+ *
+ * Control whether the bridge participates in the spanning tree protocol,
+ * in general don't disable it without good reasons.
+ *
+ * Returns 0 in case of success or an errno code in case of failure.
+ */
 int
 brSetEnableSTP(brControl *ctl ATTRIBUTE_UNUSED,
                const char *bridge,
@@ -534,7 +704,7 @@ brSetEnableSTP(brControl *ctl ATTRIBUTE_
     if (!(argv[n++] = strdup(BRCTL_PATH)))
         goto error;
 
-    if (!(argv[n++] = strdup("setfd")))
+    if (!(argv[n++] = strdup("stp")))
         goto error;
 
     if (!(argv[n++] = strdup(bridge)))
Index: src/bridge.h
===================================================================
RCS file: /data/cvs/libxen/src/bridge.h,v
retrieving revision 1.1
diff -u -p -r1.1 bridge.h
--- src/bridge.h        27 Jun 2007 00:12:29 -0000      1.1
+++ src/bridge.h        29 Jun 2007 13:08:37 -0000
@@ -25,7 +25,16 @@
 #include <net/if.h>
 #include <netinet/in.h>
 
+/**
+ * BR_IFNAME_MAXLEN:
+ * maximum size in byte of the name for an interface
+ */
 #define BR_IFNAME_MAXLEN    IF_NAMESIZE
+
+/**
+ * BR_INET_ADDR_MAXLEN:
+ * maximum size in bytes for an inet addess name
+ */
 #define BR_INET_ADDR_MAXLEN INET_ADDRSTRLEN
 
 typedef struct _brControl brControl;
Index: src/buf.c
===================================================================
RCS file: /data/cvs/libxen/src/buf.c,v
retrieving revision 1.1
diff -u -p -r1.1 buf.c
--- src/buf.c   26 Jun 2007 22:33:22 -0000      1.1
+++ src/buf.c   29 Jun 2007 13:08:38 -0000
@@ -83,6 +83,14 @@ virBufferAdd(virBufferPtr buf, const cha
     return (0);
 }
 
+/**
+ * virBufferNew:
+ * @size:  creation size in bytes
+ *
+ * Creates a new buffer
+ *
+ * Returns a pointer to the buffer or NULL in case of error
+ */
 virBufferPtr
 virBufferNew(unsigned int size)
 {
@@ -99,6 +107,13 @@ virBufferNew(unsigned int size)
     return buf;
 }
 
+/**
+ * virBufferFree:
+ * @buf: the buffer to deallocate
+ *
+ * Free the set of resources used by a buffer.
+ */
+
 void
 virBufferFree(virBufferPtr buf)
 {
@@ -113,12 +128,19 @@ virBufferFree(virBufferPtr buf)
  * virBufferContentAndFree:
  * @buf: Buffer
  *
- * Return the content from the buffer and free (only) the buffer structure.
+ * Get the content from the buffer and free (only) the buffer structure.
+ *
+ * Returns the buffer content or NULL in case of error.
  */
 char *
 virBufferContentAndFree (virBufferPtr buf)
 {
-    char *content = buf->content;
+    char *content;
+    
+    if (buf == NULL)
+        return(NULL);
+
+    content = buf->content;
 
     free (buf);
     return content;
@@ -128,7 +150,7 @@ virBufferContentAndFree (virBufferPtr bu
  * virBufferVSprintf:
  * @buf:  the buffer to dump
  * @format:  the format
- * @argptr:  the variable list of arguments
+ * @...:  the variable list of arguments
  *
  * Do a formatted print to an XML buffer.
  *
@@ -165,7 +187,7 @@ virBufferVSprintf(virBufferPtr buf, cons
 /**
  * virBufferStrcat:
  * @buf:  the buffer to dump
- * @argptr:  the variable list of strings, the last argument must be NULL
+ * @...:  the variable list of strings, the last argument must be NULL
  *
  * Concatenate strings to an XML buffer.
  *
Index: src/iptables.c
===================================================================
RCS file: /data/cvs/libxen/src/iptables.c,v
retrieving revision 1.1
diff -u -p -r1.1 iptables.c
--- src/iptables.c      27 Jun 2007 00:12:29 -0000      1.1
+++ src/iptables.c      29 Jun 2007 13:08:38 -0000
@@ -530,6 +530,13 @@ iptablesAddRemoveRule(iptRules *rules, i
     return retval;
 }
 
+/**
+ * iptablesContextNew:
+ *
+ * Create a new IPtable context
+ *
+ * Returns a pointer to the new structure or NULL in case of error
+ */
 iptablesContext *
 iptablesContextNew(void)
 {
@@ -554,6 +561,12 @@ iptablesContextNew(void)
     return NULL;
 }
 
+/**
+ * iptablesContextFree:
+ * @ctx: pointer to the IP table context
+ *
+ * Free the ressources associated with an IP table context
+ */
 void
 iptablesContextFree(iptablesContext *ctx)
 {
@@ -597,6 +610,12 @@ iptRulesReload(iptRules *rules)
                      rules->rules[i].rule, rules->chain, rules->table, 
strerror(retval));
 }
 
+/**
+ * iptablesReloadRules:
+ * @ctx: pointer to the IP table context
+ *
+ * Reloads all the IP table rules associated to a context
+ */
 void
 iptablesReloadRules(iptablesContext *ctx)
 {
@@ -626,6 +645,18 @@ iptablesInput(iptablesContext *ctx,
                                  NULL);
 }
 
+/**
+ * iptablesAddTcpInput:
+ * @ctx: pointer to the IP table context
+ * @iface: the interface name
+ * @port: the TCP port to add
+ *
+ * Add an input to the IP table allowing access to the given @port on
+ * the given @iface interface for TCP packets
+ *
+ * Returns 0 in case of success or an error code in case of error
+ */
+
 int
 iptablesAddTcpInput(iptablesContext *ctx,
                     const char *iface,
@@ -634,6 +665,17 @@ iptablesAddTcpInput(iptablesContext *ctx
     return iptablesInput(ctx, iface, port, ADD, 1);
 }
 
+/**
+ * iptablesRemoveTcpInput:
+ * @ctx: pointer to the IP table context
+ * @iface: the interface name
+ * @port: the TCP port to remove
+ *
+ * Removes an input from the IP table, hence forbiding access to the given
+ * @port on the given @iface interface for TCP packets
+ *
+ * Returns 0 in case of success or an error code in case of error
+ */
 int
 iptablesRemoveTcpInput(iptablesContext *ctx,
                        const char *iface,
@@ -642,6 +684,18 @@ iptablesRemoveTcpInput(iptablesContext *
     return iptablesInput(ctx, iface, port, REMOVE, 1);
 }
 
+/**
+ * iptablesAddUdpInput:
+ * @ctx: pointer to the IP table context
+ * @iface: the interface name
+ * @port: the UDP port to add
+ *
+ * Add an input to the IP table allowing access to the given @port on
+ * the given @iface interface for UDP packets
+ *
+ * Returns 0 in case of success or an error code in case of error
+ */
+
 int
 iptablesAddUdpInput(iptablesContext *ctx,
                     const char *iface,
@@ -650,6 +704,17 @@ iptablesAddUdpInput(iptablesContext *ctx
     return iptablesInput(ctx, iface, port, ADD, 0);
 }
 
+/**
+ * iptablesRemoveUdpInput:
+ * @ctx: pointer to the IP table context
+ * @iface: the interface name
+ * @port: the UDP port to remove
+ *
+ * Removes an input from the IP table, hence forbiding access to the given
+ * @port on the given @iface interface for UDP packets
+ *
+ * Returns 0 in case of success or an error code in case of error
+ */
 int
 iptablesRemoveUdpInput(iptablesContext *ctx,
                        const char *iface,
@@ -687,6 +752,19 @@ iptablesForwardAllowOut(iptablesContext 
     }
 }
 
+/**
+ * iptablesAddForwardAllowOut:
+ * @ctx: pointer to the IP table context
+ * @network: the source network name
+ * @iface: the source interface name
+ * @physdev: the physical output device
+ * 
+ * Add a rule to the IP table context to allow the traffic for the
+ * network @network via interface @iface to be forwarded to
+ * @physdev device. This allow the outbound traffic on a bridge.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesAddForwardAllowOut(iptablesContext *ctx,
                             const char *network,
@@ -696,6 +774,19 @@ iptablesAddForwardAllowOut(iptablesConte
     return iptablesForwardAllowOut(ctx, network, iface, physdev, ADD);
 }
 
+/**
+ * iptablesRemoveForwardAllowOut:
+ * @ctx: pointer to the IP table context
+ * @network: the source network name
+ * @iface: the source interface name
+ * @physdev: the physical output device
+ * 
+ * Remove a rule from the IP table context hence forbidding forwarding
+ * of the traffic for the network @network via interface @iface
+ * to the @physdev device output. This stops the outbound traffic on a bridge.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesRemoveForwardAllowOut(iptablesContext *ctx,
                                const char *network,
@@ -738,6 +829,19 @@ iptablesForwardAllowIn(iptablesContext *
     }
 }
 
+/**
+ * iptablesAddForwardAllowIn:
+ * @ctx: pointer to the IP table context
+ * @network: the source network name
+ * @iface: the output interface name
+ * @physdev: the physical input device or NULL
+ * 
+ * Add rules to the IP table context to allow the traffic for the
+ * network @network on @physdev device to be forwarded to
+ * interface @iface. This allow the inbound traffic on a bridge.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesAddForwardAllowIn(iptablesContext *ctx,
                           const char *network,
@@ -747,6 +851,19 @@ iptablesAddForwardAllowIn(iptablesContex
     return iptablesForwardAllowIn(ctx, network, iface, physdev, ADD);
 }
 
+/**
+ * iptablesRemoveForwardAllowIn:
+ * @ctx: pointer to the IP table context
+ * @network: the source network name
+ * @iface: the output interface name
+ * @physdev: the physical input device or NULL
+ * 
+ * Remove rules from the IP table context hence forbidding the traffic for
+ * network @network on @physdev device to be forwarded to
+ * interface @iface. This stops the inbound traffic on a bridge.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesRemoveForwardAllowIn(iptablesContext *ctx,
                              const char *network,
@@ -773,12 +890,34 @@ iptablesForwardAllowCross(iptablesContex
                                  NULL);
 }
 
+/**
+ * iptablesAddForwardAllowCross:
+ * @ctx: pointer to the IP table context
+ * @iface: the input/output interface name
+ *
+ * Add rules to the IP table context to allow traffic to cross that
+ * interface. It allows all traffic between guests on the same bridge
+ * represented by that interface.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesAddForwardAllowCross(iptablesContext *ctx,
                              const char *iface) {
     return iptablesForwardAllowCross(ctx, iface, ADD);
 }
 
+/**
+ * iptablesRemoveForwardAllowCross:
+ * @ctx: pointer to the IP table context
+ * @iface: the input/output interface name
+ *
+ * Remove rules to the IP table context to block traffic to cross that
+ * interface. It forbids traffic between guests on the same bridge
+ * represented by that interface.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesRemoveForwardAllowCross(iptablesContext *ctx,
                                 const char *iface) {
@@ -801,6 +940,16 @@ iptablesForwardRejectOut(iptablesContext
                                      NULL);
 }
 
+/**
+ * iptablesAddForwardRejectOut:
+ * @ctx: pointer to the IP table context
+ * @iface: the output interface name
+ *
+ * Add rules to the IP table context to forbid all traffic to that
+ * interface. It forbids forwarding from the bridge to that interface.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesAddForwardRejectOut(iptablesContext *ctx,
                             const char *iface)
@@ -808,6 +957,16 @@ iptablesAddForwardRejectOut(iptablesCont
     return iptablesForwardRejectOut(ctx, iface, ADD);
 }
 
+/**
+ * iptablesRemoveForwardRejectOut:
+ * @ctx: pointer to the IP table context
+ * @iface: the output interface name
+ *
+ * Remove rules from the IP table context forbidding all traffic to that
+ * interface. It reallow forwarding from the bridge to that interface.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesRemoveForwardRejectOut(iptablesContext *ctx,
                                const char *iface)
@@ -833,6 +992,16 @@ iptablesForwardRejectIn(iptablesContext 
                                  NULL);
 }
 
+/**
+ * iptablesAddForwardRejectIn:
+ * @ctx: pointer to the IP table context
+ * @iface: the input interface name
+ *
+ * Add rules to the IP table context to forbid all traffic from that
+ * interface. It forbids forwarding from that interface to the bridge.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesAddForwardRejectIn(iptablesContext *ctx,
                            const char *iface)
@@ -840,6 +1009,16 @@ iptablesAddForwardRejectIn(iptablesConte
     return iptablesForwardRejectIn(ctx, iface, ADD);
 }
 
+/**
+ * iptablesRemoveForwardRejectIn:
+ * @ctx: pointer to the IP table context
+ * @iface: the input interface name
+ *
+ * Remove rules from the IP table context forbidding all traffic from that
+ * interface. It allows forwarding from that interface to the bridge.
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesRemoveForwardRejectIn(iptablesContext *ctx,
                               const char *iface)
@@ -873,6 +1052,18 @@ iptablesForwardMasquerade(iptablesContex
     }
 }
 
+/**
+ * iptablesAddForwardMasquerade:
+ * @ctx: pointer to the IP table context
+ * @network: the source network name
+ * @physdev: the physical input device or NULL
+ * 
+ * Add rules to the IP table context to allow masquerading
+ * network @network on @physdev. This allow the bridge to
+ * masquerade for that network (on @physdev).
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesAddForwardMasquerade(iptablesContext *ctx,
                              const char *network,
@@ -881,6 +1072,18 @@ iptablesAddForwardMasquerade(iptablesCon
     return iptablesForwardMasquerade(ctx, network, physdev, ADD);
 }
 
+/**
+ * iptablesRemoveForwardMasquerade:
+ * @ctx: pointer to the IP table context
+ * @network: the source network name
+ * @physdev: the physical input device or NULL
+ * 
+ * Remove rules from the IP table context to stop masquerading
+ * network @network on @physdev. This stops the bridge from
+ * masquerading for that network (on @physdev).
+ *
+ * Returns 0 in case of success or an error code otherwise
+ */
 int
 iptablesRemoveForwardMasquerade(iptablesContext *ctx,
                                 const char *network,
Index: src/libvirt.c
===================================================================
RCS file: /data/cvs/libxen/src/libvirt.c,v
retrieving revision 1.83
diff -u -p -r1.83 libvirt.c
--- src/libvirt.c       27 Jun 2007 00:12:29 -0000      1.83
+++ src/libvirt.c       29 Jun 2007 13:08:38 -0000
@@ -684,7 +684,7 @@ virConnectNumOfDomains(virConnectPtr con
  * virDomainGetConnect:
  * @dom: pointer to a domain
  *
- * Returns the connection pointer associated with a domain.  The
+ * Provides the connection pointer associated with a domain.  The
  * reference counter on the connection is not increased by this
  * call.
  *
@@ -2195,7 +2195,7 @@ virDomainDetachDevice(virDomainPtr domai
  * virNetworkGetConnect:
  * @net: pointer to a network
  *
- * Returns the connection pointer associated with a network.  The
+ * Provides the connection pointer associated with a network.  The
  * reference counter on the connection is not increased by this
  * call.
  *
Index: src/qemu_driver.c
===================================================================
RCS file: /data/cvs/libxen/src/qemu_driver.c,v
retrieving revision 1.1
diff -u -p -r1.1 qemu_driver.c
--- src/qemu_driver.c   27 Jun 2007 00:12:29 -0000      1.1
+++ src/qemu_driver.c   29 Jun 2007 13:08:38 -0000
@@ -53,6 +53,9 @@
 #include "qemu_driver.h"
 #include "qemu_conf.h"
 
+static int qemudShutdown(void);
+
+
 #define qemudLog(level, msg...) fprintf(stderr, msg)
 
 static int qemudSetCloseExec(int fd) {
@@ -84,16 +87,16 @@ static int qemudSetNonBlock(int fd) {
 
 
 static void qemudDispatchVMEvent(int fd, int events, void *opaque);
-int qemudStartVMDaemon(struct qemud_driver *driver,
+static int qemudStartVMDaemon(struct qemud_driver *driver,
                        struct qemud_vm *vm);
 
-int qemudShutdownVMDaemon(struct qemud_driver *driver,
+static int qemudShutdownVMDaemon(struct qemud_driver *driver,
                           struct qemud_vm *vm);
 
-int qemudStartNetworkDaemon(struct qemud_driver *driver,
+static int qemudStartNetworkDaemon(struct qemud_driver *driver,
                             struct qemud_network *network);
 
-int qemudShutdownNetworkDaemon(struct qemud_driver *driver,
+static int qemudShutdownNetworkDaemon(struct qemud_driver *driver,
                                struct qemud_network *network);
 
 struct qemud_driver *qemu_driver = NULL;
@@ -135,7 +138,13 @@ void qemudAutostartConfigs(struct qemud_
     }
 }
 
-int qemudStartup(void) {
+/**
+ * qemudStartup:
+ *
+ * Initialization function for the QEmu daemon
+ */
+static int
+qemudStartup(void) {
     uid_t uid = geteuid();
     struct passwd *pw;
     char *base = NULL;
@@ -203,7 +212,14 @@ int qemudStartup(void) {
     return -1;
 }
 
-int qemudReload(void) {
+/**
+ * qemudReload:
+ *
+ * Function to restart the QEmu daemon, it will recheck the configuration
+ * files and update its state and the networking
+ */
+static int
+qemudReload(void) {
     qemudScanConfigs(qemu_driver);
 
      if (qemu_driver->iptables) {
@@ -216,7 +232,16 @@ int qemudReload(void) {
     return 0;
 }
 
-int qemudActive(void) {
+/**
+ * qemudActive:
+ *
+ * Checks if the QEmu daemon is active, i.e. has an active domain or
+ * an active network
+ *
+ * Returns 1 if active, 0 otherwise
+ */
+static int
+qemudActive(void) {
     /* If we've any active networks or guests, then we
      * mark this driver as active
      */
@@ -228,7 +253,13 @@ int qemudActive(void) {
     return 0;
 }
 
-int qemudShutdown() {
+/**
+ * qemudShutdown:
+ *
+ * Shutdown the QEmu daemon, it will stop all active domains and networks
+ */
+static int
+qemudShutdown(void) {
     struct qemud_vm *vm;
     struct qemud_network *network;
 
@@ -602,7 +633,7 @@ static int qemudNextFreeVNCPort(struct q
     return -1;
 }
 
-int qemudStartVMDaemon(struct qemud_driver *driver,
+static int qemudStartVMDaemon(struct qemud_driver *driver,
                        struct qemud_vm *vm) {
     char **argv = NULL, **tmp;
     int i;
@@ -754,7 +785,7 @@ static int qemudVMData(struct qemud_driv
 }
 
 
-int qemudShutdownVMDaemon(struct qemud_driver *driver, struct qemud_vm *vm) {
+static int qemudShutdownVMDaemon(struct qemud_driver *driver, struct qemud_vm 
*vm) {
     if (!qemudIsActiveVM(vm))
         return 0;
 
@@ -1122,7 +1153,7 @@ qemudEnableIpForwarding(void)
 #undef PROC_IP_FORWARD
 }
 
-int qemudStartNetworkDaemon(struct qemud_driver *driver,
+static int qemudStartNetworkDaemon(struct qemud_driver *driver,
                             struct qemud_network *network) {
     const char *name;
     int err;
@@ -1233,7 +1264,7 @@ int qemudStartNetworkDaemon(struct qemud
 }
 
 
-int qemudShutdownNetworkDaemon(struct qemud_driver *driver,
+static int qemudShutdownNetworkDaemon(struct qemud_driver *driver,
                                struct qemud_network *network) {
     int err;
 
@@ -1452,7 +1483,7 @@ static int qemudGetCPUInfo(unsigned int 
     return 0;
 }
 
-virDrvOpenStatus qemudOpen(virConnectPtr conn,
+static virDrvOpenStatus qemudOpen(virConnectPtr conn,
                            const char *name,
                            int flags ATTRIBUTE_UNUSED) {
     uid_t uid = getuid();
@@ -1503,7 +1534,7 @@ static int qemudGetMaxVCPUs(virConnectPt
     return -1;
 }
 
-int qemudGetNodeInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
+static int qemudGetNodeInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
                      virNodeInfoPtr node) {
     struct utsname info;
 
@@ -1522,7 +1553,7 @@ int qemudGetNodeInfo(virConnectPtr conn 
     return 0;
 }
 
-char *qemudGetCapabilities(virConnectPtr conn ATTRIBUTE_UNUSED) {
+static char *qemudGetCapabilities(virConnectPtr conn ATTRIBUTE_UNUSED) {
     struct utsname utsname;
     int i, j, r;
     int have_kqemu = 0;
@@ -1710,7 +1741,7 @@ static int qemudGetProcessInfo(unsigned 
 }
 
 
-virDomainPtr qemudDomainLookupByID(virConnectPtr conn,
+static virDomainPtr qemudDomainLookupByID(virConnectPtr conn,
                                    int id) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     struct qemud_vm *vm = qemudFindVMByID(driver, id);
@@ -1730,7 +1761,7 @@ virDomainPtr qemudDomainLookupByID(virCo
     dom->id = vm->id;
     return dom;
 }
-virDomainPtr qemudDomainLookupByUUID(virConnectPtr conn,
+static virDomainPtr qemudDomainLookupByUUID(virConnectPtr conn,
                                      const unsigned char *uuid) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     struct qemud_vm *vm = qemudFindVMByUUID(driver, uuid);
@@ -1750,7 +1781,7 @@ virDomainPtr qemudDomainLookupByUUID(vir
     dom->id = vm->id;
     return dom;
 }
-virDomainPtr qemudDomainLookupByName(virConnectPtr conn,
+static virDomainPtr qemudDomainLookupByName(virConnectPtr conn,
                                      const char *name) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     struct qemud_vm *vm = qemudFindVMByName(driver, name);
@@ -1771,7 +1802,7 @@ virDomainPtr qemudDomainLookupByName(vir
     return dom;
 }
 
-int qemudGetVersion(virConnectPtr conn, unsigned long *version) {
+static int qemudGetVersion(virConnectPtr conn, unsigned long *version) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     if (qemudExtractVersion(driver) < 0)
         return -1;
@@ -1780,7 +1811,7 @@ int qemudGetVersion(virConnectPtr conn, 
     return 0;
 }
 
-int qemudListDomains(virConnectPtr conn, int *ids, int nids) {
+static int qemudListDomains(virConnectPtr conn, int *ids, int nids) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     struct qemud_vm *vm = driver->vms;
     int got = 0;
@@ -1793,11 +1824,11 @@ int qemudListDomains(virConnectPtr conn,
     }
     return got;
 }
-int qemudNumDomains(virConnectPtr conn) {
+static int qemudNumDomains(virConnectPtr conn) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     return driver->nactivevms;
 }
-virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
+static virDomainPtr qemudDomainCreate(virConnectPtr conn, const char *xml,
                                unsigned int flags ATTRIBUTE_UNUSED) {
     struct qemud_vm_def *def;
     struct qemud_vm *vm;
@@ -1828,7 +1859,7 @@ virDomainPtr qemudDomainCreate(virConnec
 }
 
 
-int qemudDomainSuspend(virDomainPtr dom) {
+static int qemudDomainSuspend(virDomainPtr dom) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     char *info;
     struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
@@ -1854,7 +1885,7 @@ int qemudDomainSuspend(virDomainPtr dom)
 }
 
 
-int qemudDomainResume(virDomainPtr dom) {
+static int qemudDomainResume(virDomainPtr dom) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     char *info;
     struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
@@ -1879,7 +1910,7 @@ int qemudDomainResume(virDomainPtr dom) 
 }
 
 
-int qemudDomainDestroy(virDomainPtr dom) {
+static int qemudDomainDestroy(virDomainPtr dom) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
     int ret;
@@ -1914,7 +1945,7 @@ static char *qemudDomainGetOSType(virDom
     return type;
 }
 
-int qemudDomainGetInfo(virDomainPtr dom,
+static int qemudDomainGetInfo(virDomainPtr dom,
                        virDomainInfoPtr info) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
@@ -1941,7 +1972,7 @@ int qemudDomainGetInfo(virDomainPtr dom,
 }
 
 
-int qemudDomainSave(virDomainPtr dom,
+static int qemudDomainSave(virDomainPtr dom,
                     const char *path ATTRIBUTE_UNUSED) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     struct qemud_vm *vm = qemudFindVMByID(driver, dom->id);
@@ -1958,7 +1989,7 @@ int qemudDomainSave(virDomainPtr dom,
 }
 
 
-int qemudDomainRestore(virConnectPtr conn,
+static int qemudDomainRestore(virConnectPtr conn,
                        const char *path ATTRIBUTE_UNUSED) {
     /*struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;*/
     qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED, "restore is 
not supported");
@@ -1966,7 +1997,7 @@ int qemudDomainRestore(virConnectPtr con
 }
 
 
-char *qemudDomainDumpXML(virDomainPtr dom,
+static char *qemudDomainDumpXML(virDomainPtr dom,
                          int flags ATTRIBUTE_UNUSED) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
@@ -1979,7 +2010,7 @@ char *qemudDomainDumpXML(virDomainPtr do
 }
 
 
-int qemudListDefinedDomains(virConnectPtr conn,
+static int qemudListDefinedDomains(virConnectPtr conn,
                             char **const names, int nnames) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     struct qemud_vm *vm = driver->vms;
@@ -2003,13 +2034,13 @@ int qemudListDefinedDomains(virConnectPt
 }
 
 
-int qemudNumDefinedDomains(virConnectPtr conn) {
+static int qemudNumDefinedDomains(virConnectPtr conn) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     return driver->ninactivevms;
 }
 
 
-int qemudDomainStart(virDomainPtr dom) {
+static int qemudDomainStart(virDomainPtr dom) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
 
@@ -2023,7 +2054,7 @@ int qemudDomainStart(virDomainPtr dom) {
 }
 
 
-virDomainPtr qemudDomainDefine(virConnectPtr conn, const char *xml) {
+static virDomainPtr qemudDomainDefine(virConnectPtr conn, const char *xml) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     struct qemud_vm_def *def;
     struct qemud_vm *vm;
@@ -2052,7 +2083,7 @@ virDomainPtr qemudDomainDefine(virConnec
     return dom;
 }
 
-int qemudDomainUndefine(virDomainPtr dom) {
+static int qemudDomainUndefine(virDomainPtr dom) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
 
@@ -2081,7 +2112,7 @@ int qemudDomainUndefine(virDomainPtr dom
     return 0;
 }
 
-int qemudDomainGetAutostart(virDomainPtr dom,
+static int qemudDomainGetAutostart(virDomainPtr dom,
                             int *autostart) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
@@ -2096,7 +2127,7 @@ int qemudDomainGetAutostart(virDomainPtr
     return 0;
 }
 
-int qemudDomainSetAutostart(virDomainPtr dom,
+static int qemudDomainSetAutostart(virDomainPtr dom,
                             int autostart) {
     struct qemud_driver *driver = (struct qemud_driver 
*)dom->conn->privateData;
     struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
@@ -2141,7 +2172,7 @@ int qemudDomainSetAutostart(virDomainPtr
     return 0;
 }
 
-virNetworkPtr qemudNetworkLookupByUUID(virConnectPtr conn ATTRIBUTE_UNUSED,
+static virNetworkPtr qemudNetworkLookupByUUID(virConnectPtr conn 
ATTRIBUTE_UNUSED,
                                      const unsigned char *uuid) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     struct qemud_network *network = qemudFindNetworkByUUID(driver, uuid);
@@ -2159,7 +2190,7 @@ virNetworkPtr qemudNetworkLookupByUUID(v
     }
     return net;
 }
-virNetworkPtr qemudNetworkLookupByName(virConnectPtr conn ATTRIBUTE_UNUSED,
+static virNetworkPtr qemudNetworkLookupByName(virConnectPtr conn 
ATTRIBUTE_UNUSED,
                                      const char *name) {
     struct qemud_driver *driver = (struct qemud_driver *)conn->privateData;
     struct qemud_network *network = qemudFindNetworkByName(driver, name);
@@ -2193,12 +2224,12 @@ static int qemudCloseNetwork(virConnectP
     return 0;
 }
 
-int qemudNumNetworks(virConnectPtr conn) {
+static int qemudNumNetworks(virConnectPtr conn) {
     struct qemud_driver *driver = (struct qemud_driver 
*)conn->networkPrivateData;
     return driver->nactivenetworks;
 }
 
-int qemudListNetworks(virConnectPtr conn, char **const names, int nnames) {
+static int qemudListNetworks(virConnectPtr conn, char **const names, int 
nnames) {
     struct qemud_driver *driver = (struct qemud_driver 
*)conn->networkPrivateData;
     struct qemud_network *network = driver->networks;
     int got = 0, i;
@@ -2220,12 +2251,12 @@ int qemudListNetworks(virConnectPtr conn
     return -1;
 }
 
-int qemudNumDefinedNetworks(virConnectPtr conn) {
+static int qemudNumDefinedNetworks(virConnectPtr conn) {
     struct qemud_driver *driver = (struct qemud_driver 
*)conn->networkPrivateData;
     return driver->ninactivenetworks;
 }
 
-int qemudListDefinedNetworks(virConnectPtr conn, char **const names, int 
nnames) {
+static int qemudListDefinedNetworks(virConnectPtr conn, char **const names, 
int nnames) {
     struct qemud_driver *driver = (struct qemud_driver 
*)conn->networkPrivateData;
     struct qemud_network *network = driver->networks;
     int got = 0, i;
@@ -2247,7 +2278,7 @@ int qemudListDefinedNetworks(virConnectP
     return -1;
 }
 
-virNetworkPtr qemudNetworkCreate(virConnectPtr conn, const char *xml) {
+static virNetworkPtr qemudNetworkCreate(virConnectPtr conn, const char *xml) {
     struct qemud_driver *driver = (struct qemud_driver 
*)conn->networkPrivateData;
     struct qemud_network_def *def;
     struct qemud_network *network;
@@ -2274,7 +2305,7 @@ virNetworkPtr qemudNetworkCreate(virConn
     return net;
 }
 
-virNetworkPtr qemudNetworkDefine(virConnectPtr conn, const char *xml) {
+static virNetworkPtr qemudNetworkDefine(virConnectPtr conn, const char *xml) {
     struct qemud_driver *driver = (struct qemud_driver 
*)conn->networkPrivateData;
     struct qemud_network_def *def;
     struct qemud_network *network;
@@ -2301,7 +2332,7 @@ virNetworkPtr qemudNetworkDefine(virConn
     return net;
 }
 
-int qemudNetworkUndefine(virNetworkPtr net) {
+static int qemudNetworkUndefine(virNetworkPtr net) {
     struct qemud_driver *driver = (struct qemud_driver 
*)net->conn->networkPrivateData;
     struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
 
@@ -2325,7 +2356,7 @@ int qemudNetworkUndefine(virNetworkPtr n
     return 0;
 }
 
-int qemudNetworkStart(virNetworkPtr net) {
+static int qemudNetworkStart(virNetworkPtr net) {
     struct qemud_driver *driver = (struct qemud_driver 
*)net->conn->networkPrivateData;
     struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
 
@@ -2338,7 +2369,7 @@ int qemudNetworkStart(virNetworkPtr net)
     return qemudStartNetworkDaemon(driver, network);
 }
 
-int qemudNetworkDestroy(virNetworkPtr net) {
+static int qemudNetworkDestroy(virNetworkPtr net) {
     struct qemud_driver *driver = (struct qemud_driver 
*)net->conn->networkPrivateData;
     struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
 
@@ -2351,7 +2382,7 @@ int qemudNetworkDestroy(virNetworkPtr ne
     return qemudShutdownNetworkDaemon(driver, network);
 }
 
-char *qemudNetworkDumpXML(virNetworkPtr net, int flags ATTRIBUTE_UNUSED) {
+static char *qemudNetworkDumpXML(virNetworkPtr net, int flags 
ATTRIBUTE_UNUSED) {
     struct qemud_driver *driver = (struct qemud_driver 
*)net->conn->networkPrivateData;
     struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
 
@@ -2364,7 +2395,7 @@ char *qemudNetworkDumpXML(virNetworkPtr 
     return qemudGenerateNetworkXML(driver, network, network->def);
 }
 
-char *qemudNetworkGetBridgeName(virNetworkPtr net) {
+static char *qemudNetworkGetBridgeName(virNetworkPtr net) {
     struct qemud_driver *driver = (struct qemud_driver 
*)net->conn->networkPrivateData;
     struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
     char *bridge;
@@ -2381,7 +2412,7 @@ char *qemudNetworkGetBridgeName(virNetwo
     return bridge;
 }
 
-int qemudNetworkGetAutostart(virNetworkPtr net,
+static int qemudNetworkGetAutostart(virNetworkPtr net,
                              int *autostart) {
     struct qemud_driver *driver = (struct qemud_driver 
*)net->conn->networkPrivateData;
     struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
@@ -2396,7 +2427,7 @@ int qemudNetworkGetAutostart(virNetworkP
     return 0;
 }
 
-int qemudNetworkSetAutostart(virNetworkPtr net,
+static int qemudNetworkSetAutostart(virNetworkPtr net,
                              int autostart) {
     struct qemud_driver *driver = (struct qemud_driver 
*)net->conn->networkPrivateData;
     struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
Index: src/qemu_driver.h
===================================================================
RCS file: /data/cvs/libxen/src/qemu_driver.h,v
retrieving revision 1.1
diff -u -p -r1.1 qemu_driver.h
--- src/qemu_driver.h   27 Jun 2007 00:12:29 -0000      1.1
+++ src/qemu_driver.h   29 Jun 2007 13:08:38 -0000
@@ -27,89 +27,8 @@
 
 #include "internal.h"
 
-int qemudStartup(void);
-int qemudReload(void);
-int qemudShutdown(void);
-int qemudActive(void);
 int qemudRegister(void);
 
-virDrvOpenStatus qemudOpen(virConnectPtr conn,
-                           const char *name,
-                           int flags);
-
-int qemudGetNodeInfo(virConnectPtr conn,
-                     virNodeInfoPtr info);
-
-char *qemudGetCapabilities(virConnectPtr conn);
-
-virDomainPtr qemudDomainLookupByID(virConnectPtr conn,
-                                   int id);
-virDomainPtr qemudDomainLookupByUUID(virConnectPtr conn,
-                                     const unsigned char *uuid);
-virDomainPtr qemudDomainLookupByName(virConnectPtr conn,
-                                     const char *name);
-
-int qemudGetVersion(virConnectPtr conn, unsigned long *version);
-int qemudListDomains(virConnectPtr conn,
-                     int *ids,
-                     int nids);
-int qemudNumDomains(virConnectPtr conn);
-virDomainPtr qemudDomainCreate(virConnectPtr conn,
-                               const char *xml,
-                               unsigned int flags);
-int qemudDomainSuspend(virDomainPtr dom);
-int qemudDomainResume(virDomainPtr dom);
-int qemudDomainDestroy(virDomainPtr dom);
-int qemudDomainGetInfo(virDomainPtr dom,
-                       virDomainInfoPtr info);
-int qemudDomainSave(virDomainPtr dom,
-                    const char *path);
-int qemudDomainRestore(virConnectPtr conn,
-                       const char *path);
-char *qemudDomainDumpXML(virDomainPtr dom,
-                         int flags);
-int qemudListDefinedDomains(virConnectPtr conn,
-                            char **const names,
-                            int nnames);
-int qemudNumDefinedDomains(virConnectPtr conn);
-int qemudDomainStart(virDomainPtr dom);
-virDomainPtr qemudDomainDefine(virConnectPtr conn,
-                               const char *xml);
-int qemudDomainUndefine(virDomainPtr dom);
-int qemudDomainGetAutostart(virDomainPtr dom,
-                            int *autostart);
-int qemudDomainSetAutostart(virDomainPtr dom,
-                              int autostart);
-
-
-virNetworkPtr qemudNetworkLookupByUUID(virConnectPtr conn,
-                                       const unsigned char *uuid);
-virNetworkPtr qemudNetworkLookupByName(virConnectPtr conn,
-                                       const char *name);
-
-int qemudNumNetworks(virConnectPtr conn);
-int qemudListNetworks(virConnectPtr conn,
-                      char **const names,
-                      int nnames);
-int qemudNumDefinedNetworks(virConnectPtr conn);
-int qemudListDefinedNetworks(virConnectPtr conn,
-                             char **const names,
-                             int nnames);
-virNetworkPtr qemudNetworkCreate(virConnectPtr conn,
-                                 const char *xml);
-virNetworkPtr qemudNetworkDefine(virConnectPtr conn,
-                                 const char *xml);
-int qemudNetworkStart(virNetworkPtr net);
-int qemudNetworkUndefine(virNetworkPtr net);
-int qemudNetworkDestroy(virNetworkPtr net);
-char *qemudNetworkDumpXML(virNetworkPtr net,
-                          int flags);
-char *qemudNetworkGetBridgeName(virNetworkPtr net);
-int qemudNetworkGetAutostart(virNetworkPtr net,
-                             int *autostart);
-int qemudNetworkSetAutostart(virNetworkPtr net,
-                             int autostart);
-
 #endif
 
 
Index: src/uuid.c
===================================================================
RCS file: /data/cvs/libxen/src/uuid.c,v
retrieving revision 1.1
diff -u -p -r1.1 uuid.c
--- src/uuid.c  27 Jun 2007 00:12:29 -0000      1.1
+++ src/uuid.c  29 Jun 2007 13:08:38 -0000
@@ -77,11 +77,22 @@ virUUIDGeneratePseudoRandomBytes(unsigne
     return 0;
 }
 
+/**
+ * virUUIDGenerate:
+ * @uuid: array of VIR_UUID_RAW_LEN bytes to store the new UUID
+ *
+ * Generates a randomized unique identifier.
+ *
+ * Returns 0 in case of success and -1 in case of failure
+ */
 int
 virUUIDGenerate(unsigned char *uuid)
 {
     int err;
 
+    if (uuid == NULL)
+        return(-1);
+
     if ((err = virUUIDGenerateRandomBytes(uuid, VIR_UUID_RAW_LEN)))
         qemudLog(QEMUD_WARN,
                  "Falling back to pseudorandom UUID, "
@@ -90,11 +101,24 @@ virUUIDGenerate(unsigned char *uuid)
     return virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_RAW_LEN);
 }
 
+/**
+ * virUUIDParse:
+ * @uuid: zero terminated string representation of the UUID
+ * @rawuuid: array of VIR_UUID_RAW_LEN bytes to store the raw UUID
+ *
+ * Parses the external string representation, allowing spaces and '-'
+ * character in the sequence, and storing the result as a raw UUID
+ *
+ * Returns 0 in case of success and -1 in case of error.
+ */
 int
 virUUIDParse(const char *uuid, unsigned char *rawuuid) {
     const char *cur;
     int i;
 
+    if ((uuid == NULL) || (rawuuid == NULL))
+        return(-1);
+
     /*
      * do a liberal scan allowing '-' and ' ' anywhere between character
      * pairs as long as there is 32 of them in the end.
Index: src/uuid.h
===================================================================
RCS file: /data/cvs/libxen/src/uuid.h,v
retrieving revision 1.1
diff -u -p -r1.1 uuid.h
--- src/uuid.h  27 Jun 2007 00:12:29 -0000      1.1
+++ src/uuid.h  29 Jun 2007 13:08:38 -0000
@@ -22,6 +22,10 @@
 #ifndef __VIR_UUID_H__
 #define __VIR_UUID_H__
 
+/**
+ * VIR_UUID_RAW_LEN:
+ * number of bytes used by an UUID in raw form
+ */
 #define VIR_UUID_RAW_LEN 16
 
 int virUUIDGenerate(unsigned char *uuid);
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to