<driver cache='none'/> disappears after adding

Bug #531741 reported by Ben Jencks
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Low
Soren Hansen

Bug Description

Steps to reproduce:
1. Start with powered off VM.
2. Use 'virsh edit domain' to add the line <driver cache='none'/> to each <disk> clause.
3. Run 'virsh dumpxml domain' and note that the cache lines you just added have disappeared.
4. Start the domain and look at the kvm command line. It includes the cache=none option on the appropriate -disk options.
5. Stop the domain.
6. Use 'virsh edit domain' to make an unrelated change (e.g. memory size).
7. Because the <driver cache='none'/> lines were no longer there, the cache options are removed next time the domain is booted.

Expected behavior:
The <driver cache='none'/> line stays in the file just like every other valid option.

I'm really confused as to where libvirt is storing the fact that I disabled the cache, since it does take effect despite disappearing from the XML file.

Ubuntu Karmic, libvirt 0.7.0-1ubuntu13.

Related branches

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 531741] [NEW] <driver cache='none'/> disappears after adding

On Thu, Mar 04, 2010 at 05:59:24AM -0000, Benjamin Jencks wrote:
> I'm really confused as to where libvirt is storing the fact that I
> disabled the cache, since it does take effect despite disappearing
> from the XML file.

When you hand an XML file to libvirt (e.g. with "virsh define"), it
parses it, stores the information in a (set of) C struct(s), and throws
the XML away. When you read it back, libvirt takes the information from
the (set of) C struct(s) and creates an XML file from this information.

Based on what you're saying, it sounds like libvirt correctly parses the
cache tag and acts on it, but the routine to generate the XML inside
libvirt is missing the few lines of code to serialise this information
in the XML file.

--
Soren Hansen
Ubuntu Developer
http://www.ubuntu.com/

Revision history for this message
Torsten Spindler (tspindler) wrote :

The bug also exists in Lucid, libvirt 0.7.5-5ubuntu9.

Changed in libvirt (Ubuntu):
status: New → Confirmed
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Marking confirmed, per Torsten's feedback, though I will yield to Soren's judgment if he feels otherwise.

Revision history for this message
Soren Hansen (soren) wrote :

I concur. I've found the bug. I'll whip up a patch shortly.

Changed in libvirt (Ubuntu):
assignee: nobody → Soren Hansen (soren)
importance: Undecided → Low
milestone: none → ubuntu-10.04-beta-1
Revision history for this message
Soren Hansen (soren) wrote :

Sorry about the delay. I was waiting for the lp bzr import of libvirt to finish, but it ended up failing. I'll make do without it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libvirt - 0.7.5-5ubuntu11

---------------
libvirt (0.7.5-5ubuntu11) lucid; urgency=low

  * Make sure cache setting is output by virDomainGetXMLDesc (and, by
    extension, "virsh dumpxml"), even if no special driverName is set.
    (LP: #531741)
 -- Soren Hansen <email address hidden> Thu, 04 Mar 2010 22:19:52 +0100

Changed in libvirt (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Soren Hansen (soren) wrote :
Revision history for this message
Soren Hansen (soren) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.