]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
storage: Fix incorrect format for <disk> <auth> XML
authorJohn Ferlan <jferlan@redhat.com>
Wed, 23 Sep 2015 20:28:30 +0000 (16:28 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 12 Oct 2015 13:46:59 +0000 (09:46 -0400)
https://bugzilla.redhat.com/show_bug.cgi?id=1256999

After creating a copy of the 'authdef' in a pool -> disk translation,
unconditionally clear the 'authType' in the resulting disk auth def
structure since that's used for a storage pool and not a disk.  This
ensures virStorageAuthDefFormat will properly format the <auth> XML
for a <disk> (e.g. it won't have a <auth type='%s'.../>).

src/storage/storage_driver.c

index ddf4405d596c409127d3d98050dc64163a1bfbdf..0a7ebcc1c07ebd202bdfd8ed50a586b6fd713803 100644 (file)
@@ -3199,6 +3199,8 @@ virStorageTranslateDiskSourcePoolAuth(virDomainDiskDefPtr def,
     def->src->auth = virStorageAuthDefCopy(source->auth);
     if (!def->src->auth)
         goto cleanup;
+    /* A <disk> doesn't use <auth type='%s', so clear that out for the disk */
+    def->src->auth->authType = VIR_STORAGE_AUTH_TYPE_NONE;
     ret = 0;
 
  cleanup: