From patchwork Thu Nov 12 08:32:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 543278 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FE4F1413BC for ; Thu, 12 Nov 2015 19:38:27 +1100 (AEDT) Received: from localhost ([::1]:45245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwnOj-0001JM-CK for incoming@patchwork.ozlabs.org; Thu, 12 Nov 2015 03:38:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwnK6-0001Nf-9A for qemu-devel@nongnu.org; Thu, 12 Nov 2015 03:33:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwnK2-0001yL-7X for qemu-devel@nongnu.org; Thu, 12 Nov 2015 03:33:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwnK2-0001yH-1V for qemu-devel@nongnu.org; Thu, 12 Nov 2015 03:33:34 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id BADCC5D; Thu, 12 Nov 2015 08:33:33 +0000 (UTC) Received: from jason-ThinkPad-T430s.nay.redhat.com (dhcp-14-168.nay.redhat.com [10.66.14.168]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAC8WWl5029417; Thu, 12 Nov 2015 03:33:29 -0500 From: Jason Wang To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Thu, 12 Nov 2015 16:32:28 +0800 Message-Id: <1447317150-31076-11-git-send-email-jasowang@redhat.com> In-Reply-To: <1447317150-31076-1-git-send-email-jasowang@redhat.com> References: <1447317150-31076-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Leonid Bloch , Jason Wang , Dmitry Fleytman Subject: [Qemu-devel] [PULL v2 10/12] e1000: Introducing backward compatibility command line parameter X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Leonid Bloch This follows the previous patches, where support for migrating the entire MAC registers' array, and some new MAC registers were introduced. This patch introduces the e1000-specific boolean parameter "extra_mac_registers", which is on by default. Setting it to off will enable migration to older versions of QEMU, but will disable the read and write access to the new registers, that were introduced since adding the ability to migrate the entire MAC array. Example for usage to enable backward compatibility and to disable the new MAC registers: qemu-system-x86_64 -device e1000,extra_mac_registers=off,... ... As mentioned above, the default value is "on". Signed-off-by: Leonid Bloch Signed-off-by: Dmitry Fleytman Signed-off-by: Jason Wang --- hw/net/e1000.c | 2 ++ include/hw/compat.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 793286a..c877e06 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1854,6 +1854,8 @@ static Property e1000_properties[] = { compat_flags, E1000_FLAG_AUTONEG_BIT, true), DEFINE_PROP_BIT("mitigation", E1000State, compat_flags, E1000_FLAG_MIT_BIT, true), + DEFINE_PROP_BIT("extra_mac_registers", E1000State, + compat_flags, E1000_FLAG_MAC_BIT, true), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/compat.h b/include/hw/compat.h index 93e71af..896a1b0 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -6,7 +6,11 @@ .driver = "virtio-blk-device",\ .property = "scsi",\ .value = "true",\ - }, + },{\ + .driver = "e1000",\ + .property = "extra_mac_registers",\ + .value = "off",\ + }, #define HW_COMPAT_2_3 \ {\