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

[libvirt] [PATCH] qemu: fix error messages



Regression in commit caa805ea let a lot of bad messages slip in.

* cfg.mk (msg_gen_function): Fix function name.
* src/qemu/qemu_cgroup.c (qemuRemoveCgroup): Fix fallout from
'make syntax-check'.
* src/qemu/qemu_driver.c (qemudDomainGetInfo)
(qemuDomainWaitForMigrationComplete, qemudStartVMDaemon)
(qemudDomainSaveFlag, qemudDomainAttachDevice)
(qemuDomainUpdateDeviceFlags): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
(qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
Likewise.
---

Pushing this: the cfg.mk change is under the trivial rule, and
the rest under the 'make syntax-check' build-breaker rule.

 cfg.mk                  |    2 +-
 src/qemu/qemu_cgroup.c  |    2 +-
 src/qemu/qemu_driver.c  |   21 +++++++++++----------
 src/qemu/qemu_hotplug.c |    6 +++---
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 066fa3d..db6863d 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -364,8 +364,8 @@ msg_gen_function += networkLog
 msg_gen_function += networkReportError
 msg_gen_function += oneError
 msg_gen_function += openvzError
+msg_gen_function += qemuReportError
 msg_gen_function += qemudDispatchClientFailure
-msg_gen_function += qemudReportError
 msg_gen_function += regerror
 msg_gen_function += remoteDispatchFormatError
 msg_gen_function += umlReportError
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index e5536c0..82d3695 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -331,7 +331,7 @@ int qemuRemoveCgroup(struct qemud_driver *driver,
     if (rc != 0) {
         if (!quiet)
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Unable to find cgroup for %s\n"),
+                            _("Unable to find cgroup for %s"),
                             vm->def->name);
         return rc;
     }
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c7d19f5..3d2ba0d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2887,7 +2887,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
     if (ret == 0) {
         if (virFileReadPid(driver->stateDir, vm->def->name, &vm->pid)) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Domain %s didn't show up\n"), vm->def->name);
+                            _("Domain %s didn't show up"), vm->def->name);
             ret = -1;
         }
 #if 0
@@ -3986,7 +3986,8 @@ static int qemudDomainGetInfo(virDomainPtr dom,
         info->cpuTime = 0;
     } else {
         if (qemudGetProcessInfo(&(info->cpuTime), NULL, vm->pid, 0) < 0) {
-            qemuReportError(VIR_ERR_OPERATION_FAILED, ("cannot read cputime for domain"));
+            qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                            _("cannot read cputime for domain"));
             goto cleanup;
         }
     }
@@ -4097,7 +4098,7 @@ qemuDomainWaitForMigrationComplete(struct qemud_driver *driver, virDomainObjPtr


         if (!virDomainObjIsActive(vm)) {
-            qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s: %s",
+            qemuReportError(VIR_ERR_INTERNAL_ERROR, _("%s: %s"),
                             job, _("guest unexpectedly quit"));
             goto cleanup;
         }
@@ -4133,7 +4134,7 @@ qemuDomainWaitForMigrationComplete(struct qemud_driver *driver, virDomainObjPtr
          * guest to die
          */
         if (!virDomainObjIsActive(vm)) {
-            qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s: %s",
+            qemuReportError(VIR_ERR_INTERNAL_ERROR, _("%s: %s"),
                             job, _("guest unexpectedly quit"));
             goto cleanup;
         }
@@ -4163,7 +4164,7 @@ qemuDomainWaitForMigrationComplete(struct qemud_driver *driver, virDomainObjPtr
         case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE:
             priv->jobInfo.type = VIR_DOMAIN_JOB_NONE;
             qemuReportError(VIR_ERR_OPERATION_FAILED,
-                            "%s: %s", job, _("is not active"));
+                            _("%s: %s"), job, _("is not active"));
             break;

         case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE:
@@ -4184,13 +4185,13 @@ qemuDomainWaitForMigrationComplete(struct qemud_driver *driver, virDomainObjPtr
         case QEMU_MONITOR_MIGRATION_STATUS_ERROR:
             priv->jobInfo.type = VIR_DOMAIN_JOB_FAILED;
             qemuReportError(VIR_ERR_OPERATION_FAILED,
-                            "%s: %s", job, _("unexpectedly failed"));
+                            _("%s: %s"), job, _("unexpectedly failed"));
             break;

         case QEMU_MONITOR_MIGRATION_STATUS_CANCELLED:
             priv->jobInfo.type = VIR_DOMAIN_JOB_CANCELLED;
             qemuReportError(VIR_ERR_OPERATION_FAILED,
-                            "%s: %s", job, _("canceled by client"));
+                            _("%s: %s"), job, _("canceled by client"));
             break;
         }

@@ -4466,7 +4467,7 @@ static int qemudDomainSaveFlag(struct qemud_driver *driver, virDomainPtr dom,
         qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
         if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Unable to find cgroup for %s\n"),
+                            _("Unable to find cgroup for %s"),
                             vm->def->name);
             goto endjob;
         }
@@ -6525,7 +6526,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
         if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
             if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) !=0 ) {
                 qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to find cgroup for %s\n"),
+                                _("Unable to find cgroup for %s"),
                                 vm->def->name);
                 goto endjob;
             }
@@ -6696,7 +6697,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
         if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
             if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) !=0 ) {
                 qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to find cgroup for %s\n"),
+                                _("Unable to find cgroup for %s"),
                                 vm->def->name);
                 goto endjob;
             }
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index ca81a3d..c334f52 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -895,7 +895,7 @@ int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,

         if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) !=0 ) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Unable to find cgroup for %s\n"),
+                            _("Unable to find cgroup for %s"),
                             vm->def->name);
             goto error;
         }
@@ -1150,7 +1150,7 @@ int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
     if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
         if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Unable to find cgroup for %s\n"),
+                            _("Unable to find cgroup for %s"),
                             vm->def->name);
             goto cleanup;
         }
@@ -1247,7 +1247,7 @@ int qemuDomainDetachSCSIDiskDevice(struct qemud_driver *driver,
     if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
         if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Unable to find cgroup for %s\n"),
+                            _("Unable to find cgroup for %s"),
                             vm->def->name);
             goto cleanup;
         }
-- 
1.7.3.5


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