Bug 1651457 - Fail to start an VM with empty CDROMs
Summary: Fail to start an VM with empty CDROMs
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1651458
TreeView+ depends on / blocked
 
Reported: 2018-11-20 07:01 UTC by Han Han
Modified: 2019-03-20 23:12 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1651458 (view as bug list)
Environment:
Last Closed: 2019-03-20 23:12:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Han Han 2018-11-20 07:01:47 UTC
Description of problem:
As subject

Version-Release number of selected component (if applicable):
qemu-3.0.0 or after

How reproducible:
100%

Steps to Reproduce:
1. Start an VM as following
# qemu-kvm -drive if=none,id=drive-ide0-0-0,readonly=on,cache=none -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,write-cache=on
qemu-kvm: -drive if=none,id=drive-ide0-0-0,readonly=on,cache=none: Must specify either driver or file


Actual results:
As above

Expected results:
# qemu-kvm -drive if=none,id=drive-ide0-0-0,readonly=on,cache=none -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,write-cache=on
VNC server running on ::1:5900

Additional info:
This will block libvirt tests: vm start in with empty cdrom. Please fix it asap.

It works on qemu-2.12.

It can be reproduced on scsi and sata bus, too.
# qemu-kvm -drive if=none,id=drive-scsi0-0-0-0,readonly=on,cache=none -device scsi-cd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,write-cache=on
Unable to init server: Could not connect: Connection refused
qemu-system-x86_64: -drive if=none,id=drive-scsi0-0-0-0,readonly=on,cache=none: Must specify either driver or file

# qemu-kvm -drive if=none,id=drive-sata0-0-0,media=cdrom,readonly=on,cache=none -device ide-cd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0,write-cache=on
Unable to init server: Could not connect: Connection refused
qemu-system-x86_64: -drive if=none,id=drive-sata0-0-0,media=cdrom,readonly=on,cache=none: Must specify either driver or file

Comment 1 Cole Robinson 2018-12-12 17:30:59 UTC
I can reproduce with qemu 3.0 and libvirt 4.7 in f29 as well.
There's a closed RHEL qemu-kvm bug, not sure what the fix was: https://bugzilla.redhat.com/show_bug.cgi?id=1342999
But there's still an open libvirt bug for it: https://bugzilla.redhat.com/show_bug.cgi?id=1377321

I think the current state is that libvirt shouldn't be passing those options in the empty cdrom case. pkrempa is that correct?

Comment 2 Peter Krempa 2019-01-21 16:13:36 UTC
Fixed upstream:

commit f80eae8c2ae0c62ecaa550ab6353cf871bb17d4e (HEAD -> master, origin/master, origin/HEAD)
Author: Peter Krempa <pkrempa>
Date:   Tue Jan 15 17:28:21 2019 +0100

    qemu: command: Don't format image properties for empty -drive
    
    If a -drive has no image, using image properties makes qemu whine that
    they should not be used.
    
    This patch stops formating cache/readonly/... for empty drives
    for the pre-blockdev syntax. Unfortunately those parameters can't be
    added later when inserting media, but on the other hand qemu will start
    with an empty drive.
    
    Since we already were able to start a VM with such config previously due
    to qemu ignoring them I've opted just to skip formatting them.
    Additionally with -blockdev support it will work as expected as the
    image properties will be formatted when adding the image itself which is
    not possible without it.

Comment 3 Cole Robinson 2019-03-20 23:12:25 UTC
This is in rawhide libvirt nowadays


Note You need to log in before you can comment on or make changes to this bug.