[libvirt] [PATCH]: qemu_driver: convert uuid to string in error messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
qemu_driver misses some conversions to a char* before printing the uuid.
Possible fix attached.
Cheers,
 -- Guido
---
 src/qemu_driver.c |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 2539d78..2983b9c 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2167,8 +2167,11 @@ static unsigned long qemudDomainGetMaxMemory(virDomainPtr dom) {
     virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
 
     if (!vm) {
+        char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+        virUUIDFormat(dom->uuid, uuidstr);
         qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching uuid '%s'"), dom->uuid);
+                         _("no domain with matching uuid '%s'"), uuidstr);
         return 0;
     }
 
@@ -2180,8 +2183,11 @@ static int qemudDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax) {
     virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
 
     if (!vm) {
+        char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+        virUUIDFormat(dom->uuid, uuidstr);
         qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching uuid '%s'"), dom->uuid);
+                         _("no domain with matching uuid '%s'"), uuidstr);
         return -1;
     }
 
@@ -2200,8 +2206,11 @@ static int qemudDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
     virDomainObjPtr vm = virDomainFindByUUID(driver->domains, dom->uuid);
 
     if (!vm) {
+        char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+        virUUIDFormat(dom->uuid, uuidstr);
         qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching uuid '%s'"), dom->uuid);
+                         _("no domain with matching uuid '%s'"), uuidstr);
         return -1;
     }
 
@@ -2470,8 +2479,11 @@ static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
     int max;
 
     if (!vm) {
+        char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+        virUUIDFormat(dom->uuid, uuidstr);
         qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching uuid '%s'"), dom->uuid);
+                         _("no domain with matching uuid '%s'"), uuidstr);
         return -1;
     }
 
@@ -2629,8 +2641,11 @@ static int qemudDomainGetMaxVcpus(virDomainPtr dom) {
     int ret;
 
     if (!vm) {
+        char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+        virUUIDFormat(dom->uuid, uuidstr);
         qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
-                         _("no domain with matching uuid '%s'"), dom->uuid);
+                         _("no domain with matching uuid '%s'"), uuidstr);
         return -1;
     }
 
-- 
1.5.6.3

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]