]> git.ipfire.org Git - thirdparty/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)
committerCole Robinson <crobinso@redhat.com>
Wed, 23 Dec 2015 23:20:45 +0000 (18:20 -0500)
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'.../>).

(cherry picked from commit 5275c0f4a1267c630b5c3b77fac8cbe4fcaa3adb)

src/storage/storage_driver.c

index 16d0b6c71f3857b5b90df4749eb060f040183c64..8fc269748fbc254eac382e3afc48be1104773065 100644 (file)
@@ -3190,6 +3190,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: