From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTYa1-0006wo-7i for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:39:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTYZu-0003U0-Qo for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:39:04 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:53802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTYZu-00038H-AL for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:38:58 -0500 Received: by mail-iy0-f173.google.com with SMTP id k32so3301487iak.4 for ; Thu, 24 Nov 2011 04:38:58 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 24 Nov 2011 13:38:26 +0100 Message-Id: <1322138308-31040-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1322138308-31040-1-git-send-email-pbonzini@redhat.com> References: <1322138308-31040-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 7/9] virtio-blk: move property declarations to header file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com Include also other properties than features. This adds the common virtio features to s390. Signed-off-by: Paolo Bonzini --- hw/s390-virtio-bus.c | 2 +- hw/virtio-blk.h | 5 +++++ hw/virtio-pci.c | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c index cf7cfef..71720b9 100644 --- a/hw/s390-virtio-bus.c +++ b/hw/s390-virtio-bus.c @@ -348,7 +348,7 @@ static VirtIOS390DeviceInfo s390_virtio_blk = { .qdev.size = sizeof(VirtIOS390Device), .qdev.props = (Property[]) { DEFINE_BLOCK_PROPERTIES(VirtIOS390Device, block), - DEFINE_PROP_STRING("serial", VirtIOS390Device, blk.serial), + DEFINE_VIRTIO_BLK_PROPERTIES(VirtIOS390Device, host_features, blk), DEFINE_PROP_END_OF_LIST(), }, }; diff --git a/hw/virtio-blk.h b/hw/virtio-blk.h index 5f150f8..dd26ae7 100644 --- a/hw/virtio-blk.h +++ b/hw/virtio-blk.h @@ -110,4 +110,9 @@ struct VirtIOBlkConf #define DEFINE_VIRTIO_BLK_FEATURES(_state, _field) \ DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) #endif + +#define DEFINE_VIRTIO_BLK_PROPERTIES(_state, _features_field, _conf_field) \ + DEFINE_VIRTIO_BLK_FEATURES(_state, _features_field), \ + DEFINE_PROP_STRING("serial", _state, _conf_field.serial) + #endif diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index bd111d0..d64058e 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -808,11 +808,10 @@ static PCIDeviceInfo virtio_info[] = { .qdev.props = (Property[]) { DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), DEFINE_BLOCK_PROPERTIES(VirtIOPCIProxy, block), - DEFINE_PROP_STRING("serial", VirtIOPCIProxy, blk.serial), DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), - DEFINE_VIRTIO_BLK_FEATURES(VirtIOPCIProxy, host_features), + DEFINE_VIRTIO_BLK_PROPERTIES(VirtIOPCIProxy, host_features, blk), DEFINE_PROP_END_OF_LIST(), }, .qdev.reset = virtio_pci_reset, -- 1.7.7.1