From: Amos Kong <akong@redhat.com>
To: stefanha@redhat.com
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, mst@redhat.com
Subject: [Qemu-devel] [PATCH 2/2] extend the macaddr space to 0xffffffff
Date: Mon, 17 Jun 2013 21:35:11 +0800 [thread overview]
Message-ID: <1371476111-4449-3-git-send-email-akong@redhat.com> (raw)
In-Reply-To: <1371476111-4449-1-git-send-email-akong@redhat.com>
Currently we only support to allocate 0xff mac-addresses,
if we start guest by pci-bridge/multiple-func, the macaddr
are not enough.
This patch extends the mac-address space to 0xffffffff
52:54:00:00:00:00 ~ 52:54:ff:ff:ff:ff
Signed-off-by: Amos Kong <akong@redhat.com>
---
net/net.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/net.c b/net/net.c
index f019da4..78bb080 100644
--- a/net/net.c
+++ b/net/net.c
@@ -153,10 +153,12 @@ void qemu_macaddr_default_if_unset(MACAddr *macaddr)
realloc_mac:
macaddr->a[0] = 0x52;
macaddr->a[1] = 0x54;
- macaddr->a[2] = 0x00;
- macaddr->a[3] = 0x12;
- macaddr->a[4] = 0x34;
- macaddr->a[5] = 0x56 + index++;
+ macaddr->a[2] = 0x00 + ((0x120000 + 0x3400 + 0x56 + index) >> 24 & 0xff);
+ macaddr->a[3] = 0x12 + ((0x3400 + 0x56 + index) >> 16 & 0xff);
+ macaddr->a[4] = 0x34 + ((0x56 + index) >> 8 & 0xff);
+ macaddr->a[5] = 0x56 + (index & 0xff);
+
+ index++;
QTAILQ_FOREACH(nc, &net_clients, next) {
peer = nc->peer;
--
1.8.1.4
next prev parent reply other threads:[~2013-06-17 13:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 13:35 [Qemu-devel] [PATCH 0/2] fix macaddr allocation Amos Kong
2013-06-17 13:35 ` [Qemu-devel] [PATCH 1/2] avoid to allcate used macaddr to to new nic Amos Kong
2013-06-17 14:00 ` Michael S. Tsirkin
2013-06-18 2:05 ` Fam Zheng
2013-06-18 6:27 ` Michael S. Tsirkin
2013-06-17 13:35 ` Amos Kong [this message]
2013-06-17 14:04 ` [Qemu-devel] [PATCH 2/2] extend the macaddr space to 0xffffffff Michael S. Tsirkin
2013-06-18 1:51 ` Amos Kong
2013-06-18 6:19 ` Michael S. Tsirkin
2013-06-18 11:21 ` [Qemu-devel] [PATCH 0/2] fix macaddr allocation Stefan Hajnoczi
2013-06-18 12:39 ` Amos Kong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371476111-4449-3-git-send-email-akong@redhat.com \
--to=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).