qemu-devel
[Top][All Lists]
Advanced

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

Re: Failing property setters + hardwired devices + -global = a bad day


From: Markus Armbruster
Subject: Re: Failing property setters + hardwired devices + -global = a bad day
Date: Thu, 30 Apr 2020 09:09:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Daniel P. Berrangé <address@hidden> writes:

> On Wed, Apr 29, 2020 at 05:28:25PM +0200, Markus Armbruster wrote:
>> Is there any sane use for configuring backends via any of the default
>> mechanisms?
>> 
>> I'm aware of one, but it's outdated: -global isa-fdc.driveA=...  Use
>> -device floppy instead.
>> 
>> I'd love to deprecate -global wholesale, but we can't as long as we
>> don't have better means to configure onboard devices.  Can we deprecate
>> its use with backend properties at least?
>
> Currently libvirt has code using the following

Useful, thanks!

> * Floppy
>
>   -global isa-fdc.driveA=ID
>   -global isa-fdc.driveB=ID
>   -global isa-fdc.bootindexA=NN
>   -global isa-fdc.bootindexB=NN
>
>   Only used when the machine type is pc-q35-2.4 or earlier

This is qemuBuildFloppyCommandLineControllerOptions().  I'm not sure I
follow the logic there.

Two compatibility issues are relevant to floppies:

* Onboard isa-fdc

  We dropped the onboard isa-fdc for certain machine types (commit
  ea96bc629c "i386: drop FDC in pc-q35-2.4+ if neither it nor floppy
  drives are wanted", v2.4.0).  To get one, use -device isa-fdc of
  -drive if=floppy,...

  The upstream machine types are pc-q35-2.4 or later.  Downstreams are
  free to do the same for their machine types.

  qemuDomainMachineNeedsFDC() returns true for x86 machine types other
  than pc-q35-{1.,2.0,2.1,2.2,2.3}*

  Your "when the machine type is pc-q35-2.4 or earlier" appears to be
  off by one.

  When libvirt decides to use -device isa-fdc, it sensibly puts the
  driveA=... and driveB=... bits there rather than in -global isa-fdc...

  Libvirt still uses -global for machine types with an onboard isa-fdc.

* -device floppy

  We support configuring floppy drives with -device (commit a92bd191a4
  "fdc: Move qdev properties to FloppyDrive", v2.8.0).

  This permits

    -device isa-fdc,FDC-OPTS...
    -device floppy unit=0,drive=BACKEND,FLOPPY-OPTS...

  in addition to the old

    -device isa-fdc,driveA=BACKEND,FDC_OPTS...

  or the even older

    -global isa-fdc.driveA=BACKEND,FDC_OPTS...

  which both rely on black magic in device isa-fdc to automatically
  create the floppy device.

  Same for driveB / unit=0, of course.

  I expect us to deprecate isa-fdc's driveA and driveB some day.

  Its replacement lets you avoid -global even for machine types with an
  onboard isa-fdc.

  To detect it, check whether device "floppy" exists.

> * NVRAM
>
>   -global spapr-nvram.reg=0xnnnn

Onboard device of the pseries-* machine type family.

Our means to configure onboard devices are weak.  We sidestepped this
for isa-fdc by taking it off the board, and thus make -device work.

I investigated doing the same for onboard flash memory, but Paolo
convinced me to do something else instead: add machine properties that
alias the onboard devices' properties.  Commit ebc29e1beab explains all
this, if you're curious.

If we do the same here, we can replace -global spapr-nvram.reg=... by
something like -machine nvram-reg=...

> * Video primary display adapter
>
>   -global qxl-vga.ram_size=NN
>   -global qxl-vga.vram_size=NN
>   -global qxl-vga.vram64_size=NN
>   -global qxl-vga.vgamem_mb=NN
>   -global qxl-vga.max_outputs=NN
>   -global VGA.vgamem_mb=MM
>   -global vmware-svga.vgamem_mb=MM
>
>   Only used for old qemu lacking -device support where we must use -vga
>   instead

Solution: wait for libvirt to notice QEMU lacking -device is long dead
and buried.

> * PIT policy
>
>    -global kvm-pit.lost_tick_policy=XXX

Onboard device, same solution as for NVRAM.

Note that the board uses either isa-pit or kvm-pit, depending on
configuration.  Might complicate things a bit.

> * S3/S4
>
>    -global PIIX4_PM.disable_s3=NNN
>    -global PIIX4_PM.disable_s4=NNN
>    -global ICH9-LPC.disable_s3=NNN
>    -global ICH9-LPC.disable_s4=NNN
>
> * PCI hole
>
>    -global i440FX-pcihost.pci-hole64-size=NNN
>    -global q35-pcihost.pci-hole64-size=NNN
>
> * SMM TSeg
>
>    -global mch.extended-tseg-mbytes=NNN
>
> * pflash
>
>    -global driver=cfi.pflash01,property=secure,value=on
>
>   Used for EFI secure boot

Onboard devices, same solution as for NVRAM, I guess.

> I'm unclear which of these can be replaced with a different QEMU cli
> option....

Mostly "not yet", I think.




reply via email to

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