From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj7bU-0004zC-Q1 for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:50:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj7bQ-0005NC-EZ for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:50:48 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:36056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj7bQ-0005Mt-1Z for qemu-devel@nongnu.org; Fri, 17 Apr 2015 10:50:44 -0400 Received: by wizk4 with SMTP id k4so24741154wiz.1 for ; Fri, 17 Apr 2015 07:50:43 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150417154455.2aa48701.cornelia.huck@de.ibm.com> References: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> <1429272826-4145-2-git-send-email-shannon.zhao@linaro.org> <20150417154455.2aa48701.cornelia.huck@de.ibm.com> Date: Fri, 17 Apr 2015 22:50:43 +0800 Message-ID: From: Shannon Zhao Content-Type: multipart/alternative; boundary=047d7bfd027a6420ad0513ecb4c5 Subject: Re: [Qemu-devel] [PATCH 1/4] hw/s390x/virtio-ccw: Add virtio_ccw_device_plugged for virtio-ccw List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: "peter.maydell@linaro.org" , "mst@redhat.com" , "peter.huangpeng@huawei.com" , "qemu-devel@nongnu.org" , "zhaoshenglong@huawei.com" , "pbonzini@redhat.com" , "christoffer.dall@linaro.org" --047d7bfd027a6420ad0513ecb4c5 Content-Type: text/plain; charset=UTF-8 On Friday, 17 April 2015, Cornelia Huck wrote: > On Fri, 17 Apr 2015 20:13:43 +0800 > Shannon Zhao wrote: > >> 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]); >> +} >> + > > So how does this help? We already fetch the host features in the > realize function. > please see patch 4/4, in this patch we will move the properties to backends. So the features can't fetch through realize function. If you ask me why we need to move, it's because these properties actually belongs to the backends and then we can support virtio-mmio to have these properties. >> /**************** Virtio-ccw Bus Device Descriptions *******************/ >> >> static Property virtio_ccw_net_properties[] = { > > --047d7bfd027a6420ad0513ecb4c5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Friday, 17 April 2015, Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> On Fri= , 17 Apr 2015 20:13:43 +0800
> Shannon Zhao <shannon.zhao@linaro.org> wrote:
>
>= ;> Add virtio_ccw_device_plugged, it can be used to get backend's fe= atures.
>>
>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
>&g= t; Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>> ---
>>=C2=A0 hw/s39= 0x/virtio-ccw.c | 11 +++++++++++
>>=C2=A0 1 file changed, 11 inser= tions(+)
>>
>> diff --git a/hw/s390x/virtio-ccw.c b/hw/s3= 90x/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, Q= EMUFile *f)
>>=C2=A0 =C2=A0 =C2=A0 return 0;
>>=C2=A0 }>>
>> +/* This is called by virtio-bus just after the devi= ce is plugged. */
>> +static void virtio_ccw_device_plugged(Device= State *d)
>> +{
>> +=C2=A0 =C2=A0 VirtioCcwDevice *dev = =3D VIRTIO_CCW_DEVICE(d);
>> +
>> +=C2=A0 =C2=A0 /* Only = the first 32 feature bits are used. */
>> +=C2=A0 =C2=A0 dev->h= ost_features[0] =3D virtio_bus_get_vdev_features(&dev->bus,
>&= gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dev->host_fea= tures[0]);
>> +}
>> +
>
> So how does this he= lp? We already fetch the host features in the
> realize function.
= >

please see patch 4/4, in this patch we will move the properties= to backends. So the features can't fetch through realize function.
= If you ask me why we need to move, it's because these properties actual= ly belongs to the backends and then we can support virtio-mmio to have thes= e properties.

>>=C2=A0 /**************** Virtio-ccw Bus Device= Descriptions *******************/
>>
>>=C2=A0 static Pro= perty virtio_ccw_net_properties[] =3D {
>
> --047d7bfd027a6420ad0513ecb4c5--