qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/4] Add i.MX FEC Ethernet driver


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 1/4] Add i.MX FEC Ethernet driver
Date: Sun, 5 May 2013 13:41:19 +0100

On 5 May 2013 12:59, Peter Crosthwaite <address@hidden> wrote:
> While your here I have an on topic question, do we want creation
> helpers like this? I notice that we progressively moving towards the
> state where machine models talk to QOM directly without wrapper init
> fns such as this.. Are functions like this compulsory, optional or
> deprecated?

I don't think there's a consensus. Personally I think that the
ideal would be that the helper functions are unnecessary (they
really indicate areas where our QOM instantiation syntax is
unbearably clunky and in an ideal world we'd improve it somehow).

My personal suggestion would be:
 * if you have to have them they should be static inline in a
   header somewhere (if you stick them in the .c file then there
   is no compiler guard against the temptation to have them directly
   access bits of the internals of the device)
 * err on the side of not having them

In this case I think I'd go for "not necessary".

[Aside: I really need to make some time to look more closely at NIC
init for embedded boards. I have a feeling that recent-ish changes
to move away from deprecated '-net' syntax for PC don't really
work for the embedded boards. (The idea for the PC is that you
create your NIC with "-device whatever,id=thingy", which of course
doesn't work for onboard NICs which you don't need to and in fact
can't create with a command line option.) I'm not sure how much
sense board-level manipulation of nd_table[] still makes, since
it's totally tied to old style -net options.]

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]