At the point where the error message is emitted, the field def->name is
still set to "new device", so the error message becomes:

  Unable to start mediated device 'new device': ...

Since the name doesn't contain anything useful, just omit it from the
error message altogether.

Signed-off-by: Jonathon Jongsma <jjong...@redhat.com>
---
 src/node_device/node_device_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/node_device/node_device_driver.c 
b/src/node_device/node_device_driver.c
index 8a0a2c3847..0f13cb4849 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -847,8 +847,8 @@ nodeDeviceCreateXMLMdev(virConnectPtr conn,
     if (virMdevctlCreate(def, &uuid, &errmsg) < 0) {
         if (errmsg)
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Unable to start mediated device '%s': %s"),
-                           def->name, errmsg);
+                           _("Unable to start mediated device: %s"),
+                           errmsg);
         return NULL;
     }
 
-- 
2.31.1

Reply via email to