Skip to contentSkip to conversation

vhost-vsock: fix error message output

PATCH In review Nick Erdmann 5 participants 5 messages Mar 1, 2020 – Mar 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost-vsock: fix error message output

error_setg_errno takes a positive error number, so we should not invert errno's sign.

---
 hw/virtio/vhost-vsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/vhost-vsock.c +1 -1
index 66da96583b..9f9093e196 100644
@@ -325,7 +325,7 @@ static void vhost_vsock_device_realize(DeviceState *dev, Error **errp)
     } else {
         vhostfd = open("/dev/vhost-vsock", O_RDWR);
         if (vhostfd < 0) {
-            error_setg_errno(errp, -errno,
+            error_setg_errno(errp, errno,
                              "vhost-vsock: failed to open vhost device");
             return;
         }

--
2.25.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Nick Erdmann

Le 01/03/2020 à 13:03, Nick Erdmann a écrit :

Quoted 21 lines

error_setg_errno takes a positive error number, so we should not invert errno's sign.

---
 hw/virtio/vhost-vsock.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/vhost-vsock.c +1 -1
index 66da96583b..9f9093e196 100644
@@ -325,7 +325,7 @@ static void vhost_vsock_device_realize(DeviceState
 *dev, Error **errp)
      } else {
          vhostfd = open("/dev/vhost-vsock", O_RDWR);
          if (vhostfd < 0) {
-            error_setg_errno(errp, -errno,
+            error_setg_errno(errp, errno,
                               "vhost-vsock: failed to open vhost device");
              return;
Quoted 4 lines

         }

Signature · 1 line
2.25.1
Fixes fc0b9b0e1cbb ("vhost-vsock: add virtio sockets device")
Reviewed-by on v1 1/1
#3 lore raw
In reply to Nick Erdmann
Quoted 13 lines · Nick Erdmann

error_setg_errno takes a positive error number, so we should not invert errno's sign.

---
 hw/virtio/vhost-vsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/vhost-vsock.c +0 -0
index 66da96583b..9f9093e196 100644

hw/virtio/vhost-vsock.c static void vhost_vsock_device_realize(DeviceState *dev, Error **errp) · line 331

Quoted 8 lines
hw/virtio/vhost-vsock.c +1 -1
@@ -325,7 +325,7 @@ static void vhost_vsock_device_realize(DeviceState *dev, Error **errp)
     } else {
         vhostfd = open("/dev/vhost-vsock", O_RDWR);
         if (vhostfd < 0) {
-            error_setg_errno(errp, -errno,
+            error_setg_errno(errp, errno,
                              "vhost-vsock: failed to open vhost device");
             return;
         }

Thanks,
Stefano