diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2008-04-30 12:30:55 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2008-04-30 12:30:55 +0000 |
commit | 159cb2b97c48902b0deabe2f85491a46507b1a2e (patch) | |
tree | 8dac2b771d76e82badadd0fdc824756877560df4 | |
parent | * gnulib/lib/stdio-impl.h: Add another new file from gnulib. (diff) | |
download | libvirt-159cb2b97c48902b0deabe2f85491a46507b1a2e.tar.gz libvirt-159cb2b97c48902b0deabe2f85491a46507b1a2e.tar.bz2 libvirt-159cb2b97c48902b0deabe2f85491a46507b1a2e.zip |
Added support for network interface model setting
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | src/qemu_conf.c | 49 | ||||
-rw-r--r-- | src/qemu_conf.h | 2 | ||||
-rw-r--r-- | src/xend_internal.c | 7 | ||||
-rw-r--r-- | src/xm_internal.c | 21 | ||||
-rw-r--r-- | src/xml.c | 7 | ||||
-rw-r--r-- | tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args | 1 | ||||
-rw-r--r-- | tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml | 26 | ||||
-rw-r--r-- | tests/qemuxml2argvtest.c | 1 | ||||
-rw-r--r-- | tests/qemuxml2xmltest.c | 1 | ||||
-rw-r--r-- | tests/sexpr2xmldata/sexpr2xml-net-e1000.sexpr | 2 | ||||
-rw-r--r-- | tests/sexpr2xmldata/sexpr2xml-net-e1000.xml | 32 | ||||
-rw-r--r-- | tests/sexpr2xmltest.c | 1 | ||||
-rw-r--r-- | tests/testutils.c | 31 | ||||
-rwxr-xr-x | tests/xmconfigdata/test-paravirt-net-e1000.cfg | 12 | ||||
-rw-r--r-- | tests/xmconfigdata/test-paravirt-net-e1000.xml | 28 | ||||
-rw-r--r-- | tests/xmconfigtest.c | 1 | ||||
-rw-r--r-- | tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr | 1 | ||||
-rw-r--r-- | tests/xml2sexprdata/xml2sexpr-net-e1000.xml | 30 | ||||
-rw-r--r-- | tests/xml2sexprtest.c | 1 |
20 files changed, 251 insertions, 17 deletions
@@ -1,3 +1,17 @@ +Tue Apr 29 08:13:28 EST 2008 Daniel P. Berrange <berrange@redhat.com> + + * src/qemu_conf.c, src/qemu_conf.h, src/xend_internal.c, + src/xm_internal.c, src/xml.c: Added support for network + interface model type setting + * tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, + tests/sexpr2xmltest.c, tests/xmconfigtest.c, + tests/xml2sexprtest.c: Added test cases for NIC model type + * tests/qemuxml2argvdata/qemuxml2argv-net-virtio.{xml,args}, + tests/sexpr2xmldata/sexpr2xml-net-e1000.{sexpr,xml}, + tests/xml2sexprdata/xml2sexpr-net-e1000.{sexpr,xml}, + tests/xmconfigdata/test-paravirt-net-e1000.{cfg,xml}: Added + new data files for test cases + Tue Apr 29 21:43:28 CEST 2008 Jim Meyering <meyering@redhat.com> Fix build errors. diff --git a/src/qemu_conf.c b/src/qemu_conf.c index a0c4a8ff7..1efd9e956 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -714,6 +714,7 @@ static int qemudParseInterfaceXML(virConnectPtr conn, xmlChar *script = NULL; xmlChar *address = NULL; xmlChar *port = NULL; + xmlChar *model = NULL; net->type = QEMUD_NET_USER; @@ -775,6 +776,8 @@ static int qemudParseInterfaceXML(virConnectPtr conn, (net->type == QEMUD_NET_ETHERNET) && xmlStrEqual(cur->name, BAD_CAST "script")) { script = xmlGetProp(cur, BAD_CAST "path"); + } else if (xmlStrEqual (cur->name, BAD_CAST "model")) { + model = xmlGetProp (cur, BAD_CAST "type"); } } cur = cur->next; @@ -934,6 +937,39 @@ static int qemudParseInterfaceXML(virConnectPtr conn, xmlFree(address); } + /* NIC model (see -net nic,model=?). We only check that it looks + * reasonable, not that it is a supported NIC type. FWIW kvm + * supports these types as of April 2008: + * i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio + */ + if (model != NULL) { + int i, len, char_ok; + + len = xmlStrlen (model); + if (len >= QEMUD_MODEL_MAX_LEN) { + qemudReportError (conn, NULL, NULL, VIR_ERR_INVALID_ARG, + _("Model name '%s' is too long"), model); + goto error; + } + for (i = 0; i < len; ++i) { + char_ok = + (model[i] >= '0' && model[i] <= '9') || + (model[i] >= 'a' && model[i] <= 'z') || + (model[i] >= 'A' && model[i] <= 'Z') || model[i] == '_'; + if (!char_ok) { + qemudReportError (conn, NULL, NULL, VIR_ERR_INVALID_ARG, + _("Model name contains invalid characters")); + goto error; + } + } + strncpy (net->model, (const char*) model, len); + net->model[len] = '\0'; + + xmlFree (model); + model = NULL; + } else + net->model[0] = '\0'; + return 0; error: @@ -943,6 +979,7 @@ static int qemudParseInterfaceXML(virConnectPtr conn, xmlFree(ifname); xmlFree(script); xmlFree(bridge); + xmlFree(model); return -1; } @@ -2271,11 +2308,13 @@ int qemudBuildCommandLine(virConnectPtr conn, while (net) { char nic[100]; - if (snprintf(nic, sizeof(nic), "nic,macaddr=%02x:%02x:%02x:%02x:%02x:%02x,vlan=%d", + if (snprintf(nic, sizeof(nic), + "nic,macaddr=%02x:%02x:%02x:%02x:%02x:%02x,vlan=%d%s%s", net->mac[0], net->mac[1], net->mac[2], net->mac[3], net->mac[4], net->mac[5], - vlan) >= sizeof(nic)) + vlan, + (net->model[0] ? ",model=" : ""), net->model) >= sizeof(nic)) goto error; if (!((*argv)[++n] = strdup("-net"))) @@ -3395,7 +3434,6 @@ static int qemudGenerateXMLChar(virBufferPtr buf, virBufferVSprintf(buf, " <source mode='connect' service='%s'/>\n", dev->srcData.udp.connectService); } - break; case QEMUD_CHR_SRC_TYPE_TCP: @@ -3609,6 +3647,11 @@ char *qemudGenerateXML(virConnectPtr conn, net->dst.socket.port); } + if (net->model && net->model[0] != '\0') { + virBufferVSprintf(&buf, " <model type='%s'/>\n", + net->model); + } + virBufferAddLit(&buf, " </interface>\n"); net = net->next; diff --git a/src/qemu_conf.h b/src/qemu_conf.h index 8a367e3ec..bd8d8b28a 100644 --- a/src/qemu_conf.h +++ b/src/qemu_conf.h @@ -68,6 +68,7 @@ struct qemud_vm_disk_def { }; #define QEMUD_MAC_ADDRESS_LEN 6 +#define QEMUD_MODEL_MAX_LEN 10 #define QEMUD_OS_TYPE_MAX_LEN 10 #define QEMUD_OS_ARCH_MAX_LEN 10 #define QEMUD_OS_MACHINE_MAX_LEN 10 @@ -97,6 +98,7 @@ enum qemud_vm_net_forward_type { struct qemud_vm_net_def { int type; unsigned char mac[QEMUD_MAC_ADDRESS_LEN]; + char model[QEMUD_MODEL_MAX_LEN]; union { struct { char ifname[BR_IFNAME_MAXLEN]; diff --git a/src/xend_internal.c b/src/xend_internal.c index b079fe663..29a16dd55 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -1893,9 +1893,10 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, free(drvName); free(drvType); } else if (sexpr_lookup(node, "device/vif")) { - const char *tmp2; + const char *tmp2, *model; tmp2 = sexpr_node(node, "device/vif/script"); tmp = sexpr_node(node, "device/vif/bridge"); + model = sexpr_node(node, "device/vif/model"); if ((tmp2 && strstr(tmp2, "bridge")) || tmp) { virBufferAddLit(&buf, " <interface type='bridge'>\n"); if (tmp != NULL) @@ -1924,6 +1925,10 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, virBufferVSprintf(&buf, " <script path='%s'/>\n", tmp2); + if (model) + virBufferVSprintf(&buf, " <model type='%s'/>\n", + model); + virBufferAddLit(&buf, " </interface>\n"); vif_index++; } else if (sexpr_lookup(node, "device/vfb")) { diff --git a/src/xm_internal.c b/src/xm_internal.c index 08e3e8e09..815f08bf2 100644 --- a/src/xm_internal.c +++ b/src/xm_internal.c @@ -845,6 +845,7 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) { while (list) { int type = -1; char script[PATH_MAX]; + char model[10]; char ip[16]; char mac[18]; char bridge[50]; @@ -854,6 +855,7 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) { mac[0] = '\0'; script[0] = '\0'; ip[0] = '\0'; + model[0] = '\0'; if ((list->type != VIR_CONF_STRING) || (list->str == NULL)) goto skipnic; @@ -886,6 +888,12 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) { len = PATH_MAX-1; strncpy(script, data, len); script[len] = '\0'; + } else if (!strncmp(key, "model=", 6)) { + int len = nextkey ? (nextkey - data) : sizeof(model)-1; + if (len > (sizeof(model)-1)) + len = sizeof(model)-1; + strncpy(model, data, len); + model[len] = '\0'; } else if (!strncmp(key, "ip=", 3)) { int len = nextkey ? (nextkey - data) : 15; if (len > 15) @@ -915,6 +923,8 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) { virBufferVSprintf(&buf, " <script path='%s'/>\n", script); if (ip[0]) virBufferVSprintf(&buf, " <ip address='%s'/>\n", ip); + if (model[0]) + virBufferVSprintf(&buf, " <model type='%s'/>\n", model); virBufferAddLit(&buf, " </interface>\n"); skipnic: @@ -1772,6 +1782,7 @@ static char *xenXMParseXMLVif(virConnectPtr conn, xmlNodePtr node, int hvm) { xmlChar *source = NULL; xmlChar *mac = NULL; xmlChar *script = NULL; + xmlChar *model = NULL; xmlChar *ip = NULL; int typ = 0; char *buf = NULL; @@ -1803,6 +1814,9 @@ static char *xenXMParseXMLVif(virConnectPtr conn, xmlNodePtr node, int hvm) { } else if ((mac == NULL) && (xmlStrEqual(cur->name, BAD_CAST "mac"))) { mac = xmlGetProp(cur, BAD_CAST "address"); + } else if ((model == NULL) && + (xmlStrEqual(cur->name, BAD_CAST "model"))) { + model = xmlGetProp(cur, BAD_CAST "type"); } else if ((ip == NULL) && (xmlStrEqual(cur->name, BAD_CAST "ip"))) { ip = xmlGetProp(cur, BAD_CAST "address"); @@ -1838,6 +1852,8 @@ static char *xenXMParseXMLVif(virConnectPtr conn, xmlNodePtr node, int hvm) { buflen += 11; if (script) buflen += 8 + strlen((const char*)script); + if (model) + buflen += 7 + strlen((const char*)model); if (ip) buflen += 4 + strlen((const char*)ip); @@ -1865,6 +1881,10 @@ static char *xenXMParseXMLVif(virConnectPtr conn, xmlNodePtr node, int hvm) { strcat(buf, ",script="); strcat(buf, (const char*)script); } + if (model) { + strcat(buf, ",model="); + strcat(buf, (const char*)model); + } if (ip) { strcat(buf, ",ip="); strcat(buf, (const char*)ip); @@ -1876,6 +1896,7 @@ static char *xenXMParseXMLVif(virConnectPtr conn, xmlNodePtr node, int hvm) { xmlFree(source); xmlFree(script); xmlFree(ip); + xmlFree(model); return buf; } @@ -1373,6 +1373,7 @@ virDomainParseXMLIfDesc(virConnectPtr conn ATTRIBUTE_UNUSED, xmlChar *source = NULL; xmlChar *mac = NULL; xmlChar *script = NULL; + xmlChar *model = NULL; xmlChar *ip = NULL; int typ = 0; int ret = -1; @@ -1404,6 +1405,9 @@ virDomainParseXMLIfDesc(virConnectPtr conn ATTRIBUTE_UNUSED, } else if ((script == NULL) && (xmlStrEqual(cur->name, BAD_CAST "script"))) { script = xmlGetProp(cur, BAD_CAST "path"); + } else if ((model == NULL) && + (xmlStrEqual(cur->name, BAD_CAST "model"))) { + model = xmlGetProp(cur, BAD_CAST "type"); } else if ((ip == NULL) && (xmlStrEqual(cur->name, BAD_CAST "ip"))) { /* XXX in future expect to need to have > 1 ip @@ -1449,6 +1453,8 @@ virDomainParseXMLIfDesc(virConnectPtr conn ATTRIBUTE_UNUSED, } if (script != NULL) virBufferVSprintf(buf, "(script '%s')", script); + if (model != NULL) + virBufferVSprintf(buf, "(model '%s')", model); if (ip != NULL) virBufferVSprintf(buf, "(ip '%s')", ip); /* @@ -1465,6 +1471,7 @@ virDomainParseXMLIfDesc(virConnectPtr conn ATTRIBUTE_UNUSED, xmlFree(source); xmlFree(script); xmlFree(ip); + xmlFree(model); return (ret); } diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args new file mode 100644 index 000000000..f1fa174f8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args @@ -0,0 +1 @@ +/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0,model=virtio -net user,vlan=0 -serial none -parallel none -usb
\ No newline at end of file diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml new file mode 100644 index 000000000..9c398ecae --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.xml @@ -0,0 +1,26 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory>219200</memory> + <currentMemory>219200</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='block' device='disk'> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda'/> + </disk> + <interface type='user'> + <mac address='00:11:22:33:44:55'/> + <model type='virtio'/> + </interface> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 093ff8740..e7f602168 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -146,6 +146,7 @@ main(int argc, char **argv) DO_TEST("misc-acpi"); DO_TEST("misc-no-reboot"); DO_TEST("net-user"); + DO_TEST("net-virtio"); DO_TEST("serial-vc"); DO_TEST("serial-pty"); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 156d5093c..76b46bdbc 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -109,6 +109,7 @@ main(int argc, char **argv) DO_TEST("misc-acpi"); DO_TEST("misc-no-reboot"); DO_TEST("net-user"); + DO_TEST("net-virtio"); DO_TEST("serial-vc"); DO_TEST("serial-pty"); diff --git a/tests/sexpr2xmldata/sexpr2xml-net-e1000.sexpr b/tests/sexpr2xmldata/sexpr2xml-net-e1000.sexpr new file mode 100644 index 000000000..4f349e204 --- /dev/null +++ b/tests/sexpr2xmldata/sexpr2xml-net-e1000.sexpr @@ -0,0 +1,2 @@ +(domain (domid 6)(name 'pvtest')(memory 420)(maxmem 420)(vcpus 2)(uuid '596a5d2171f48fb2e068e2386a5c413e')(on_poweroff 'destroy')(on_reboot 'destroy')(on_crash 'destroy')(image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')(ramdisk '/var/lib/xen/initrd.img.0u-Vhq')(args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')(uname 'file:/root/some.img')(mode 'w')))(device (vif (mac '00:11:22:33:44:55')(bridge 'xenbr2')(script 'vif-bridge')(model 'e1000')))) + diff --git a/tests/sexpr2xmldata/sexpr2xml-net-e1000.xml b/tests/sexpr2xmldata/sexpr2xml-net-e1000.xml new file mode 100644 index 000000000..5f1dc1e72 --- /dev/null +++ b/tests/sexpr2xmldata/sexpr2xml-net-e1000.xml @@ -0,0 +1,32 @@ +<domain type='xen' id='6'> + <name>pvtest</name> + <uuid>596a5d21-71f4-8fb2-e068-e2386a5c413e</uuid> + <os> + <type>linux</type> + <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel> + <initrd>/var/lib/xen/initrd.img.0u-Vhq</initrd> + <cmdline> method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test/5.91/x86_64/os </cmdline> + </os> + <memory>430080</memory> + <vcpu>2</vcpu> + <on_poweroff>destroy</on_poweroff> + <on_reboot>destroy</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <disk type='file' device='disk'> + <driver name='file'/> + <source file='/root/some.img'/> + <target dev='xvda'/> + </disk> + <interface type='bridge'> + <source bridge='xenbr2'/> + <target dev='vif6.0'/> + <mac address='00:11:22:33:44:55'/> + <script path='vif-bridge'/> + <model type='e1000'/> + </interface> + <console type='pty'> + <target port='0'/> + </console> + </devices> +</domain> diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index 0ec315532..b7103d624 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -116,6 +116,7 @@ main(int argc, char **argv) DO_TEST("curmem", "curmem", 1); DO_TEST("net-routed", "net-routed", 2); DO_TEST("net-bridged", "net-bridged", 2); + DO_TEST("net-e1000", "net-e1000", 2); DO_TEST("no-source-cdrom", "no-source-cdrom", 1); DO_TEST("fv-utc", "fv-utc", 1); diff --git a/tests/testutils.c b/tests/testutils.c index 56f45fbc9..ea2c59f0e 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -23,6 +23,7 @@ #include <fcntl.h> #include <limits.h> #include "testutils.h" +#include "internal.h" #ifdef HAVE_PATHS_H #include <paths.h> @@ -231,23 +232,27 @@ int virtTestDifference(FILE *stream, const char *expectEnd = expect + (strlen(expect)-1); const char *actualStart = actual; const char *actualEnd = actual + (strlen(actual)-1); + const char *debug; - if (getenv("DEBUG_TESTS") == NULL) + if ((debug = getenv("DEBUG_TESTS")) == NULL) return 0; - /* Skip to first character where they differ */ - while (*expectStart && *actualStart && - *actualStart == *expectStart) { - actualStart++; - expectStart++; - } + if (STREQ(debug, "") || + STREQ(debug, "1")) { + /* Skip to first character where they differ */ + while (*expectStart && *actualStart && + *actualStart == *expectStart) { + actualStart++; + expectStart++; + } - /* Work backwards to last character where they differ */ - while (actualEnd > actualStart && - expectEnd > expectStart && - *actualEnd == *expectEnd) { - actualEnd--; - expectEnd--; + /* Work backwards to last character where they differ */ + while (actualEnd > actualStart && + expectEnd > expectStart && + *actualEnd == *expectEnd) { + actualEnd--; + expectEnd--; + } } /* Show the trimmed differences */ diff --git a/tests/xmconfigdata/test-paravirt-net-e1000.cfg b/tests/xmconfigdata/test-paravirt-net-e1000.cfg new file mode 100755 index 000000000..7b01e8f23 --- /dev/null +++ b/tests/xmconfigdata/test-paravirt-net-e1000.cfg @@ -0,0 +1,12 @@ +name = "XenGuest1" +uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809" +maxmem = 579 +memory = 394 +vcpus = 1 +bootloader = "/usr/bin/pygrub" +on_poweroff = "destroy" +on_reboot = "restart" +on_crash = "restart" +vfb = [ "type=vnc,vncunused=1,vnclisten=127.0.0.1,vncpasswd=123poi" ] +disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ] +vif = [ "mac=00:16:3E:66:94:9C,model=e1000,ip=192.168.0.9" ] diff --git a/tests/xmconfigdata/test-paravirt-net-e1000.xml b/tests/xmconfigdata/test-paravirt-net-e1000.xml new file mode 100644 index 000000000..d12873c63 --- /dev/null +++ b/tests/xmconfigdata/test-paravirt-net-e1000.xml @@ -0,0 +1,28 @@ +<domain type='xen'> + <name>XenGuest1</name> + <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid> + <bootloader>/usr/bin/pygrub</bootloader> + <currentMemory>403456</currentMemory> + <memory>592896</memory> + <vcpu>1</vcpu> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>restart</on_crash> + <devices> + <disk type='block' device='disk'> + <driver name='phy'/> + <source dev='/dev/HostVG/XenGuest1'/> + <target dev='xvda'/> + </disk> + <interface type='bridge'> + <mac address='00:16:3E:66:94:9C'/> + <ip address='192.168.0.9'/> + <model type='e1000'/> + </interface> + <input type='mouse' bus='xen'/> + <graphics type='vnc' port='-1' listen='127.0.0.1' passwd='123poi'/> + <console type='pty'> + <target port='0'/> + </console> + </devices> +</domain> diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index 71b6830d5..de446aad2 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -202,6 +202,7 @@ main(int argc, char **argv) DO_TEST("paravirt-old-pvfb", 2); DO_TEST("paravirt-new-pvfb", 3); + DO_TEST("paravirt-net-e1000", 3); DO_TEST("fullvirt-old-cdrom", 1); DO_TEST("fullvirt-new-cdrom", 2); DO_TEST("fullvirt-utc", 2); diff --git a/tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr b/tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr new file mode 100644 index 000000000..6b384ffc0 --- /dev/null +++ b/tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr @@ -0,0 +1 @@ +(vm (name 'pvtest')(memory 420)(maxmem 420)(vcpus 2)(uuid '596a5d2171f48fb2e068e2386a5c413e')(on_poweroff 'destroy')(on_reboot 'destroy')(on_crash 'destroy')(image (linux (kernel '/var/lib/xen/vmlinuz.2Dn2YT')(ramdisk '/var/lib/xen/initrd.img.0u-Vhq')(args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test/5.91/x86_64/os ')))(device (vbd (dev 'xvda')(uname 'file:/root/some.img')(mode 'w')))(device (vif (mac '00:11:22:33:44:55')(bridge 'xenbr2')(script 'vif-bridge')(model 'e1000'))))
\ No newline at end of file diff --git a/tests/xml2sexprdata/xml2sexpr-net-e1000.xml b/tests/xml2sexprdata/xml2sexpr-net-e1000.xml new file mode 100644 index 000000000..7542bcfc8 --- /dev/null +++ b/tests/xml2sexprdata/xml2sexpr-net-e1000.xml @@ -0,0 +1,30 @@ +<domain type='xen' id='15'> + <name>pvtest</name> + <uuid>596a5d2171f48fb2e068e2386a5c413e</uuid> + <os> + <type>linux</type> + <kernel>/var/lib/xen/vmlinuz.2Dn2YT</kernel> + <initrd>/var/lib/xen/initrd.img.0u-Vhq</initrd> + <cmdline> method=http://download.fedora.devel.redhat.com/pub/fedora/linux/core/test/5.91/x86_64/os </cmdline> + </os> + <memory>430080</memory> + <vcpu>2</vcpu> + <on_poweroff>destroy</on_poweroff> + <on_reboot>destroy</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <disk type='file' device='disk'> + <source file='/root/some.img'/> + <target dev='xvda'/> + </disk> + <interface type="bridge"> + <mac address="00:11:22:33:44:55"/> + <source bridge="xenbr2"/> + <script path="vif-bridge"/> + <model type='e1000'/> + <target dev="vif4.0"/> + </interface> + <console tty='/dev/pts/4'/> + </devices> +</domain> + diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index a6d402edf..d04233af5 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -123,6 +123,7 @@ main(int argc, char **argv) DO_TEST("curmem", "curmem", "rhel5", 2); DO_TEST("net-routed", "net-routed", "pvtest", 2); DO_TEST("net-bridged", "net-bridged", "pvtest", 2); + DO_TEST("net-e1000", "net-e1000", "pvtest", 2); DO_TEST("no-source-cdrom", "no-source-cdrom", "test", 2); DO_TEST("fv-utc", "fv-utc", "fvtest", 1); |