Re: [libvirt] [PATCH 08/23] Replace use of vmwareError with virReportError

2012-07-19 Thread Peter Krempa

On 07/18/12 20:40, Daniel P. Berrange wrote:

From: Daniel P. Berrange berra...@redhat.com

Update the VMWare driver to use virReportError instead of
the vmwareError custom macro

Signed-off-by: Daniel P. Berrange berra...@redhat.com
---
  cfg.mk |1 -
  src/vmware/vmware_conf.c   |   56 +++---
  src/vmware/vmware_conf.h   |4 --
  src/vmware/vmware_driver.c |  110 ++--
  4 files changed, 83 insertions(+), 88 deletions(-)



ACK.

Peter


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


[libvirt] [PATCH 08/23] Replace use of vmwareError with virReportError

2012-07-18 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com

Update the VMWare driver to use virReportError instead of
the vmwareError custom macro

Signed-off-by: Daniel P. Berrange berra...@redhat.com
---
 cfg.mk |1 -
 src/vmware/vmware_conf.c   |   56 +++---
 src/vmware/vmware_conf.h   |4 --
 src/vmware/vmware_driver.c |  110 ++--
 4 files changed, 83 insertions(+), 88 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index fda36cc..ffc9312 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -542,7 +542,6 @@ msg_gen_function += virSecurityReportError
 msg_gen_function += virXenInotifyError
 msg_gen_function += virXenStoreError
 msg_gen_function += virXendError
-msg_gen_function += vmwareError
 msg_gen_function += xenapiSessionErrorHandler
 msg_gen_function += xenUnifiedError
 msg_gen_function += xenXMError
diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index 847d146..e7a9dfa 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -252,14 +252,14 @@ vmwareExtractVersion(struct vmware_driver *driver)
 goto cleanup;
 
 if ((tmp = STRSKIP(outbuf, pattern)) == NULL) {
-vmwareError(VIR_ERR_INTERNAL_ERROR,
-_(failed to parse %s version), bin);
+virReportError(VIR_ERR_INTERNAL_ERROR,
+   _(failed to parse %s version), bin);
 goto cleanup;
 }
 
 if (virParseVersionString(tmp, version, false)  0) {
-vmwareError(VIR_ERR_INTERNAL_ERROR, %s,
-_(version parsing error));
+virReportError(VIR_ERR_INTERNAL_ERROR, %s,
+   _(version parsing error));
 goto cleanup;
 }
 
@@ -303,8 +303,8 @@ vmwareParsePath(char *path, char **directory, char 
**filename)
 *separator++ = '\0';
 
 if (*separator == '\0') {
-vmwareError(VIR_ERR_INTERNAL_ERROR,
-_(path '%s' doesn't reference a file), path);
+virReportError(VIR_ERR_INTERNAL_ERROR,
+   _(path '%s' doesn't reference a file), path);
 return -1;
 }
 
@@ -361,9 +361,9 @@ vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath)
  * isn't perfect but should work in the majority of cases.
  */
 if (vmdef-ndisks  1) {
-vmwareError(VIR_ERR_INTERNAL_ERROR, %s,
-_(Domain XML doesn't contain any disks, 
-  cannot deduce datastore and path for VMX file));
+virReportError(VIR_ERR_INTERNAL_ERROR, %s,
+   _(Domain XML doesn't contain any disks, 
+ cannot deduce datastore and path for VMX file));
 goto cleanup;
 }
 
@@ -376,16 +376,16 @@ vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath)
 }
 
 if (disk == NULL) {
-vmwareError(VIR_ERR_INTERNAL_ERROR, %s,
-_(Domain XML doesn't contain any file-based harddisks, 
-  cannot deduce datastore and path for VMX file));
+virReportError(VIR_ERR_INTERNAL_ERROR, %s,
+   _(Domain XML doesn't contain any file-based harddisks, 

+ cannot deduce datastore and path for VMX file));
 goto cleanup;
 }
 
 if (disk-src == NULL) {
-vmwareError(VIR_ERR_INTERNAL_ERROR, %s,
-_(First file-based harddisk has no source, cannot 
-  deduce datastore and path for VMX file));
+virReportError(VIR_ERR_INTERNAL_ERROR, %s,
+   _(First file-based harddisk has no source, cannot 
+ deduce datastore and path for VMX file));
 goto cleanup;
 }
 
@@ -394,9 +394,9 @@ vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath)
 }
 
 if (!virFileHasSuffix(fileName, .vmdk)) {
-vmwareError(VIR_ERR_INTERNAL_ERROR,
-_(Expecting source '%s' of first file-based harddisk 
-  to be a VMDK image), disk-src);
+virReportError(VIR_ERR_INTERNAL_ERROR,
+   _(Expecting source '%s' of first file-based harddisk 
+ to be a VMDK image), disk-src);
 goto cleanup;
 }
 
@@ -420,8 +420,8 @@ vmwareMoveFile(char *srcFile, char *dstFile)
 { mv, PROGRAM_SENTINAL, PROGRAM_SENTINAL, NULL };
 
 if (!virFileExists(srcFile)) {
-vmwareError(VIR_ERR_INTERNAL_ERROR, _(file %s does not exist),
-srcFile);
+virReportError(VIR_ERR_INTERNAL_ERROR, _(file %s does not exist),
+   srcFile);
 return -1;
 }
 
@@ -431,8 +431,8 @@ vmwareMoveFile(char *srcFile, char *dstFile)
 vmwareSetSentinal(cmdmv, srcFile);
 vmwareSetSentinal(cmdmv, dstFile);
 if (virRun(cmdmv, NULL)  0) {
-vmwareError(VIR_ERR_INTERNAL_ERROR,
-_(failed to move file to %s ), dstFile);
+virReportError(VIR_ERR_INTERNAL_ERROR,
+