From patchwork Fri Apr 17 12:13:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47284 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 140322121F for ; Fri, 17 Apr 2015 13:14:19 +0000 (UTC) Received: by lbcne10 with SMTP id ne10sf23822207lbc.1 for ; Fri, 17 Apr 2015 06:14:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=cg8M3lx99zzwv3+nO2+7jOGsPRdm2/TqXDDWUUJfi6k=; b=UiqVLxcJBBCfGJX5ACKyGU/T3RylgRu6Yqq1FEW3RQActiJZp9whk5z5jXadKLuq8L BqgpaWcZOAtWvHZiGXnfHfVENPwjul1x7PErLH7PQea9Vd8ef0czB4UHxbTfNQPXqLyi ElcgbG8fWMCagfUj1tHYXMJWWjabwlQEfafE+HHXjVjuOO5TZSLj4XBdg174HVEqRHkk SnzfTBIrHDHUg+im0d3AwHb8vyZU0iuYxlkvIfzIZBf96BcW4Y1XhJ2A+HXr8BetrYEc 86xgRcWOF+odSA4BmZ+7WntMczTcSTSuR09YHa0kYA/c8/Kux1Gt2cKHCA9sVLbVnz64 hPlA== X-Gm-Message-State: ALoCoQnH0UcIvF0GOS+WnztGsj531G6r2Qc7AoRzCqo0rOrueHLsvXmSu2L9+m4rx2bqgEMNEHd8 X-Received: by 10.152.3.70 with SMTP id a6mr65915laa.0.1429276458033; Fri, 17 Apr 2015 06:14:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.42 with SMTP id j10ls432407laf.27.gmail; Fri, 17 Apr 2015 06:14:17 -0700 (PDT) X-Received: by 10.152.121.72 with SMTP id li8mr3415025lab.11.1429276457823; Fri, 17 Apr 2015 06:14:17 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id le4si8742166lac.158.2015.04.17.06.14.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 06:14:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lagv1 with SMTP id v1so79965587lag.3 for ; Fri, 17 Apr 2015 06:14:17 -0700 (PDT) X-Received: by 10.152.23.70 with SMTP id k6mr3457423laf.76.1429276457738; Fri, 17 Apr 2015 06:14:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp3729092lbt; Fri, 17 Apr 2015 06:14:17 -0700 (PDT) X-Received: by 10.140.93.199 with SMTP id d65mr1224840qge.27.1429276454321; Fri, 17 Apr 2015 06:14:14 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 142si11553849qhu.76.2015.04.17.06.14.13 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Apr 2015 06:14:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:41306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj661-0003HP-4m for patch@linaro.org; Fri, 17 Apr 2015 09:14:13 -0400 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) X-Received: by 10.68.191.229 with SMTP id hb5mr5022233pbc.126.1429272889577; Fri, 17 Apr 2015 05:14:49 -0700 (PDT) Received: from localhost.localdomain ([180.150.153.56]) by mx.google.com with ESMTPSA id nb10sm10006492pdb.76.2015.04.17.05.14.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 05:14:48 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Fri, 17 Apr 2015 20:13:44 +0800 Message-Id: <1429272826-4145-3-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> References: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.52 X-Mailman-Approved-At: Fri, 17 Apr 2015 09:13:08 -0400 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 Subject: [Qemu-devel] [PATCH 2/4] hw/s390x/s390-virtio-bus: Add virtio_s390_device_plugged for s390-virtio 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 = {