Bug 2001627
| Summary: | Crash if defining a guest XML with a disk missing the <target> element | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Daniel Berrangé <berrange> |
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
| libvirt sub component: | General | QA Contact: | Han Han <hhan> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | unspecified | CC: | jdenemar, jsuchane, lmen, rjones, virt-maint, xuzhang |
| Version: | 9.0 | Keywords: | Regression, Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-7.8.0-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-05-17 12:45:32 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | 7.8.0 |
| Embargoed: | |||
Stack trace is #1 0x00007fc9afe7fdbe in virDiskNameParse (name=0x0, disk=disk@entry=0x7fc99fe89544, partition=partition@entry=0x0) at ../src/util/virutil.c:377 #2 0x00007fc9afe7ff10 in virDiskNameToIndex (name=<optimized out>) at ../src/util/virutil.c:427 #3 0x00007fc9afeb7b89 in virDomainDiskDefAssignAddress (xmlopt=xmlopt@entry=0x7fc948083010, def=def@entry=0x7fc980019830, vmdef=vmdef@entry=0x7fc980016c40) at ../src/conf/domain_conf.c:7660 #4 0x00007fc9afed5f9a in virDomainDiskDefPostParse (xmlopt=0x7fc948083010, def=0x7fc980016c40, disk=0x7fc980019830) at ../src/conf/domain_conf.c:5416 #5 virDomainDeviceDefPostParseCommon (parseFlags=<optimized out>, xmlopt=0x7fc948083010, def=0x7fc980016c40, dev=0x7fc99fe89640) at ../src/conf/domain_conf.c:5536 #6 virDomainDeviceDefPostParse (dev=0x7fc99fe89640, def=0x7fc980016c40, flags=<optimized out>, xmlopt=0x7fc948083010, parseOpaque=<optimized out>) at ../src/conf/domain_conf.c:5795 #7 0x00007fc9afeb05e9 in virDomainDeviceInfoIterateFlags (def=def@entry=0x7fc980016c40, cb=cb@entry=0x7fc9afed64d0 <virDomainDefPostParseDeviceIterator>, iteratorFlags=iteratorFlags@entry=3, opaque=opaque@entry=0x7fc99fe896d0) at ../src/conf/domain_conf.c:4373 #8 0x00007fc9afedc838 in virDomainDefPostParse (def=0x7fc980016c40, parseFlags=130, xmlopt=0x7fc948083010, parseOpaque=<optimized out>) at ../src/conf/domain_conf.c:6156 #9 0x00007fc9afedd74d in virDomainDefParseNode (xml=<optimized out>, root=<optimized out>, xmlopt=0x7fc948083010, parseOpaque=0x0, flags=130) at ../src/conf/domain_conf.c:20442 #10 0x00007fc9afedd876 in virDomainDefParse (xmlStr=<optimized out>, filename=<optimized out>, xmlopt=0x7fc948083010, parseOpaque=0x0, flags=130) at ../src/conf/domain_conf.c:20397 #11 0x00007fc99c576958 in qemuDomainDefineXMLFlags (conn=0x7fc948015170, xml=0x7fc980003300 "<domain type='kvm'>\n <name>demo</name>\n <uuid>87f959c1-c999-4f58-a694-9351676ba49d</uuid>\n <memory unit='KiB'>2048000</memory>\n <currentMemory unit='KiB'>2048000</currentMemory>\n <vcpu placement="..., flags=0) at ../src/qemu/qemu_driver.c:6683 #12 0x00007fc9b0054961 in virDomainDefineXML (conn=0x7fc948015170, xml=0x7fc980003300 "<domain type='kvm'>\n <name>demo</name>\n <uuid>87f959c1-c999-4f58-a694-9351676ba49d</uuid>\n <memory unit='KiB'>2048000</memory>\n <currentMemory unit='KiB'>2048000</currentMemory>\n <vcpu placement="...) at ../src/libvirt-domain.c:6314 5a3c35dc83 qemuxml2argvtest: Add test case for missing disk '<target>' 0404d4fc38 virDomainDiskDefValidate: Move validation of disk target cf6b34c683 conf: Don't call 'virDomainDiskDefAssignAddress' when disk->dst is NULL 002de683c6 conf: validate: Run global device definition validation before callbacks 7dee442677 conf: validate: Move qemu-specific LUN disk validation to global validation 5ccb39616f qemuDomainDefValidateDiskLunSource: Unbreak error messages v7.7.0-55-g5a3c35dc83 Works on libvirt v7.8.0-rc2 ➜ ~ virsh define /tmp/xml error: Failed to define domain from /tmp/xml error: missing target information for device /dev/sda Works on libvirt-7.8.0-1.el9.x86_64: # virsh define rhel.xml error: Failed to define domain from rhel.xml error: missing target information for device /var/lib/libvirt/images/tzimages/RHEL-9.0.0-20210820.3-x86_64.qcow2 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 (new packages: libvirt), 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/RHBA-2022:2390 |
Description of problem: Define a new guest XML containing a <disk> that lacks a <target> element e.g. # cat demo.xml ... <disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/dev/loop0'/> </disk> ... # virsh define demo.xml error: Disconnected from qemu:///system due to end of file error: Failed to define domain from demo.xml error: End of file while reading data: Input/output error Previously this would result in # virsh define demo.xml error: Failed to define domain from demo.xml error: missing target information for device /dev/loop0 This regression was introduced in 7.3.0 upstream libvirt with commit 61fd7174c2afbe128ef1896198919429bcaca3d7 Author: Peter Krempa <pkrempa> Date: Thu Apr 15 17:27:01 2021 +0200 conf: domain: Move checks from virDomainDiskDefParseXML to virDomainDiskDefValidate Move the rest of the validations to the vaidation code. Signed-off-by: Peter Krempa <pkrempa> Reviewed-by: Michal Privoznik <mprivozn> Version-Release number of selected component (if applicable): libvirt-7.6.0-2.el9 How reproducible: Always