qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Pisa <pisa@cmp.felk.cvut.cz>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Marek Vasut" <marex@denx.de>,
	"Stefan Hajnoczi" <stefanha@gmail.com>,
	"Deniz Eren" <deniz.eren@icloud.com>,
	qemu-devel@nongnu.org, "Oleksij Rempel" <o.rempel@pengutronix.de>,
	"Konrad Frederic" <frederic.konrad@adacore.com>,
	"Jan Kiszka" <jan.kiszka@siemens.com>,
	"Oliver Hartkopp" <socketcan@hartkopp.net>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH V4 0/7] CAN bus support for QEMU (SJA1000 PCI so far)
Date: Sun, 28 Jan 2018 10:02:40 +0100	[thread overview]
Message-ID: <201801281002.40862.pisa@cmp.felk.cvut.cz> (raw)
In-Reply-To: <8f7d0063-6290-bdd5-7383-5bf3ae10e6dd@redhat.com>

Hello Paolo,

On Friday 26 of January 2018 12:12:32 Paolo Bonzini wrote:
> Coincidentially, I have some time on a flight next Monday. :)  I
> obviously cannot really _test_ anything, but I can at least do the
> changes below and set up all the QOM boilerplate.

thanks much for offer to help.

Deniz Eren or Oleksij Rempel can test your changes as well.

I have prepared branch "can-pci-qom" in GitLab repository

  https://gitlab.fel.cvut.cz/canbus/qemu-canbus

  https://gitlab.fel.cvut.cz/canbus/qemu-canbus/tree/can-pci-qom

and I have updated all PCI devices to use realize() instead of init(),
eliminated all uses of exit() and changed error reporting to use
error_setg() and error_setg_errno(). So I think that there is
no fatal blocker in these files. Problematic is setup
of connect_to_host variant

 can_bus_set_connect_to_host(can_bus_connect_to_host_socketcan);

in "hw/can/can_socketcan.c" and location of this file
in HW. I keep it there to have all CAN support *.c
files in single place for now.

I have studied "tests/check-qom-proplist.c" for while
but I expect that you will be much more successfull
and efficient to define mainline acceptable object model.

Thanks again,

Pavel

> >> The best way would be a QOM object.  That is, you would do
> >>
> >>    -object can-bus,id=canbus0
> >>    -object can-host-socketcan,id=can0-host,canbus=canbus0,if=can0
> >>    -device kvaser_pci,canbus=canbus0
> >
> > I would prefer to allow CAN emulation to be used without
> > explicit can-bus object creation specified on the command line.
> > The bus object could be created when requested by
> > can-host-socketcan or device (kvaser_pci) automatically.
>
> It could be fine to allow "-device kvaser_pci" to automatically create a
> private bus.  However, IMO it's better to be explicit in the case where
> multiple objects (e.g. can-host-socketcan and the kvaser_pci device, or
> two controllers) want to connect to the same object.
>
> >> Separating the QOM objects is a bit more work, but it makes the
> >> semantics clearer.  The classes would be:
> >>
> >> - can-bus and an abstract class can-host, which would inherit directly
> >> from TYPE_OBJECT and implement TYPE_USER_CREATABLE
> >>
> >> - can-host-socketcan, which would inherit from can-host (and take the
> >> TYPE_USER_CREATABLE implementation from there)
> >>
> >> while CanBusClientState and CanBusClientInfo need not be QOMified.
> >
> > May it be, can-host-socketcan can be based directly on TYPE_OBJECT,
> > because only QEMU CAN bus specific part is CanBusClientState which
> > allows it to connect to the CAN bus same way as other CAN controllers
> > connect to the bus.
>
> The abstract class "can-host" is useful to keep can-host-socketcan free
> of things that are not specific to SocketCAN, but it's just a small detail.

  reply	other threads:[~2018-01-28  9:12 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-14 20:14 [Qemu-devel] [PATCH V4 0/7] CAN bus support for QEMU (SJA1000 PCI so far) pisa
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 1/7] CAN bus simple messages transport implementation for QEMU pisa
2018-01-19 12:38   ` Philippe Mathieu-Daudé
2018-01-19 13:28     ` Pavel Pisa
2018-01-19 17:04     ` Pavel Pisa
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 2/7] CAN bus support to connect bust to Linux host SocketCAN interface pisa
2018-01-15  2:55   ` Philippe Mathieu-Daudé
2018-01-15 21:29     ` Pavel Pisa
2018-01-16  0:12       ` Philippe Mathieu-Daudé
2018-01-19  8:51         ` Pavel Pisa
2018-01-19 13:37           ` Philippe Mathieu-Daudé
2018-01-22 10:28             ` Stefan Hajnoczi
2018-01-19 13:37         ` Daniel P. Berrange
2018-01-19 12:57   ` Philippe Mathieu-Daudé
2018-01-19 13:01     ` Philippe Mathieu-Daudé
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 3/7] CAN bus SJA1000 chip register level emulation for QEMU pisa
2018-01-15  3:03   ` Philippe Mathieu-Daudé
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 4/7] CAN bus Kvaser PCI CAN-S (single SJA1000 channel) emulation added pisa
2018-01-15  3:09   ` Philippe Mathieu-Daudé
2018-03-06 15:29   ` Thomas Huth
2018-03-06 20:52     ` Pavel Pisa
2018-03-07 11:40       ` Paolo Bonzini
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 5/7] QEMU CAN bus emulation documentation pisa
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 6/7] CAN bus PCM-3680I PCI (dual SJA1000 channel) emulation added pisa
2018-01-15  3:12   ` Philippe Mathieu-Daudé
2018-01-19 13:15   ` Philippe Mathieu-Daudé
2018-01-14 20:14 ` [Qemu-devel] [PATCH V4 7/7] CAN bus MIOe-3680 " pisa
2018-01-19 13:13   ` Philippe Mathieu-Daudé
2018-01-22 11:35 ` [Qemu-devel] [PATCH V4 0/7] CAN bus support for QEMU (SJA1000 PCI so far) Philippe Mathieu-Daudé
2018-01-23 21:42   ` Pavel Pisa
2018-01-24 20:22     ` Pavel Pisa
2018-01-24 21:41       ` Philippe Mathieu-Daudé
2018-01-25  8:24         ` Pavel Pisa
2018-01-25 13:50           ` Deniz Eren
2018-01-25 13:58     ` Paolo Bonzini
2018-01-25 21:33       ` Pavel Pisa
2018-01-26 11:12         ` Paolo Bonzini
2018-01-28  9:02           ` Pavel Pisa [this message]
2018-01-29  7:43             ` Oleksij Rempel
2018-01-30 14:15         ` Paolo Bonzini
2018-01-30 22:12           ` Pavel Pisa
2018-01-31  0:13             ` Deniz Eren
2018-01-31  1:08               ` Paolo Bonzini
2018-01-31  1:10                 ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2018-01-31  4:07 Deniz Eren

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=201801281002.40862.pisa@cmp.felk.cvut.cz \
    --to=pisa@cmp.felk.cvut.cz \
    --cc=deniz.eren@icloud.com \
    --cc=f4bug@amsat.org \
    --cc=frederic.konrad@adacore.com \
    --cc=jan.kiszka@siemens.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marex@denx.de \
    --cc=o.rempel@pengutronix.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=socketcan@hartkopp.net \
    --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).