]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
domain: make port optional for network disks
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Mar 2013 11:53:51 +0000 (12:53 +0100)
committerOsier Yang <jyang@redhat.com>
Fri, 22 Mar 2013 04:10:23 +0000 (12:10 +0800)
Only sheepdog actually required it in the code, and we can use 7000 as the
default---the same value that QEMU uses for the simple "sheepdog:VOLUME"
syntax.  With this change, the schema can be fixed to allow no port.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/qemu/qemu_command.c

index f17b808e9bff6c40917fd8770e370f345894a62a..fd3381827c37cfd7a0d1729313252f03b0837956 100644 (file)
             <th> Protocol </th>
             <th> Meaning </th>
             <th> Number of hosts </th>
+            <th> Default port </th>
           </tr>
           <tr>
             <td> nbd </td>
             <td> a server running nbd-server </td>
             <td> only one </td>
+            <td> 10809 </td>
           </tr>
           <tr>
             <td> iscsi </td>
             <td> an iSCSI server </td>
             <td> only one </td>
+            <td> 3260 </td>
           </tr>
           <tr>
             <td> rbd </td>
             <td> monitor servers of RBD </td>
             <td> one or more </td>
+            <td> 6789 </td>
           </tr>
           <tr>
             <td> sheepdog </td>
             <td> one of the sheepdog servers (default is localhost:7000) </td>
             <td> zero or one </td>
+            <td> 7000 </td>
           </tr>
           <tr>
             <td> gluster </td>
             <td> a server running glusterd daemon </td>
             <td> only one </td>
+            <td> 24007 </td>
           </tr>
         </table>
         gluster supports "tcp", "rdma", "unix" as valid values for the
index 3240e1cd8cd94f553c333990bf880d5dc126414d..1b49b5aee26fd3dc8fd2b96cfe3b876dfc566c2b 100644 (file)
                             <ref name="ipAddr"/>
                           </choice>
                         </attribute>
-                        <attribute name="port">
-                          <ref name="unsignedInt"/>
-                        </attribute>
+                        <optional>
+                          <attribute name="port">
+                            <ref name="unsignedInt"/>
+                          </attribute>
+                        </optional>
                       </group>
                       <group>
                         <attribute name="transport">
index b06cae5793a3473ae7c909091d7642d7b9a576e5..8f76e8eacd532a8beaa04a971b799abb44e53aae 100644 (file)
@@ -4111,11 +4111,6 @@ virDomainDiskDefParseXML(virCapsPtr caps,
                                     goto error;
                                 }
                                 hosts[nhosts - 1].port = virXMLPropString(child, "port");
-                                if (!hosts[nhosts - 1].port) {
-                                    virReportError(VIR_ERR_XML_ERROR,
-                                                   "%s", _("missing port for host"));
-                                    goto error;
-                                }
                             }
                         }
                         child = child->next;
index 313db2ca6ecbb8bbd1f77ba8d58abf852e936789..5422508ffb38edff4df471d72c8e7ddbaf12d070 100644 (file)
@@ -2763,7 +2763,8 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED,
                 } else {
                     /* only one host is supported now */
                     virBufferAsprintf(&opt, "file=sheepdog:%s:%s:",
-                                      disk->hosts->name, disk->hosts->port);
+                                      disk->hosts->name,
+                                      disk->hosts->port ? disk->hosts->port : "7000");
                     virBufferEscape(&opt, ',', ",", "%s,", disk->src);
                 }
                 break;