From patchwork Thu Mar 21 14:15:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fred.konrad@greensocs.com X-Patchwork-Id: 229699 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 198CD2C009C for ; Fri, 22 Mar 2013 01:19:31 +1100 (EST) Received: from localhost ([::1]:45071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIgL0-0007Gr-18 for incoming@patchwork.ozlabs.org; Thu, 21 Mar 2013 10:19:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIgHv-000360-Or for qemu-devel@nongnu.org; Thu, 21 Mar 2013 10:16:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIgHW-0000eL-N3 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 10:16:10 -0400 Received: from greensocs.com ([87.106.252.221]:54604 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIgHV-0000be-NP for qemu-devel@nongnu.org; Thu, 21 Mar 2013 10:15:50 -0400 Received: from localhost (unknown [127.0.0.1]) by s15328186.onlinehome-server.info (Postfix) with ESMTP id 8441F44D685; Thu, 21 Mar 2013 14:15:40 +0000 (UTC) Received: from s15328186.onlinehome-server.info ([127.0.0.1]) by localhost (s15328186.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RMseWdUG2wYU; Thu, 21 Mar 2013 15:15:37 +0100 (CET) Received: by s15328186.onlinehome-server.info (Postfix, from userid 491) id A884743EE3D; Thu, 21 Mar 2013 15:15:34 +0100 (CET) Received: from compaq.katmai.xl.cx.katmai.xl.cx (lan31-11-83-155-143-136.fbx.proxad.net [83.155.143.136]) by s15328186.onlinehome-server.info (Postfix) with ESMTPSA id 713C043EE31; Thu, 21 Mar 2013 15:15:33 +0100 (CET) From: fred.konrad@greensocs.com To: qemu-devel@nongnu.org, aliguori@us.ibm.com Date: Thu, 21 Mar 2013 15:15:13 +0100 Message-Id: <1363875320-7985-4-git-send-email-fred.konrad@greensocs.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1363875320-7985-1-git-send-email-fred.konrad@greensocs.com> References: <1363875320-7985-1-git-send-email-fred.konrad@greensocs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 87.106.252.221 Cc: cornelia.huck@de.ibm.com, peter.maydell@linaro.org, Paolo Bonzini , mark.burton@greensocs.com, fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH v5 03/10] virtio-scsi: moving host_features from properties to transport properties. 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: KONRAD Frederic host_features field is part of the transport device. So move all the host_features related properties into transport device. Signed-off-by: KONRAD Frederic --- hw/s390x/s390-virtio-bus.c | 3 ++- hw/s390x/virtio-ccw.c | 3 ++- hw/virtio-pci.c | 3 ++- hw/virtio-scsi.h | 18 +++++++++++------- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index 76bc99a..68db7b9 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -543,7 +543,8 @@ static const TypeInfo virtio_s390_device_info = { }; static Property s390_virtio_scsi_properties[] = { - DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOS390Device, host_features, scsi), + DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOS390Device, scsi), + DEFINE_VIRTIO_SCSI_FEATURES(VirtIOS390Device, host_features), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 9688835..f852721 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -836,7 +836,8 @@ static const TypeInfo virtio_ccw_balloon = { static Property virtio_ccw_scsi_properties[] = { DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id), - DEFINE_VIRTIO_SCSI_PROPERTIES(VirtioCcwDevice, host_features[0], scsi), + DEFINE_VIRTIO_SCSI_PROPERTIES(VirtioCcwDevice, scsi), + DEFINE_VIRTIO_SCSI_FEATURES(VirtioCcwDevice, host_features[0]), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index f3ece78..0cf8b2e 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -1221,7 +1221,8 @@ static void virtio_scsi_exit_pci(PCIDevice *pci_dev) static Property virtio_scsi_properties[] = { DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, DEV_NVECTORS_UNSPECIFIED), - DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOPCIProxy, host_features, scsi), + DEFINE_VIRTIO_SCSI_FEATURES(VirtIOPCIProxy, host_features), + DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOPCIProxy, scsi), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h index fb83b67..da02f08 100644 --- a/hw/virtio-scsi.h +++ b/hw/virtio-scsi.h @@ -47,12 +47,16 @@ typedef struct VirtIOSCSI { VirtQueue **cmd_vqs; } VirtIOSCSI; -#define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _features_field, _conf_field) \ - 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_BIT("hotplug", _state, _features_field, VIRTIO_SCSI_F_HOTPLUG, true), \ - DEFINE_PROP_BIT("param_change", _state, _features_field, VIRTIO_SCSI_F_CHANGE, true) +#define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _conf_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 DEFINE_VIRTIO_SCSI_FEATURES(_state, _feature_field) \ + DEFINE_VIRTIO_COMMON_FEATURES(_state, _feature_field), \ + DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG, \ + true), \ + DEFINE_PROP_BIT("param_change", _state, _feature_field, \ + VIRTIO_SCSI_F_CHANGE, true) #endif /* _QEMU_VIRTIO_SCSI_H */