qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 11/13] vt82c686: Support machine-default audiodev with fallba


From: Paolo Bonzini
Subject: Re: [PATCH 11/13] vt82c686: Support machine-default audiodev with fallback
Date: Sun, 24 Sep 2023 18:06:22 +0200

On Sun, Sep 24, 2023 at 2:14 PM BALATON Zoltan <balaton@eik.bme.hu> wrote:
> > If you still want a machine audiodev propery then could the device handle
> >> it without needing changes to the machine? Like in via_isa_realize() add
> >>
> >> if (current_machine->audiodev) {
> >>      qdev_prop_set_string(DEVICE(pci_dev), "audiodev", machine->audiodev);
> >> }
> >>
> >> before qdev_realize(DEVICE(&s->ac97) then no need to change the device
> >> creation in board code.
> >>
> >
> > No, current_machine should not be used at all outside board code.
>
> OK, can you start from pci_bus and walk up the QOM tree then to find the
> machine in vt92686.c so the board code does not have to care about this?

The machine itself should not be used outside board code, neither via
current_machine nor by any other means.  There are so few places where
it happens (most of them in fw_cfg) that I'm not really willing to
compromise on this. The board sets properties on the devices, it's not
the devices that fetch settings from outside.

Paolo




reply via email to

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