From patchwork Fri Apr 17 12:13:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47285 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 655322121F for ; Fri, 17 Apr 2015 13:14:21 +0000 (UTC) Received: by laat2 with SMTP id t2sf25007412laa.2 for ; Fri, 17 Apr 2015 06:14:20 -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=vqgoAfCWL14J/J4cRSNeKIJV4n4HrnEbRtfeqmnYNpM=; b=lNBtPVZMr+FOic8NeTOhU1zvUnDLOcVegUFkuiqjZp/E2SbA5fQK0N66LSEhb5at4+ S1mSWyd/NXSU2pL9+T28VWXr8FK9fYmCTDABKW+DjwmdQFDgws3HgnLzc90lZRgSlNZJ vH8DRFTZTG3T8c8gMW6bKMoYRz9OkU18UQxc4/MV7uQr/sdhzHoVc7HbRkteZKvYVLor LhdU4lZ/Mn0HICqLlwuvGrGGU+qrJssDEQai8tTTadD9ozAIEG2r48fHEc/F5RfsgapF r8LSTTmK2iPIzPFYH/PJzFeR39zsvFyMYb7Ab/HC0YrCFo0+3YCh9ETkyHfaHGMYIUdc xaNw== X-Gm-Message-State: ALoCoQkz80h9pv+LeSwqqC6HwIEy3oy+om/mhZCq0d5pnzEDAo/tGF85ApU4m082pNNU8Eisjtp0 X-Received: by 10.112.166.137 with SMTP id zg9mr1459857lbb.11.1429276460352; Fri, 17 Apr 2015 06:14:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.50 with SMTP id bd18ls523761lab.108.gmail; Fri, 17 Apr 2015 06:14:20 -0700 (PDT) X-Received: by 10.152.36.2 with SMTP id m2mr3468189laj.72.1429276460144; Fri, 17 Apr 2015 06:14:20 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id yq7si8749645lab.133.2015.04.17.06.14.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 06:14:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagv1 with SMTP id v1so79966404lag.3 for ; Fri, 17 Apr 2015 06:14:20 -0700 (PDT) X-Received: by 10.152.197.34 with SMTP id ir2mr3540320lac.36.1429276460056; Fri, 17 Apr 2015 06:14:20 -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 l1csp3729114lbt; Fri, 17 Apr 2015 06:14:19 -0700 (PDT) X-Received: by 10.55.22.23 with SMTP id g23mr5342543qkh.4.1429276455211; Fri, 17 Apr 2015 06:14:15 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t4si11581819qge.10.2015.04.17.06.14.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Apr 2015 06:14:15 -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]:41307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj662-0003He-0B for patch@linaro.org; Fri, 17 Apr 2015 09:14:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5AV-00056v-Hz for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj5AQ-00020R-PN for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:47 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5AQ-00020E-KH for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:14:42 -0400 Received: by paboj16 with SMTP id oj16so123767697pab.0 for ; Fri, 17 Apr 2015 05:14:42 -0700 (PDT) X-Received: by 10.70.96.65 with SMTP id dq1mr5009752pdb.79.1429272882219; Fri, 17 Apr 2015 05:14:42 -0700 (PDT) Received: from localhost.localdomain ([180.150.153.56]) by mx.google.com with ESMTPSA id nb10sm10006492pdb.76.2015.04.17.05.14.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 05:14:40 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Fri, 17 Apr 2015 20:13:43 +0800 Message-Id: <1429272826-4145-2-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.43 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 1/4] hw/s390x/virtio-ccw: Add virtio_ccw_device_plugged for virtio-ccw 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.53 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_ccw_device_plugged, it can be used to get backend's features. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/s390x/virtio-ccw.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 130535c..30ca377 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1395,6 +1395,16 @@ static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f) return 0; } +/* This is called by virtio-bus just after the device is plugged. */ +static void virtio_ccw_device_plugged(DeviceState *d) +{ + VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); + + /* Only the first 32 feature bits are used. */ + dev->host_features[0] = virtio_bus_get_vdev_features(&dev->bus, + dev->host_features[0]); +} + /**************** Virtio-ccw Bus Device Descriptions *******************/ static Property virtio_ccw_net_properties[] = { @@ -1711,6 +1721,7 @@ static void virtio_ccw_bus_class_init(ObjectClass *klass, void *data) k->load_queue = virtio_ccw_load_queue; k->save_config = virtio_ccw_save_config; k->load_config = virtio_ccw_load_config; + k->device_plugged = virtio_ccw_device_plugged; } static const TypeInfo virtio_ccw_bus_info = {