From: Yoni Bettan <ybettan@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org, ailan@redhat.com, ehabkost@redhat.com,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [RFC-PATCH] Introducing virtio-example device.
Date: Wed, 10 Apr 2019 18:45:14 +0300 [thread overview]
Message-ID: <1871f593-ec5b-fede-7da5-a7ae78056249@redhat.com> (raw)
In-Reply-To: <20190409131734.GE16944@stefanha-x1.localdomain>
On 4/9/19 4:17 PM, Stefan Hajnoczi wrote:
> On Mon, Apr 01, 2019 at 02:18:43PM +0300, Yoni Bettan wrote:
>> The main goal is to add an example device to Qemu to be used as template or
>> guideline for contributors when they wish to create a new virtio device.
>>
>> Another reason for this device is to document "the right way" to write
>> a new virtio device in Qemu.
>>
>> This device is a simple device and its functionality is to increase its input
>> by 1.
>>
>> The device driver is located at:
>> https://github.com/ybettan/QemuDeviceDrivers.git
>>
>> In addition I am writing a blog to give a logical overview of the virtio
>> protocol and a step-by-step guide to write a new virtio device.
>> This blog can be found at https://howtovms.wordpress.com.
>>
>> scripts/checkpatch.pl have some errors do to "//" (old style one line comment),
>> those lines contains FIXMEs for the next version and will be removed.
>>
>> Signed-off-by: Yoni Bettan <ybettan@redhat.com>
Hi Stefan and thank you for your review.
> Where is the specification for this device? The lack of specification
> is already not "the right way".
Another step in this process is to write a specification for this
device. Since I am learning the virtio protocol while implementing this
example device it was easier for me to start with the device and from
there write its specification but take into consideration that the
specification will be written soon.
>
> There are multiple problems with the code, but the larger issue is that
> this example device is just helping people shoot themselves in the foot
> more easily.
If you can point me to those problem I will be glad so I can update the
code and understand those problems you are talking about.
>
> The difficulty with VIRTIO is not how to implement devices/drivers, it's
> that people don't read the specification and therefore do not understand
> the device model properly. The spec is dry and missing information in
> some places. I think more accessible documentation, like your blog, can
> help here.
As I said, the blog will be updated with explanations on each step of
the communication between the device and the driver and the reason it is
not there yet is because I preferred getting some reviews, make the code
better and only then documenting "the write way" to not mislead peoples.
>
> If you would like to educate people about VIRTIO, then explaining the
> device model, lifecycle, how to change a device in a
> backwards-compatible way, virtqueue semantics, etc are the topics that
> deserve attention.
>
> For someone who has learnt these topics, implementing the device/driver
> is not hard. For someone who doesn't understand these topics, no
> example device will help. At best they will copy-paste together
> something that sort of works but has issues.
For me, reading the specification and even reading some code examples
over the internet didn't made me understand it until I saw the related
code so I agree with you it is not enough yet but all the other parts
are on there way.
The final purpose is to have:
1. device specification
2. device implementation
3. device driver
4. blog
maybe I should have written it at the beginning, this is not the entire
project but it is its start.
>
> Stefan
Thanks again for your review.
WARNING: multiple messages have this Message-ID (diff)
From: Yoni Bettan <ybettan@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
ailan@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com
Subject: Re: [Qemu-devel] [RFC-PATCH] Introducing virtio-example device.
Date: Wed, 10 Apr 2019 18:45:14 +0300 [thread overview]
Message-ID: <1871f593-ec5b-fede-7da5-a7ae78056249@redhat.com> (raw)
Message-ID: <20190410154514.Eh7TWEE-BSXJGQCqDNhydl4I1-GLcvNlfvtQHV277cs@z> (raw)
In-Reply-To: <20190409131734.GE16944@stefanha-x1.localdomain>
On 4/9/19 4:17 PM, Stefan Hajnoczi wrote:
> On Mon, Apr 01, 2019 at 02:18:43PM +0300, Yoni Bettan wrote:
>> The main goal is to add an example device to Qemu to be used as template or
>> guideline for contributors when they wish to create a new virtio device.
>>
>> Another reason for this device is to document "the right way" to write
>> a new virtio device in Qemu.
>>
>> This device is a simple device and its functionality is to increase its input
>> by 1.
>>
>> The device driver is located at:
>> https://github.com/ybettan/QemuDeviceDrivers.git
>>
>> In addition I am writing a blog to give a logical overview of the virtio
>> protocol and a step-by-step guide to write a new virtio device.
>> This blog can be found at https://howtovms.wordpress.com.
>>
>> scripts/checkpatch.pl have some errors do to "//" (old style one line comment),
>> those lines contains FIXMEs for the next version and will be removed.
>>
>> Signed-off-by: Yoni Bettan <ybettan@redhat.com>
Hi Stefan and thank you for your review.
> Where is the specification for this device? The lack of specification
> is already not "the right way".
Another step in this process is to write a specification for this
device. Since I am learning the virtio protocol while implementing this
example device it was easier for me to start with the device and from
there write its specification but take into consideration that the
specification will be written soon.
>
> There are multiple problems with the code, but the larger issue is that
> this example device is just helping people shoot themselves in the foot
> more easily.
If you can point me to those problem I will be glad so I can update the
code and understand those problems you are talking about.
>
> The difficulty with VIRTIO is not how to implement devices/drivers, it's
> that people don't read the specification and therefore do not understand
> the device model properly. The spec is dry and missing information in
> some places. I think more accessible documentation, like your blog, can
> help here.
As I said, the blog will be updated with explanations on each step of
the communication between the device and the driver and the reason it is
not there yet is because I preferred getting some reviews, make the code
better and only then documenting "the write way" to not mislead peoples.
>
> If you would like to educate people about VIRTIO, then explaining the
> device model, lifecycle, how to change a device in a
> backwards-compatible way, virtqueue semantics, etc are the topics that
> deserve attention.
>
> For someone who has learnt these topics, implementing the device/driver
> is not hard. For someone who doesn't understand these topics, no
> example device will help. At best they will copy-paste together
> something that sort of works but has issues.
For me, reading the specification and even reading some code examples
over the internet didn't made me understand it until I saw the related
code so I agree with you it is not enough yet but all the other parts
are on there way.
The final purpose is to have:
1. device specification
2. device implementation
3. device driver
4. blog
maybe I should have written it at the beginning, this is not the entire
project but it is its start.
>
> Stefan
Thanks again for your review.
next prev parent reply other threads:[~2019-04-10 15:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 11:18 [Qemu-devel] [RFC-PATCH] Introducing virtio-example device Yoni Bettan
2019-04-05 21:30 ` Eduardo Habkost
2019-04-05 21:30 ` Eduardo Habkost
2019-04-09 13:17 ` Stefan Hajnoczi
2019-04-09 13:17 ` Stefan Hajnoczi
2019-04-10 15:45 ` Yoni Bettan [this message]
2019-04-10 15:45 ` Yoni Bettan
2019-04-10 19:15 ` Stefan Hajnoczi
2019-04-10 19:15 ` Stefan Hajnoczi
2019-04-11 1:30 ` Michael S. Tsirkin
2019-04-11 1:30 ` Michael S. Tsirkin
2019-04-10 19:25 ` Stefan Hajnoczi
2019-04-10 19:25 ` Stefan Hajnoczi
2019-04-14 11:20 ` Yoni Bettan
2019-04-14 11:20 ` Yoni Bettan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1871f593-ec5b-fede-7da5-a7ae78056249@redhat.com \
--to=ybettan@redhat.com \
--cc=ailan@redhat.com \
--cc=ehabkost@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).