From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxBmY-0006I9-5P for qemu-devel@nongnu.org; Tue, 26 May 2015 06:08:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxBmT-0001YQ-VT for qemu-devel@nongnu.org; Tue, 26 May 2015 06:08:22 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:35367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxBmT-0001YG-O0 for qemu-devel@nongnu.org; Tue, 26 May 2015 06:08:17 -0400 Received: by wgme6 with SMTP id e6so23856080wgm.2 for ; Tue, 26 May 2015 03:08:17 -0700 (PDT) Date: Tue, 26 May 2015 11:08:12 +0100 From: Stefan Hajnoczi Message-ID: <20150526100812.GE13262@stefanha-thinkpad.redhat.com> References: <1432201488-3832-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C94crkcyjafcjHxo" Content-Disposition: inline In-Reply-To: <1432201488-3832-1-git-send-email-zhaoshenglong@huawei.com> Subject: Re: [Qemu-devel] [RFC PATCH] net/net: Record usage status of mac address List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao Cc: hangaohuai@huawei.com, shannon.zhao@linaro.org, qemu-devel@nongnu.org, stefanha@redhat.com, peter.huangpeng@huawei.com --C94crkcyjafcjHxo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 21, 2015 at 05:44:48PM +0800, Shannon Zhao wrote: > From: Shannon Zhao >=20 > Currently QEMU dynamically generates mac address for the NIC which > doesn't specify the mac address. But when we hotplug a NIC without > specifying mac address, the mac address will increase for the same NIC > along with hotplug and hot-unplug, and at last it will overflow. And if > we codeplug one NIC with mac address e.g. "52:54:00:12:34:56", then > hotplug one NIC without specifying mac address and the mac address of > the hotplugged NIC is duplicate of "52:54:00:12:34:56". >=20 > This patch add a mac_table to record the usage status and free the mac > address when the NIC is unrealized. >=20 > Signed-off-by: Shannon Zhao > Signed-off-by: Shannon Zhao > --- > net/net.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--= -- > 1 file changed, 55 insertions(+), 4 deletions(-) Thanks, applied to my net tree: https://github.com/stefanha/qemu/commits/net Stefan --C94crkcyjafcjHxo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVZEYMAAoJEJykq7OBq3PIerkH/iXGvFKCf6vaIbIn1uZtXjy6 NkbGl4/kbq+83Z4NOYBpRsUkVxkshkF3L3P/irLWlsajpRfwfvN34GmXKRIgnL59 aATnOpTun61CbDXumcuCFACPgVXb0iZveKtN8XqBtjxU6g0Zgv+09M+Q6iGLE386 oS1ESEbeEaXz+lEicrqRPQRrUIiQ9oZi7dTdUcpp2e7Jrd3XLIc0x7oExWQ8Z84H Yyq5iCMZAAcH5tZ5SAl7nP/9hPiFw80M6KV9madQYMU5U9KpPavPn8ZELIStCO9V wtnoomJQ2jWwm2l2YqaHdfjJt4chHT8ZmgaMOvPkVuAWKeJu3ucikkf2oR2IhmU= =mr7S -----END PGP SIGNATURE----- --C94crkcyjafcjHxo--