[Libvir] [PATCH] NIC should define in order

Currently NIC definition order is reversed. If we set over 4-NICs for a domain by virt-install, this causes a network communication problem. This is because virtual mac to eth relation is lost. This patch fixes the NIC definition order. N.B. If less than 3-NICs, this problem does not occur. Sign-off-by: Hiroyuki Kaguchi <fj7025cf@aa.jp.fujitsu.com> Index: xm_internal.c =================================================================== RCS file: /data/cvs/libvirt/src/xm_internal.c,v retrieving revision 1.53 diff -u -p -r1.53 xm_internal.c --- xm_internal.c 14 Dec 2007 15:51:42 -0000 1.53 +++ xm_internal.c 16 Jan 2008 00:43:17 -0000 @@ -2232,7 +2232,7 @@ virConfPtr xenXMParseXMLToConfig(virConn } vifs->type = VIR_CONF_LIST; vifs->list = NULL; - for (i = 0; i < obj->nodesetval->nodeNr; i++) { + for (i = obj->nodesetval->nodeNr - 1; i >= 0; i--) { virConfValuePtr thisVif; char *vif = xenXMParseXMLVif(conn, obj->nodesetval->nodeTab[i], hvm); if (!vif)

On Thu, Jan 17, 2008 at 04:26:40PM +0900, Hiroyuki Kaguchi wrote:
Currently NIC definition order is reversed. If we set over 4-NICs for a domain by virt-install, this causes a network communication problem. This is because virtual mac to eth relation is lost. This patch fixes the NIC definition order.
N.B. If less than 3-NICs, this problem does not occur.
Okay, since we create the list by inserting on head this makes sense to try to preserve the order in any case, Applied and commited, thanks ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Daniel Veillard
-
Hiroyuki Kaguchi