Tue Aug 21 09:45:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>

* src/xend_internal.c: Return the interface device name as
          <target dev='vifX.Y'/> in domain XML.
        * tests/*: Update XML in regression tests.
This commit is contained in:
Richard W.M. Jones 2007-08-21 08:54:07 +00:00
parent 157ddaa295
commit 9201909064
13 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,9 @@
Tue Aug 21 09:45:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/xend_internal.c: Return the interface device name as
<target dev='vifX.Y'/> in domain XML.
* tests/*: Update XML in regression tests.
Tue Aug 21 09:07:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* docs/libvir.html: Updated the hvsupport page to show that

View File

@ -1354,6 +1354,7 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
int max_mem, cur_mem;
unsigned char uuid[VIR_UUID_BUFLEN];
char uuidstr[VIR_UUID_STRING_BUFLEN];
int vif_index = 0;
if (root == NULL) {
/* ERROR */
@ -1626,6 +1627,9 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
if (tmp)
virBufferVSprintf(&buf, " <target dev='%s'/>\n",
tmp);
else
virBufferVSprintf(&buf, " <target dev='vif%d.%d'/>\n",
domid, vif_index);
tmp = sexpr_node(node, "device/vif/mac");
if (tmp)
virBufferVSprintf(&buf, " <mac address='%s'/>\n",
@ -1639,6 +1643,7 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
tmp2);
virBufferAdd(&buf, " </interface>\n", 17);
vif_index++;
} else if (sexpr_lookup(node, "device/vfb")) {
/* New style graphics config for PV guests in >= 3.0.4,
* or for HVM guests in >= 3.0.5 */

View File

@ -17,6 +17,7 @@
<devices>
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif5.0'/>
<mac address='00:16:3e:1d:06:15'/>
<script path='vif-bridge'/>
</interface>

View File

@ -24,6 +24,7 @@
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif3.0'/>
<mac address='00:16:3e:1b:b1:47'/>
<script path='vif-bridge'/>
</interface>

View File

@ -24,6 +24,7 @@
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif3.0'/>
<mac address='00:16:3e:1b:b1:47'/>
<script path='vif-bridge'/>
</interface>

View File

@ -24,6 +24,7 @@
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif3.0'/>
<mac address='00:16:3e:1b:b1:47'/>
<script path='vif-bridge'/>
</interface>

View File

@ -24,6 +24,7 @@
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif3.0'/>
<mac address='00:16:3e:1b:b1:47'/>
<script path='vif-bridge'/>
</interface>

View File

@ -30,6 +30,7 @@
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif3.0'/>
<mac address='00:16:3e:1b:b1:47'/>
<script path='vif-bridge'/>
</interface>

View File

@ -24,6 +24,7 @@
</disk>
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif3.0'/>
<mac address='00:16:3e:1b:b1:47'/>
<script path='vif-bridge'/>
</interface>

View File

@ -20,6 +20,7 @@
</disk>
<interface type='bridge'>
<source bridge='xenbr2'/>
<target dev='vif6.0'/>
<mac address='00:11:22:33:44:55'/>
<script path='vif-bridge'/>
</interface>

View File

@ -19,6 +19,7 @@
<target dev='xvda'/>
</disk>
<interface type='ethernet'>
<target dev='vif6.0'/>
<mac address='00:11:22:33:44:55'/>
<ip address='172.14.5.6'/>
<script path='vif-routed'/>

View File

@ -22,6 +22,7 @@
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<interface type='bridge'>
<source bridge='xenbr0'/>
<target dev='vif6.0'/>
<mac address='00:16:3e:0a:7b:39'/>
</interface>
<disk type='block' device='disk'>

View File

@ -30,6 +30,7 @@ static int testCompareFiles(const char *xml, const char *sexpr, int xendConfigVe
if (strcmp(xmlData, gotxml)) {
if (getenv("DEBUG_TESTS")) {
printf("In test file %s -> %s:\n", sexpr, xml);
printf("Expect %d '%s'\n", (int)strlen(xmlData), xmlData);
printf("Actual %d '%s'\n", (int)strlen(gotxml), gotxml);
}