]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_vhost_user: don't raise error for unknown features
authorCole Robinson <crobinso@redhat.com>
Fri, 23 Jul 2021 19:42:16 +0000 (15:42 -0400)
committerCole Robinson <crobinso@redhat.com>
Mon, 26 Jul 2021 14:01:59 +0000 (10:01 -0400)
Similar to what was done for qemu_firmware.c in 61d95a1073, don't
report an error for unknown vhost-user features, just log it and
correctly continue on

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
src/qemu/qemu_vhost_user.c

index bc8e7ad8986679bb92239b176fe7fdcad23bfcda..75cc718c096348c0c4e0ab4e8dc238a1b7f03559 100644 (file)
@@ -280,6 +280,7 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUser *vu,
     qemuVhostUserGPU *gpu = &vu->capabilities.gpu;
     virJSONValue *featuresJSON;
     size_t nfeatures;
+    size_t nparsed = 0;
     size_t i;
     g_autoptr(qemuVhostUserGPUFeature) features = NULL;
 
@@ -299,17 +300,16 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUser *vu,
         int tmp;
 
         if ((tmp = qemuVhostUserGPUFeatureTypeFromString(tmpStr)) <= 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("unknown feature %s"),
-                           tmpStr);
+            VIR_DEBUG("ignoring unknown QEMU vhost-user feature '%s'", tmpStr);
             continue;
         }
 
-        features[i] = tmp;
+        features[nparsed] = tmp;
+        nparsed++;
     }
 
     gpu->features = g_steal_pointer(&features);
-    gpu->nfeatures = nfeatures;
+    gpu->nfeatures = nparsed;
 
     return 0;
 }