Bug 473071 - libvirt 0.5.0 crashes on new volume XML without a format
libvirt 0.5.0 crashes on new volume XML without a format
Status: CLOSED CURRENTRELEASE
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Veillard
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-26 08:50 EST by Chris Lalancette
Modified: 2010-03-16 13:16 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-12-04 11:33:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Use default volume format to avoid crash (2.72 KB, text/plain)
2008-12-04 09:56 EST, Cole Robinson
no flags Details

  None (edit)
Comment 1 Daniel Veillard 2008-12-04 09:51:17 EST
Following should be sufficient to avoid the crash, but won't add a default
format, just point out the missing information

Daniel

--- src/storage_conf.c  17 Nov 2008 11:19:33 -0000      1.29
+++ src/storage_conf.c  4 Dec 2008 14:12:27 -0000
@@ -961,6 +961,11 @@
     ret->target.path = virXPathString(conn, "string(/volume/target/path)", ctxt);
     if (options->formatFromString) {
         char *format = virXPathString(conn, "string(/volume/target/format/@type)", ctxt);
+        if (format == NULL) {
+            virStorageReportError(conn, VIR_ERR_XML_ERROR,
+                          _("cannot guess missing format type for target"));
+            goto cleanup;
+        }
         if ((ret->target.format = (options->formatFromString)(format)) < 0) {
             virStorageReportError(conn, VIR_ERR_XML_ERROR,
                                   _("unknown volume format type %s"), format);
Comment 2 Cole Robinson 2008-12-04 09:56:19 EST
Created attachment 325691 [details]
Use default volume format to avoid crash

I cut this last night, seemed to fix the crash but I only did light testing. The patch is pretty simple though so I think it's safe.
Comment 3 Cole Robinson 2008-12-04 11:33:08 EST
Alright, fix for this was committed and in 0.5.1, so closing as CURRENTRELEASE.
Comment 4 Fedora Update System 2008-12-05 00:56:33 EST
libvirt-0.5.1-1.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/libvirt-0.5.1-1.fc10
Comment 5 Fedora Update System 2008-12-05 00:57:53 EST
libvirt-0.5.1-1.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/libvirt-0.5.1-1.fc9

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