From patchwork Mon Aug 20 14:13:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 178845 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A1DAE2C007E for ; Tue, 21 Aug 2012 00:32:08 +1000 (EST) Received: from localhost ([::1]:53832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3Sk9-0001BI-V1 for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2012 10:14:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3SjS-0007YK-AP for qemu-devel@nongnu.org; Mon, 20 Aug 2012 10:13:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3SjM-0007D2-6i for qemu-devel@nongnu.org; Mon, 20 Aug 2012 10:13:30 -0400 Received: from mail-ee0-f45.google.com ([74.125.83.45]:36322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3SjM-0007Bp-0D for qemu-devel@nongnu.org; Mon, 20 Aug 2012 10:13:24 -0400 Received: by mail-ee0-f45.google.com with SMTP id e53so1679130eek.4 for ; Mon, 20 Aug 2012 07:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=R9EmKMV+iULqzzPZ6GJU92t/PLqus3BQPi2g4usg8Jg=; b=Hh8e3GIVtOzFpT4/Ks6Tl+LaoNrON2cmozd8B6eea8NZzSPYlOLsfEL7W4dvGS5jdW CRTrefY6OLO8Ym/LhZu1a/cojewRM6B3WLrBNOpBepaUpfrsnfTgGe+wCAH9W6/kyKsF pcr2WOahsfAlsMrZMIQ4G17UxWyS7Fe0B4D4jU4oxz3NpK4uxSOPY2W6Mo5GjieJovd6 o97ClByyXGPKQHqgGNBKagunRCJi2xF7THvINVBZheX7T4tUi1n7ZKoIdn7Owq5B2VMr Q8ddWqhFQJuQKso35tC6X03dziOZUx+dSSY6wGuaXukscqYzuZdYVg8ud0d39DqSh2f1 HAlQ== Received: by 10.14.202.131 with SMTP id d3mr9062940eeo.32.1345472003716; Mon, 20 Aug 2012 07:13:23 -0700 (PDT) Received: from yakj.usersys.redhat.com (nat-pool-mxp-t.redhat.com. [209.132.186.18]) by mx.google.com with ESMTPS id 45sm42202715eed.17.2012.08.20.07.13.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Aug 2012 07:13:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2012 16:13:13 +0200 Message-Id: <1345471993-31629-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1345471993-31629-1-git-send-email-pbonzini@redhat.com> References: <1345471993-31629-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.45 Cc: anthony@codemonkey.ws Subject: [Qemu-devel] [PATCH 5/5] virtio-scsi: add backwards-compatibility properties for 1.1 and earlier machines 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 Hotplug and parameter change are new in 1.2, disable them via compat properties for pc-1.1 and earlier. Signed-off-by: Paolo Bonzini --- hw/pc_piix.c | 8 ++++++++ hw/virtio-scsi.c | 7 ------- hw/virtio-scsi.h | 9 ++++++++- 3 file modificati, 16 inserzioni(+), 8 rimozioni(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 0c0096f..a960710 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -360,6 +360,14 @@ static QEMUMachine pc_machine_v1_2 = { #define PC_COMPAT_1_1 \ {\ + .driver = "virtio-scsi-pci",\ + .property = "hotplug",\ + .value = "off",\ + },{\ + .driver = "virtio-scsi-pci",\ + .property = "param_change",\ + .value = "off",\ + },{\ .driver = "VGA",\ .property = "vgamem_mb",\ .value = stringify(8),\ diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index 5f737ac..c1b47a8 100644 --- a/hw/virtio-scsi.c +++ b/hw/virtio-scsi.c @@ -24,11 +24,6 @@ #define VIRTIO_SCSI_MAX_TARGET 255 #define VIRTIO_SCSI_MAX_LUN 16383 -/* Feature Bits */ -#define VIRTIO_SCSI_F_INOUT 0 -#define VIRTIO_SCSI_F_HOTPLUG 1 -#define VIRTIO_SCSI_F_CHANGE 2 - /* Response codes */ #define VIRTIO_SCSI_S_OK 0 #define VIRTIO_SCSI_S_OVERRUN 1 @@ -561,8 +556,6 @@ static void virtio_scsi_set_config(VirtIODevice *vdev, static uint32_t virtio_scsi_get_features(VirtIODevice *vdev, uint32_t requested_features) { - requested_features |= (1UL << VIRTIO_SCSI_F_HOTPLUG); - requested_features |= (1UL << VIRTIO_SCSI_F_CHANGE); return requested_features; } diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h index 4bc889d..91924f6 100644 --- a/hw/virtio-scsi.h +++ b/hw/virtio-scsi.h @@ -21,6 +21,11 @@ /* The ID for virtio_scsi */ #define VIRTIO_ID_SCSI 8 +/* Feature Bits */ +#define VIRTIO_SCSI_F_INOUT 0 +#define VIRTIO_SCSI_F_HOTPLUG 1 +#define VIRTIO_SCSI_F_CHANGE 2 + struct VirtIOSCSIConf { uint32_t num_queues; uint32_t max_sectors; @@ -31,6 +36,8 @@ struct VirtIOSCSIConf { DEFINE_VIRTIO_COMMON_FEATURES(_state, _features_field), \ DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1), \ DEFINE_PROP_UINT32("max_sectors", _state, _conf_field.max_sectors, 0xFFFF), \ - DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128) + DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128), \ + DEFINE_PROP_BIT("hotplug", _state, _features_field, VIRTIO_SCSI_F_HOTPLUG, true), \ + DEFINE_PROP_BIT("param_change", _state, _features_field, VIRTIO_SCSI_F_CHANGE, true) #endif /* _QEMU_VIRTIO_SCSI_H */