On 06.01.2017 10:58, Thomas Huth wrote: > When running qemu-system-m68k with the "-net" parameter (for example > simply "-net nic -net user"), there is currently a confusing warning > message saying: > > Warning: requested NIC (anonymous, model mcf_fec) was not created > (not supported by this machine?) > > This seems to happen because the MCF NIC has never been adapted to > the currently expected QEMU device behavior. Thus let's QOMify the > NIC now to get rid of the warning message. > > Signed-off-by: Thomas Huth <h...@tuxfamily.org> > --- > hw/m68k/mcf5208.c | 20 ++++++++++++++ > hw/net/mcf_fec.c | 75 > ++++++++++++++++++++++++++++++++++++++------------- > include/hw/m68k/mcf.h | 4 --- > 3 files changed, 77 insertions(+), 22 deletions(-) > > diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c > index 3438314..f9e1adb 100644 > --- a/hw/m68k/mcf5208.c > +++ b/hw/m68k/mcf5208.c > @@ -18,6 +18,7 @@ > #include "net/net.h" > #include "hw/boards.h" > #include "hw/loader.h" > +#include "hw/sysbus.h" > #include "elf.h" > #include "exec/address-spaces.h" > > @@ -192,6 +193,25 @@ static void mcf5208_sys_init(MemoryRegion > *address_space, qemu_irq *pic) > } > } > > +static void mcf_fec_init(MemoryRegion *sysmem, NICInfo *nd, hwaddr base, > + qemu_irq *irqs) > +{ > + DeviceState *dev; > + SysBusDevice *s; > + int i; > + > + dev = qdev_create(NULL, "mcf-fec");
I just read on http://wiki.qemu.org/Documentation/QOMConventions: "DO use TYPE_FOO constants, defined in a header if used in other parts of code" ... so I guess I should rather declare the TYPE_MCF_FEC_NET in a header file instead. I'll send a v2 of this patch... Thomas