diff mbox series

qemu_vhost_user: don't raise error for unknown features

Message ID 90c852217f168edcabebb9fa56c6b5cc7f3d2913.1627070134.git.crobinso@redhat.com
State Accepted
Commit d81ac240145d6759619a7db901f498def7858d62
Headers show
Series qemu_vhost_user: don't raise error for unknown features | expand

Commit Message

Cole Robinson July 23, 2021, 7:55 p.m. UTC
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

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 src/qemu/qemu_vhost_user.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
2.31.1

Comments

Peter Krempa July 26, 2021, 8:50 a.m. UTC | #1
On Fri, Jul 23, 2021 at 15:55:34 -0400, Cole Robinson wrote:
> 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

> 

> Signed-off-by: Cole Robinson <crobinso@redhat.com>

> ---

>  src/qemu/qemu_vhost_user.c | 10 +++++-----

>  1 file changed, 5 insertions(+), 5 deletions(-)


Reviewed-by: Peter Krempa <pkrempa@redhat.com>
diff mbox series

Patch

diff --git a/src/qemu/qemu_vhost_user.c b/src/qemu/qemu_vhost_user.c
index bc8e7ad898..75cc718c09 100644
--- a/src/qemu/qemu_vhost_user.c
+++ b/src/qemu/qemu_vhost_user.c
@@ -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;
 }