From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5Ac-0005Fo-P2 for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj5AY-000223-HQ for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:54 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5AY-00021t-CS for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:50 -0400 Received: by pabtp1 with SMTP id tp1so123641288pab.2 for ; Fri, 17 Apr 2015 05:14:49 -0700 (PDT) From: Shannon Zhao Date: Fri, 17 Apr 2015 20:13:44 +0800 Message-Id: <1429272826-4145-3-git-send-email-shannon.zhao@linaro.org> In-Reply-To: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> References: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> Subject: [Qemu-devel] [PATCH 2/4] hw/s390x/s390-virtio-bus: Add virtio_s390_device_plugged for s390-virtio List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mst@redhat.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org, zhaoshenglong@huawei.com, pbonzini@redhat.com, christoffer.dall@linaro.org Add virtio_s390_device_plugged, it can be used to get backend's features. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/s390x/s390-virtio-bus.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index 047c963..31fdf94 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -504,6 +504,15 @@ static unsigned virtio_s390_get_features(DeviceState *d) return dev->host_features; } +/* This is called by virtio-bus just after the device is plugged. */ +static void virtio_s390_device_plugged(DeviceState *d) +{ + VirtIOS390Device *dev = to_virtio_s390_device(d); + + dev->host_features = virtio_bus_get_vdev_features(&dev->bus, + dev->host_features); +} + /**************** S390 Virtio Bus Device Descriptions *******************/ static Property s390_virtio_net_properties[] = { @@ -715,6 +724,7 @@ static void virtio_s390_bus_class_init(ObjectClass *klass, void *data) bus_class->max_dev = 1; k->notify = virtio_s390_notify; k->get_features = virtio_s390_get_features; + k->device_plugged = virtio_s390_device_plugged; } static const TypeInfo virtio_s390_bus_info = { -- 2.0.4