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 795093 - [libvirt] missing 'source file' attribute when passing 'optional' param in xml
Summary: [libvirt] missing 'source file' attribute when passing 'optional' param in xml
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 796637 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-19 10:22 UTC by Haim
Modified: 2014-01-13 00:51 UTC (History)
17 users (show)

Fixed In Version: libvirt-0.9.10-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 06:48:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
libvirt logs (643.04 KB, text/plain)
2012-02-19 12:02 UTC, Haim
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description Haim 2012-02-19 10:22:44 UTC
Description of problem:

missing 'source dev' attribute when passing 'optional' param in XML with regardless wither source-dev exists or not. 

xml:

<disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <serial></serial>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>

log (vdsm):

Thread-221::ERROR::2012-02-19 09:59:17,807::utils::399::vm.Vm::(collect) vmId=`2aed27de-bc3f-40cb-85b3-1839f8e38279`::Stats function failed: <AdvancedStatsFunction _sampleDiskLatency at 0x207a7a0>
Traceback (most recent call last):
  File "/usr/share/vdsm/utils.py", line 395, in collect
    statsFunction()
  File "/usr/share/vdsm/utils.py", line 272, in __call__
    retValue = self._function(*args, **kwargs)
  File "/usr/share/vdsm/libvirtvm.py", line 158, in _sampleDiskLatency
    diskLatency[vmDrive.name] = stats[vmDrive.alias]
AttributeError: 'Drive' object has no attribute 'alias'

Comment 1 Haim 2012-02-19 12:02:26 UTC
Created attachment 564175 [details]
libvirt logs

attached libvirt log contains starting of new vm with cd attached

Comment 3 Dan Kenigsberg 2012-02-22 08:50:14 UTC
domain was started with

<disk device="cdrom" snapshot="no" type="file">
	<source file="/rhev/data-center/2319b7ff-09f6-488c-83c4-aa78139db3b4/019d4b6f-5450-4eb6-80ee-c63ea062de49/images/11111111-1111-1111-1111-111111111111/en_windows_7_enterprise_x64_dvd_x15-70749.iso" startupPolicy="optional"/>
	<target bus="ide" dev="hdc"/>
	<serial></serial>
</disk>

the source file is accessible on the nfs mount. However, libvirt claims

2012-02-19 11:54:41.779+0000: 22269: debug : qemuDomainCheckDiskPresence:1634 : Dropping disk 'hdc' on domain 'xtream-vm-001' (UUID 'f9ea04b0-1a1e-4793-870f-b3b1f8b6c6e4') due to inaccessible source '/rhev/data-center/2319b7ff-09f6-488c-83c4-aa78139db3b4/019d4b6f-5450-4eb6-80ee-c63ea062de49/images/11111111-1111-1111-1111-111111111111/en_windows_7_enterprise_x64_dvd_x15-70749.iso'

and drops the "file" attribute from the <source> element.

If startupPolicy="optional" is dropped, the domain starts up fine.

libvirt-0.9.9-1.fc16.x86_64

Comment 4 Dan Kenigsberg 2012-02-22 08:58:08 UTC
note also that libvirt's behaviour is inconsistent with the case of starting with an empty cdrom. There, the <source> element is completely dropped from XMLDesc().

Comment 10 Jiri Denemark 2012-02-23 11:26:55 UTC
*** Bug 796637 has been marked as a duplicate of this bug. ***

Comment 13 weizhang 2012-02-29 06:59:46 UTC
Verify pass on
libvirt-0.9.10-3.el6.x86_64
qemu-kvm-0.12.1.2-2.232.el6.x86_64
kernel-2.6.32-225.el6.x86_64

When cdrom image exists, start guest and dump running domain xml
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/cdrom.img' startupPolicy='optional'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>

when cdrom image does not exist, start guest and dump running domain xml
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source startupPolicy='optional'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>

Comment 15 errata-xmlrpc 2012-06-20 06:48: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.

http://rhn.redhat.com/errata/RHSA-2012-0748.html


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