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

Re: [libvirt] [PATCH 2/2] Adding Storage Management driver (style and indentation)



On 06/23/2010 04:49 PM, Eduardo Otubo wrote:
> This is just the indentation, style  and cleanup patch.
> 
> ---
>  src/phyp/phyp_driver.c |  100 +++++++++++++++++++++++++++--------------------
>  src/phyp/phyp_driver.h |   13 ++++--
>  2 files changed, 66 insertions(+), 47 deletions(-)

I'm actually going to focus on this one first.  Any style changes to new
code should have been folded in with the new code.  In particular, this
patch touches a lot of VIR_ERROR() calls added in your other patch, but
if the other patch is committed first, then you have created a situation
where 'git bisect' would needlessly fail 'make syntax-check' when
visiting that commit.  Therefore, I'm pruning out the changes to new
code and squashing them into the 1/2 patch, which leaves:

> 
> diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
> index 51bab2c..7e39dfd 100644
> --- a/src/phyp/phyp_driver.c
> +++ b/src/phyp/phyp_driver.c
> @@ -656,7 +656,8 @@ phypGetLparMem(virConnectPtr conn, const char *managed_system, int lpar_id,
>      virBufferAddLit(&buf, "lshwres");
>      if (system_type == HMC)
>          virBufferVSprintf(&buf, " -m %s", managed_system);
> -    virBufferVSprintf(&buf, " -r mem --level lpar -F %s --filter lpar_ids=%d",
> +    virBufferVSprintf(&buf,
> +                      " -r mem --level lpar -F %s --filter lpar_ids=%d",
>                        type ? "curr_mem" : "curr_max_mem", lpar_id);
>      if (virBufferError(&buf)) {
>          virBufferFreeAndReset(&buf);

A few lines like this of indentation wrapping...

> @@ -3798,7 +3812,7 @@ phypUUIDTable_Push(virConnectPtr conn)
>                  /* end of file */
>                  break;
>              } else {
> -                VIR_ERROR(_("Failed to read from '%s'"), local_file);
> +                VIR_ERROR(_("Failed to read from %s"), local_file);
>                  goto err;
>              }
>          }

And this change in the use of quotes of this message.

> diff --git a/src/phyp/phyp_driver.h b/src/phyp/phyp_driver.h
> index e738927..14103f2 100644
> --- a/src/phyp/phyp_driver.h
> +++ b/src/phyp/phyp_driver.h

All of the changes to phyp_driver.h were in code introduced in 1/2, so
I'm just squashing those.

ACK to these minor cleanups that were not tied to 1/2, so I pushed them
as attached:

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org
From edfedfb4146cde41c1f1b803204210064c83a975 Mon Sep 17 00:00:00 2001
From: Eduardo Otubo <otubo linux vnet ibm com>
Date: Wed, 23 Jun 2010 19:49:19 -0300
Subject: [PATCH] Adding Storage Management driver (style and indentation)

This is just the indentation, style  and cleanup patch.
---
 src/phyp/phyp_driver.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index cefb8be..dfa31c7 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -655,7 +655,8 @@ phypGetLparMem(virConnectPtr conn, const char *managed_system, int lpar_id,
     virBufferAddLit(&buf, "lshwres");
     if (system_type == HMC)
         virBufferVSprintf(&buf, " -m %s", managed_system);
-    virBufferVSprintf(&buf, " -r mem --level lpar -F %s --filter lpar_ids=%d",
+    virBufferVSprintf(&buf,
+                      " -r mem --level lpar -F %s --filter lpar_ids=%d",
                       type ? "curr_mem" : "curr_max_mem", lpar_id);
     if (virBufferError(&buf)) {
         virBufferFreeAndReset(&buf);
@@ -721,7 +722,8 @@ phypGetLparCPUGeneric(virConnectPtr conn, const char *managed_system,
     virBufferAddLit(&buf, "lshwres");
     if (system_type == HMC)
         virBufferVSprintf(&buf, " -m %s", managed_system);
-    virBufferVSprintf(&buf, " -r proc --level lpar -F %s --filter lpar_ids=%d",
+    virBufferVSprintf(&buf,
+                      " -r proc --level lpar -F %s --filter lpar_ids=%d",
                       type ? "curr_max_procs" : "curr_procs", lpar_id);
     if (virBufferError(&buf)) {
         virBufferFreeAndReset(&buf);
@@ -772,8 +774,7 @@ phypGetRemoteSlot(virConnectPtr conn, const char *managed_system,
     if (system_type == HMC)
         virBufferVSprintf(&buf, " -m %s", managed_system);
     virBufferVSprintf(&buf, " -r virtualio --rsubtype scsi -F "
-                      "remote_slot_num --filter lpar_names=%s",
-                      lpar_name);
+                      "remote_slot_num --filter lpar_names=%s", lpar_name);
     if (virBufferError(&buf)) {
         virBufferFreeAndReset(&buf);
         virReportOOMError();
@@ -1066,7 +1067,8 @@ phypNumDomainsGeneric(virConnectPtr conn, unsigned int type)
     virBufferAddLit(&buf, "lssyscfg -r lpar");
     if (system_type == HMC)
         virBufferVSprintf(&buf, " -m %s", managed_system);
-    virBufferVSprintf(&buf, " -F lpar_id,state %s |grep -c '^[0-9]*'", state);
+    virBufferVSprintf(&buf, " -F lpar_id,state %s |grep -c '^[0-9]*'",
+                      state);
     if (virBufferError(&buf)) {
         virBufferFreeAndReset(&buf);
         virReportOOMError();
@@ -1140,7 +1142,8 @@ phypListDomainsGeneric(virConnectPtr conn, int *ids, int nids,
     virBufferAddLit(&buf, "lssyscfg -r lpar");
     if (system_type == HMC)
         virBufferVSprintf(&buf, " -m %s", managed_system);
-    virBufferVSprintf(&buf, " -F lpar_id,state %s | sed -e 's/,.*$//'", state);
+    virBufferVSprintf(&buf, " -F lpar_id,state %s | sed -e 's/,.*$//'",
+                      state);
     if (virBufferError(&buf)) {
         virBufferFreeAndReset(&buf);
         virReportOOMError();
@@ -2125,7 +2128,7 @@ phypUUIDTable_Push(virConnectPtr conn)
                 /* end of file */
                 break;
             } else {
-                VIR_ERROR(_("Failed to read from '%s'"), local_file);
+                VIR_ERROR(_("Failed to read from %s"), local_file);
                 goto err;
             }
         }
-- 
1.7.0.1

Attachment: signature.asc
Description: OpenPGP digital signature


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