RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1443434 - when starting a guest with "dir" type disk/floppy,the error info is not accurate
Summary: when starting a guest with "dir" type disk/floppy,the error info is not accurate
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-19 09:16 UTC by lijuan men
Modified: 2018-04-10 10:43 UTC (History)
4 users (show)

Fixed In Version: libvirt-3.7.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 10:42:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0704 0 None None None 2018-04-10 10:43:05 UTC

Description lijuan men 2017-04-19 09:16:43 UTC
Description of problem:

As "http://libvirt.org/formatdomain.html" said:
"disk
  The disk element is the main container for describing disks and supports the following attributes:
     type
        Valid values are "file", "block", ****"dir" ****(since 0.7.5), "network" (since 0.8.7), or "volume" (since 1.0.5) and refer to the underlying source for the disk. Since 0.0.3 "


I think it means libvirt supports "dir" type disk/floppy/cdrom

But I tried to start a guest with "dir" type disk/floppy( using the format in https://bugzilla.redhat.com/show_bug.cgi?id=525074#c5),failed. And the error information is strange:
"internal error: unsupported disk driver type for 'raw'"

So I am not sure,

Does libvirt really support "dir" type disk/floppy/cdrom?

1)If it supports,
  a)when starting the guest, it should not output error information
  b)in libvirt.org,it is best to list more detailed information about it,such as,whether it support "dir" type disk/floppy/cdrom? how to use it(give a example)?

2)If it doesn't support,
a) the error information is not accurate
b) libvirt.org needs to be updated

Version-Release number of selected component (if applicable):
libvirt-3.2.0-2.el7.x86_64
qemu-kvm-rhev-2.8.0-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1.start a guest with the following xml:
<disk type='dir' device='floppy'>
      <source dir='/tmp/test'/>
      <target dev='fda' bus='fdc'/>
      <readonly/>
    </disk>

[root@lmen1 ~]# virsh start test
error: Failed to start domain test
error: internal error: unsupported disk driver type for 'raw'

2.start a guest with the following xml:
 <disk type='dir' device='disk'>
      <driver name='qemu'/>
      <source dir='/tmp/test'/>
      <target dev='sda' bus='scsi'/>
    </disk>


[root@lmen1 ~]# virsh start test
error: Failed to start domain test
error: internal error: unsupported disk driver type for 'raw'


Actual results:
the error information is not accurate

Expected results:


Additional info:

Comment 2 Philipp Hahn 2017-06-29 12:11:13 UTC
Try specifying the type: <driver name='qemu' type='fat'/>:

The error message is from src/qemu/qemu_command.c:
 1534         /* for now the DIR based storage is handled by the magic FAT format */
 1535         if (actualType == VIR_STORAGE_TYPE_DIR) {
 1536             if (disk->src->format > 0 &&
 1537                 disk->src->format != VIR_STORAGE_FILE_FAT) {
 1538                 virReportError(VIR_ERR_INTERNAL_ERROR,
 1539                                _("unsupported disk driver type for '%s'"),                                                                                                                                                            
 1540                                virStorageFileFormatTypeToString(disk->src->format));

You also get the error message when "managedsave" is used: On resuming the VM the directory seems to get mis-detected as "raw" again.
After removing the suspend state with "managedsave-remove $VM" the VM can be started without any problems.

FYI: This experience is from my old Debian system running
virsh # version 
Compiled against library: libvirt 1.2.9
Using library: libvirt 1.2.9
Using API: QEMU 1.2.9
Running hypervisor: QEMU 1.1.2

Comment 3 Martin Kletzander 2017-08-18 15:36:50 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2017-August/msg00536.html

Comment 5 Martin Kletzander 2017-08-29 14:34:02 UTC
Fixed upstream with v3.7.0-rc1-1-g3401e208ab1d..v3.7.0-rc1-2-ged8661a309c9:
commit 3401e208ab1dcea4694e5b18623d9b91d4bc286f
Author: Martin Kletzander <mkletzan>
Date:   Fri Aug 25 14:45:56 2017 +0200

    qemu: Don't mangle the storage format for type='dir'
    
commit ed8661a309c96e4a1573dc0ca2c76ea7ff19469a
Author: Martin Kletzander <mkletzan>
Date:   Fri Aug 18 17:33:08 2017 +0200

    qemu: Also treat directories properly when using namespaces

Comment 7 Jing Qi 2017-10-17 06:43:48 UTC
Verified with libvirt-3.7.0-1.el7 and qemu-kvm-rhev-2.10.0-1.el7.x86_64.


1.start a guest with the following xml:
<disk type='dir' device='floppy'>
      <source dir='/tmp/test'/>
      <target dev='fda' bus='fdc'/>
      <readonly/>
    </disk>

# virsh start avocado-vt-vm1
error: Failed to start domain test
error: internal error: unsupported disk driver type for 'dir'

2.start a guest with the following xml:
 <disk type='dir' device='disk'>
      <driver name='qemu'/>
      <source dir='/tmp/test'/>
      <target dev='sda' bus='scsi'/>
    </disk>


# virsh start avocado-vt-vm1
error: Failed to start domain avocado-vt-vm1
error: internal error: unsupported disk driver type for 'dir'

Comment 8 Jing Qi 2017-10-19 02:39:12 UTC
The error information is clear now as above comment 7 showed.

Comment 12 errata-xmlrpc 2018-04-10 10:42:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0704


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