From patchwork Thu Jun 17 15:15:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 56057 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 9B06DB7D83 for ; Fri, 18 Jun 2010 01:16:12 +1000 (EST) Received: from localhost ([127.0.0.1]:57264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPGp7-0002LW-Mp for incoming@patchwork.ozlabs.org; Thu, 17 Jun 2010 11:16:09 -0400 Received: from [140.186.70.92] (port=55391 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPGo7-0002Io-EY for qemu-devel@nongnu.org; Thu, 17 Jun 2010 11:15:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPGo6-0007Gn-0s for qemu-devel@nongnu.org; Thu, 17 Jun 2010 11:15:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29910) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPGo5-0007Ge-QY for qemu-devel@nongnu.org; Thu, 17 Jun 2010 11:15:05 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5HFF4tM001126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Jun 2010 11:15:04 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5HFF2ml018639; Thu, 17 Jun 2010 11:15:03 -0400 From: Alex Williamson To: qemu-devel@nongnu.org, agraf@suse.de Date: Thu, 17 Jun 2010 09:15:02 -0600 Message-ID: <20100617151502.9916.3597.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: amit.shah@redhat.com, alex.williamson@redhat.com, mst@redhat.com Subject: [Qemu-devel] [PATCH] virtio-pci: fix bus master bug setting on load 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 The comment suggests we're checking for the driver in the ready state and bus master disabled, but the code is checking that it's not in the ready state. Signed-off-by: Alex Williamson Found-by: Amit Shah Acked-by: Michael S. Tsirkin Acked-by: Amit Shah Acked-by: Alexander Graf Acked-by: Juan Quintela --- hw/virtio-pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index e101fa0..7a86a81 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -155,7 +155,7 @@ static int virtio_pci_load_config(void * opaque, QEMUFile *f) /* Try to find out if the guest has bus master disabled, but is in ready state. Then we have a buggy guest OS. */ - if (!(proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) && + if ((proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) && !(proxy->pci_dev.config[PCI_COMMAND] & PCI_COMMAND_MASTER)) { proxy->bugs |= VIRTIO_PCI_BUG_BUS_MASTER; }