]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainValidateStorageSource: Relax PR validation
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 3 Jul 2018 11:24:48 +0000 (13:24 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Jul 2018 12:56:22 +0000 (14:56 +0200)
Rather than rejecting the user provided path and alias for the
managed PR reservation we will ignore the provided path. The
reason is that migration XML does contain path even for managed
reservations.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c

index 0821ce769b8e1c7f3ca213e800a677922567b4d0..dd9e27c50624fa91d71bd397f98913bc308a4ad9 100644 (file)
@@ -4616,19 +4616,11 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
         }
     }
 
-    if (src->pr) {
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("reservations not supported with this QEMU binary"));
-            return -1;
-        }
-
-        if (virStoragePRDefIsManaged(src->pr) && src->pr->path) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("'path' attribute should not be provided for "
-                             "managed reservations"));
-            return -1;
-        }
+    if (src->pr &&
+        !virQEMUCapsGet(qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("reservations not supported with this QEMU binary"));
+        return -1;
     }
 
     return 0;
@@ -12855,6 +12847,7 @@ qemuDomainPrepareStorageSourcePR(virStorageSourcePtr src,
         return 0;
 
     if (virStoragePRDefIsManaged(src->pr)) {
+        VIR_FREE(src->pr->path);
         if (!(src->pr->path = qemuDomainGetManagedPRSocketPath(priv)))
             return -1;
         if (VIR_STRDUP(src->pr->mgralias, qemuDomainGetManagedPRAlias()) < 0)