Re: [Xen-devel] [PATCH 2/4] xl: wrap long lines where possible

2016-01-25 Thread Ian Campbell
On Fri, 2016-01-22 at 11:50 +, Wei Liu wrote:
> No functional changes introduced.
> 
> Signed-off-by: Wei Liu 

Acked-by: Ian Campbell 

(unread)


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH 2/4] xl: wrap long lines where possible

2016-01-22 Thread Wei Liu
No functional changes introduced.

Signed-off-by: Wei Liu 
---
 tools/libxl/xl_cmdimpl.c | 107 ---
 1 file changed, 73 insertions(+), 34 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index f380799..ff561c3 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -237,12 +237,14 @@ static int acquire_lock(void)
 fl.l_len = 0;
 fd_lock = open(lockfile, O_WRONLY|O_CREAT, S_IWUSR);
 if (fd_lock < 0) {
-fprintf(stderr, "cannot open the lockfile %s errno=%d\n", lockfile, 
errno);
+fprintf(stderr, "cannot open the lockfile %s errno=%d\n",
+lockfile, errno);
 return ERROR_FAIL;
 }
 if (fcntl(fd_lock, F_SETFD, FD_CLOEXEC) < 0) {
 close(fd_lock);
-fprintf(stderr, "cannot set cloexec to lockfile %s errno=%d\n", 
lockfile, errno);
+fprintf(stderr, "cannot set cloexec to lockfile %s errno=%d\n",
+lockfile, errno);
 return ERROR_FAIL;
 }
 get_lock:
@@ -538,12 +540,16 @@ out:
 return ret;
 }
 
-static int parse_action_on_shutdown(const char *buf, libxl_action_on_shutdown 
*a)
+static int parse_action_on_shutdown(const char *buf,
+libxl_action_on_shutdown *a)
 {
-int i;
+int i, size;
 const char *n;
 
-for (i = 0; i < sizeof(action_on_shutdown_names) / 
sizeof(action_on_shutdown_names[0]); i++) {
+size = sizeof(action_on_shutdown_names) /
+sizeof(action_on_shutdown_names[0]);
+
+for (i = 0; i < size; i++) {
 n = action_on_shutdown_names[i];
 
 if (!n) continue;
@@ -994,7 +1000,8 @@ static int match_option_size(const char *prefix, size_t 
len,
 /* Parses network data and adds info into nic
  * Returns 1 if the input token does not match one of the keys
  * or parsed values are not correct. Successful parse returns 0 */
-static int parse_nic_config(libxl_device_nic *nic, XLU_Config **config, char 
*token)
+static int parse_nic_config(libxl_device_nic *nic, XLU_Config **config,
+char *token)
 {
 char *endptr, *oparg;
 int i;
@@ -1040,7 +1047,8 @@ static int parse_nic_config(libxl_device_nic *nic, 
XLU_Config **config, char *to
 } else if (MATCH_OPTION("rate", token, oparg)) {
 parse_vif_rate(config, oparg, nic);
 } else if (MATCH_OPTION("accel", token, oparg)) {
-fprintf(stderr, "the accel parameter for vifs is currently not 
supported\n");
+fprintf(stderr,
+"the accel parameter for vifs is currently not supported\n");
 } else {
 fprintf(stderr, "unrecognized argument `%s'\n", token);
 return 1;
@@ -1580,13 +1588,15 @@ static void parse_config_data(const char *config_source,
 
 if (l < LIBXL_TIMER_MODE_DELAY_FOR_MISSED_TICKS ||
 l > LIBXL_TIMER_MODE_ONE_MISSED_TICK_PENDING) {
-fprintf(stderr, "ERROR: invalid value %ld for 
\"timer_mode\"\n", l);
+fprintf(stderr,
+"ERROR: invalid value %ld for \"timer_mode\"\n", l);
 exit (1);
 }
 b_info->u.hvm.timer_mode = l;
 } else if (!xlu_cfg_get_string(config, "timer_mode", , 0)) {
 if (libxl_timer_mode_from_string(buf, _info->u.hvm.timer_mode)) {
-fprintf(stderr, "ERROR: invalid value \"%s\" for 
\"timer_mode\"\n",
+fprintf(stderr,
+"ERROR: invalid value \"%s\" for \"timer_mode\"\n",
 buf);
 exit (1);
 }
@@ -1605,7 +1615,8 @@ static void parse_config_data(const char *config_source,
 if (!strcmp(buf, "generate")) {
 e = libxl_ms_vm_genid_generate(ctx, 
_info->u.hvm.ms_vm_genid);
 if (e) {
-fprintf(stderr, "ERROR: failed to generate a VM Generation 
ID\n");
+fprintf(stderr,
+"ERROR: failed to generate a VM Generation ID\n");
 exit(1);
 }
 } else if (!strcmp(buf, "none")) {
@@ -1621,7 +1632,8 @@ static void parse_config_data(const char *config_source,
 break;
 case LIBXL_DOMAIN_TYPE_PV:
 {
-xlu_cfg_replace_string (config, "bootloader", 
_info->u.pv.bootloader, 0);
+xlu_cfg_replace_string (config, "bootloader",
+_info->u.pv.bootloader, 0);
 switch (xlu_cfg_get_list_as_string_list(config, "bootloader_args",
   _info->u.pv.bootloader_args, 1))
 {
@@ -1772,7 +1784,8 @@ static void parse_config_data(const char *config_source,
 if (!xlu_cfg_get_list (config, "disk", , 0, 0)) {
 d_config->num_disks = 0;
 d_config->disks = NULL;
-while ((buf = xlu_cfg_get_listitem (vbds, d_config->num_disks)) != 
NULL) {
+while ((buf =