From patchwork Mon Feb 15 15:13:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 45393 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 92B7FB7C67 for ; Tue, 16 Feb 2010 02:57:00 +1100 (EST) Received: from localhost ([127.0.0.1]:57542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nh3F8-0007Sw-Uu for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2010 10:52:14 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nh3Dy-0007SW-FH for qemu-devel@nongnu.org; Mon, 15 Feb 2010 10:51:02 -0500 Received: from [199.232.76.173] (port=35951 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nh3Dx-0007SM-LI for qemu-devel@nongnu.org; Mon, 15 Feb 2010 10:51:01 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nh3Dw-0002FZ-D5 for qemu-devel@nongnu.org; Mon, 15 Feb 2010 10:51:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52615) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nh2fR-00081P-AK for qemu-devel@nongnu.org; Mon, 15 Feb 2010 10:15:21 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1FFFCFW025565 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Feb 2010 10:15:12 -0500 Received: from localhost (vpn-234-46.phx2.redhat.com [10.3.234.46]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1FFFAON001843; Mon, 15 Feb 2010 10:15:11 -0500 From: Amit Shah To: qemu-devel@nongnu.org Date: Mon, 15 Feb 2010 20:43:56 +0530 Message-Id: <1266246836-19932-3-git-send-email-amit.shah@redhat.com> In-Reply-To: <1266246836-19932-2-git-send-email-amit.shah@redhat.com> References: <1266246836-19932-1-git-send-email-amit.shah@redhat.com> <1266246836-19932-2-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Amit Shah , kraxel@redhat.com, "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH v2 3/3] virtio-serial: don't set MULTIPORT for 1 port dev X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Michael S. Tsirkin Since commit 98b19252cf1bd97c54bc4613f3537c5ec0aae263, all serial devices declare MULTIPORT feature. To allow 0.12 compatibility, we should clear this when max_nr_ports is 1. Signed-off-by: Michael S. Tsirkin Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index ab456ea..d0e0219 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -335,8 +335,10 @@ static void handle_input(VirtIODevice *vdev, VirtQueue *vq) static uint32_t get_features(VirtIODevice *vdev, uint32_t features) { - features |= (1 << VIRTIO_CONSOLE_F_MULTIPORT); - + VirtIOSerial *vser = DO_UPCAST(VirtIOSerial, vdev, vdev); + if (vser->bus->max_nr_ports > 1) { + features |= (1 << VIRTIO_CONSOLE_F_MULTIPORT); + } return features; }