On Mon, May 26, 2025 at 15:08:09 +0200, Michal Prívozník wrote:
> On 5/26/25 09:57, Peter Krempa via Devel wrote:
> > From: Peter Krempa <pkre...@redhat.com>
> > 
> > Introduce a common capability for support of floppy devices by qemu.
> > 
> > Floppy support can be compiled out ('FDC', 'FDC_ISA', 'FDC_SYSBUS' qemu
> > Kconfig options) and also isn't supported by all architectures. Add a
> > capability that will check for 'isa-fdc' and 'sysbus-fdc' devices and
> > signal that given qemu supports the floppy bus.
> > 
> > Signed-off-by: Peter Krempa <pkre...@redhat.com>
> > ---
> >  src/qemu/qemu_capabilities.c                             | 3 +++
> >  src/qemu/qemu_capabilities.h                             | 1 +
> >  tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml | 1 +
> >  tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml        | 1 +
> >  tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml          | 1 +
> >  tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml          | 1 +
> >  tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml          | 1 +
> >  tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml            | 1 +
> >  tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml     | 1 +
> >  tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml          | 1 +
> >  tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml         | 1 +
> >  tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml  | 1 +
> >  tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml         | 1 +
> >  22 files changed, 24 insertions(+)
> > 
> > diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> > index 19716497d8..39cf23ebe7 100644
> > --- a/src/qemu/qemu_capabilities.c
> > +++ b/src/qemu/qemu_capabilities.c
> > @@ -733,6 +733,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
> >                /* 475 */
> >                "virtio-scsi.iothread-mapping", /* 
> > QEMU_CAPS_VIRTIO_SCSI_IOTHREAD_MAPPING */
> >                "machine.virt.highmem-mmio-size", /* 
> > QEMU_CAPS_MACHINE_VIRT_HIGHMEM_MMIO_SIZE */
> > +              "bus-floppy", /* QEMU_CAPS_BUS_FLOPPY */
> >      );
> > 
> > 
> > @@ -1386,6 +1387,8 @@ struct virQEMUCapsStringFlags 
> > virQEMUCapsObjectTypes[] = {
> >      { "pvscsi", QEMU_CAPS_SCSI_PVSCSI },
> >      { "spapr-tpm-proxy", QEMU_CAPS_DEVICE_SPAPR_TPM_PROXY },
> >      { "vmport", QEMU_CAPS_MACHINE_VMPORT_OPT },
> > +    { "isa-fdc", QEMU_CAPS_BUS_FLOPPY },
> > +    { "sysbus-fdc", QEMU_CAPS_BUS_FLOPPY },
> >      /*
> >       * We don't probe 'esp' directly, because it is often reported
> >       * as present for all QEMU binaries, due to it being enabled
> > diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
> > index df33212a34..814ad222ae 100644
> > --- a/src/qemu/qemu_capabilities.h
> > +++ b/src/qemu/qemu_capabilities.h
> > @@ -714,6 +714,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for 
> > syntax-check */
> >      /* 475 */
> >      QEMU_CAPS_VIRTIO_SCSI_IOTHREAD_MAPPING, /* virtio-scsi supports 
> > per-virtqueue iothread mapping */
> >      QEMU_CAPS_MACHINE_VIRT_HIGHMEM_MMIO_SIZE, /* -machine 
> > virt,highmem-mmio-size=<size> */
> > +    QEMU_CAPS_BUS_FLOPPY, /* floppy bus supported (isa-fdc/sysbus-fdc) */
> > 
> >      QEMU_CAPS_LAST /* this must always be the last item */
> >  } virQEMUCapsFlags;
> > diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml 
> > b/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
> > index 1afe4ff7f3..967b5e0cbc 100644
> > --- a/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
> > +++ b/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
> > @@ -168,6 +168,7 @@
> >    <flag name='blockdev-set-active'/>
> >    <flag name='shim'/>
> >    <flag name='virtio-scsi.iothread-mapping'/>
> > +  <flag name='bus-floppy'/>
> 
> Does this mean qemu-system-ppc64 does support floppy? Or is the support
> specific to pseries-* machine types?

IIUC non-pseries machines do support floppy.

> Or this is case of our handcrafted caps file again?

This is actually real caps. E.g. on fedora I get:

$ qemu-system-ppc64 -device ? | grep fdc
name "isa-fdc", bus ISA, desc "virtual floppy controller"

(I do agree that having a *ISA* fdc on a ppc64 machine is questionable
but it is what qemu actually reports.)

Reply via email to