1

I expected QEmu’s -nodefaults to prevent the creation of default devices, but either I don’t use it correctly or it does not work as I expected.

I get this message, using the stripped down command line below, with QEmu 3.0.

The message:

    qemu-system-i386: warning: multiple floppy disk controllers 
    with iobase=0x3f0 have been found
    the one being picked for CMOS setup might not reflect your intent

Additional message in the VM’s terminal:

    could not read the boot disk

The command line:

    qemu-system-i386 \
       -machine type=isapc,usb=no \
       -nodefaults \
       -device isa-vga \
       -blockdev driver=file,node-name=fda-img,filename=fda.img \
       -blockdev driver=raw,node-name=fda,file=fda-img \
       -device isa-fdc,driveA=fda,fdtypeA=144,fdtypeB=none,bootindexA=0

I tried removing -machine type=isapc, but it changed nothing.

This is so, although the documentation says this:

-nodefaults

Don’t create default devices. Normally, QEMU sets the default devices like serial port, parallel port, virtual console, monitor device, VGA adapter, floppy and CD-ROM drive and others. The -nodefaults option will disable all those default devices.

I tried to add a --verbose option to the command line, with the hope it will request a dump of the full configuration QEmu creates, but such an option unfortunately does not exist.

My naive feeling is that it’s broken, but I must also consider I may be missing something … (hence this naive question).

— Update for more details —

Although there is no way to dump the created machine from the commande line, I found there is a info qtree in the monitor, which dumps the devices tree. Below, what it says:

    […]
    dev: isa-fdc, id ""
      iobase = 1008 (0x3f0)
      irq = 6 (0x6)
      dma = 2 (0x2)
      driveA = ""
      driveB = ""
      check_media_rate = true
      fdtypeA = "144"
      fdtypeB = "none"
      fallback = "288"
      isa irq 6
      bus: floppy-bus.1
        type floppy-bus
        dev: floppy, id ""
          unit = 0 (0x0)
          drive = "fda"
          logical_block_size = 512 (0x200)
          physical_block_size = 512 (0x200)
          min_io_size = 0 (0x0)
          opt_io_size = 0 (0x0)
          discard_granularity = 4294967295 (0xffffffff)
          write-cache = "auto"
          share-rw = false
          drive-type = "144"
    […]
    dev: isa-fdc, id ""
      iobase = 1008 (0x3f0)
      irq = 6 (0x6)
      dma = 2 (0x2)
      driveA = ""
      driveB = ""
      check_media_rate = true
      fdtypeA = "auto"
      fdtypeB = "auto"
      fallback = "288"
      isa irq 6
      bus: floppy-bus.0
        type floppy-bus
    […]

It creates two floppy controllers, ignoring -nodefaults. Am I still missing something?

Also, surprisingly, for the first controller, which is the one I create, driveA and driveB are empty strings while driveA is assigned in the command line.

1
  • 100% true. The qemu is under heavy development, but documentation skew grows. Using qemu over 10 years, I see lot of features deprecated by the time. Some GUI/virsh forks the comunity, too. One of the main goal is to keep alive OS with valuable software, which is installed on the bare metal dying down. The VM could save lot of such OSes. But it is hard to find some clear guideline how to do easy migration e.g. from Windows XP or MacOSX6 to VM. The guide How to install new Windows XP SP3 is good to know, but not fully useful. Maybe it is time we should start our own qemu group for lama.
    – schweik
    Apr 12 at 13:24

1 Answer 1

0

I finally believe the documentation is unclear and that’s rather -machine none which does not create any device. However, doing so, there is no way to add a bus which would be required to attach any device. I guess in this particular case, the isapc cannot be created without some device and it must be used as‑is, as a starting point. Then, the backends are to be attached without creating the frontends (if the wording is correct).

Here is an example command line snippet:

[…]
-blockdev driver=file,node-name=fda-img,filename=dos-6-22/Dos622-1.img \
-blockdev driver=raw,node-name=fda,file=fda-img \
-global isa-fdc.driveA=fda \
[…]

Note the -global isa-fdc.driveA=fda, which the important part in this snippet ; this is how the backend is attached to the forcefully created frontend.

Update:

Devices created by -machine <model> seems to be a special case not taken into account by -nodefaults ; this is what the actual documentation forget to mention.

Update 2:

Submitted as a documentation bug, here: https://bugs.launchpad.net/qemu/+bug/1799768

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.