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

Re: [libvirt] [PATCH] phyp: sed cleanups



On 06/08/2010 10:17 PM, Eric Blake wrote:

While I was touching the file...

Thank you very much for this help :)


  src/phyp/phyp_driver.c |   12 ++++++------
  1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 0f4bc20..f8d12e7 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -886,7 +886,7 @@ phypGetVIOSPartitionID(virConnectPtr conn)

      if (virAsprintf(&cmd,
                      "lssyscfg -m %s -r lpar -F lpar_id,lpar_env|grep "
-                    "vioserver|sed -s 's/,.*$//g'", managed_system)<  0) {
+                    "vioserver|sed -s 's/,.*$//'", managed_system)<  0) {
          virReportOOMError();
          goto err;
      }
@@ -925,7 +925,7 @@ phypDiskType(virConnectPtr conn, char *backing_device)

      if (virAsprintf(&cmd,
                      "viosvrcmd -m %s -p %d -c \"lssp -field name type "
-                    "-fmt , -all|grep %s|sed -e 's/^.*,//g'\"",
+                    "-fmt , -all|grep %s|sed -e 's/^.*,//'\"",
                      managed_system, vios_id, backing_device)<  0) {
          virReportOOMError();
          goto cleanup;
@@ -983,7 +983,7 @@ phypNumDomainsGeneric(virConnectPtr conn, unsigned int type)

      if (virAsprintf(&cmd,
                      "lssyscfg -r lpar -m %s -F lpar_id,state %s |grep -c "
-                    "^[0-9]*", managed_system, state)<  0) {
+                    "'^[0-9]*'", managed_system, state)<  0) {
          virReportOOMError();
          goto err;
      }
@@ -1051,7 +1051,7 @@ phypListDomainsGeneric(virConnectPtr conn, int *ids, int nids,

      if (virAsprintf
          (&cmd,
-         "lssyscfg -r lpar -m %s -F lpar_id,state %s | sed -e 's/,.*$//g'",
+         "lssyscfg -r lpar -m %s -F lpar_id,state %s | sed -e 's/,.*$//'",
           managed_system, state)<  0) {
          virReportOOMError();
          goto err;
@@ -1115,7 +1115,7 @@ phypListDefinedDomains(virConnectPtr conn, char **const names, int nnames)
      if (virAsprintf
          (&cmd,
           "lssyscfg -r lpar -m %s -F name,state | grep \"Not Activated\" | "
-         "sed -e 's/,.*$//g'", managed_system)<  0) {
+         "sed -e 's/,.*$//'", managed_system)<  0) {
          virReportOOMError();
          goto err;
      }
@@ -1539,7 +1539,7 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)
      if (virAsprintf
          (&cmd,
           "chhwres -r proc -m %s --id %d -o %c --procunits %d 2>&1 |sed"
-         "-e 's/^.*\\([0-9]\\+.[0-9]\\+\\).*$/\\1/g'",
+         "-e 's/^.*\\([0-9][0-9]*.[0-9][0-9]*\\).*$/\\1/'",
           managed_system, dom->id, operation, amount)<  0) {
          virReportOOMError();
          goto err;

I tested all the changes here and it's all ACK for me.

--
Eduardo Otubo
Software Engineer
Linux Technology Center
IBM Systems & Technology Group
Mobile: +55 19 8135 0885
eotubo linux vnet ibm com


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