WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [patch 3/5] xen: xm/create mac selection

To: "Jody Belka" <lists-xen@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [patch 3/5] xen: xm/create mac selection
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Mon, 31 Jan 2005 23:07:16 -0000
Delivery-date: Mon, 31 Jan 2005 23:12:24 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Thread-index: AcUH5Tm9VBDBMJPBSKifcHR3N1x9mQAA/hGg
Thread-topic: [Xen-devel] [patch 3/5] xen: xm/create mac selection
Please can you explain how the randomly generated MACs are kept
different -- I was expecting to see the vif number being folded into the
random MAC generation.

(I'm not saying what you've done doesn't work, I'd just like an
explanation)

Thanks,
Ian 

> -----Original Message-----
> From: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx 
> [mailto:xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jody Belka
> Sent: 31 January 2005 22:33
> To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
> Subject: [Xen-devel] [patch 3/5] xen: xm/create mac selection
> 
> Check for duplicate supplied vif MACs, and make sure
> that randomly generated MACs for a domain are all different
> 
> Signed-off-by: Jody Belka <knew-xen@xxxxxxxx>
> 
> 
> diffstat:
>  create.py |   11 +++++++++++
>  1 files changed, 11 insertions(+)
> 
> 
> diff -durN xen.orig/tools/python/xen/xm/create.py 
> xen/tools/python/xen/xm/create.py
> --- xen.orig/tools/python/xen/xm/create.py    2005-01-30 
> 00:46:29.000000000 +0100
> +++ xen/tools/python/xen/xm/create.py 2005-01-31 
> 18:33:34.744204752 +0100
> @@ -279,10 +279,15 @@
>      vifs = vals.vif
>      vifs_n = max(vals.nics, len(vifs))
>  
> +    macs = []
> +    mac_vifs = {}
> +
>      for idx in range(0, vifs_n):
>          if idx < len(vifs):
>              d = vifs[idx]
>              mac = d.get('mac')
> +            if mac in macs:
> +                gopts.err('Duplicate MAC: %s selected for 
> both vif%i and vif%i' % (mac, mac_vifs[mac], idx + 1))
>              if not mac:
>                  mac = randomMAC()
>              bridge = d.get('bridge')
> @@ -295,6 +300,12 @@
>              script = None
>              backend = None
>              ip = None
> +
> +        while mac in macs:
> +            mac = randomMAC()
> +        macs.append(mac)
> +        mac_vifs[mac] = idx + 1
> +
>          config_vif = ['vif']
>          config_vif.append(['mac', mac])
>          if bridge:
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive 
> Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/xen-devel
> 


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel