]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix invalid log, misused option types and a typo
authorHao Liu <hliu@redhat.com>
Tue, 11 Nov 2014 02:12:20 +0000 (10:12 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 11 Nov 2014 10:05:43 +0000 (11:05 +0100)
This patch fixes the following issues.

1)  When an invalid wwn is introduced, libvirt reports
    "Malformed wwn: %s". The template won't be replaced.

2)  "target" option for dompmsuspend and "xml" option for
    save-image-define are required options and should use
    VSH_OT_DATA instead of VSH_OT_STRING as an option type.

3)  A typo.

Signed-off-by: Hao Liu <hliu@redhat.com>
src/util/virutil.c
tools/virsh-domain.c
tools/virsh-host.c

index 1116fda01b496db614ab7e81e7a4233b7de8a37d..c178515908defc0505250aef6a609f50d9abea5a 100644 (file)
@@ -1549,8 +1549,8 @@ virValidateWWN(const char *wwn)
     }
 
     if (i != 16 || p[i]) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("Malformed wwn: %s"));
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("Malformed wwn: %s"), wwn);
         return false;
     }
 
index 13a904fbd5a3091a4ea05eca4b84aa07660b06ed..8e743f1415ffe50ad42070b26b44a7347dfde836 100644 (file)
@@ -3228,7 +3228,7 @@ static const vshCmdOptDef opts_dom_pm_suspend[] = {
      .help = N_("duration in seconds")
     },
     {.name = "target",
-     .type = VSH_OT_STRING,
+     .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
      .help = N_("mem(Suspend-to-RAM), "
                 "disk(Suspend-to-Disk), "
@@ -4268,7 +4268,7 @@ static const vshCmdOptDef opts_save_image_define[] = {
      .help = N_("saved state file to modify")
     },
     {.name = "xml",
-     .type = VSH_OT_STRING,
+     .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
      .help = N_("filename containing updated XML for the target")
     },
index 4a3ff2846ddc2d2928029479892e0be9d36b8a7b..28b160d69b8204b2fcd6b9e056dcd93cf9bcc18f 100644 (file)
@@ -497,7 +497,7 @@ cmdAllocpages(vshControl *ctl, const vshCmd *cmd)
     pageSizes[0] = VIR_DIV_UP(tmp, 1024);
 
     if (vshCommandOptULongLong(cmd, "pagecount", &pageCounts[0]) < 0) {
-        vshError(ctl, "%s", _("pagecount hat to be a number"));
+        vshError(ctl, "%s", _("pagecount has to be a number"));
         return false;
     }