virsh: Define multi line macros properly

In some cases there's dangling backward slash at the end of multi
line macros. While technically the code works, it will stop if
some empty lines are removed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-10-31 11:47:36 +01:00
parent 1ed22398c3
commit 27b67eba22
9 changed files with 28 additions and 28 deletions

View File

@ -41,7 +41,7 @@
#include "virstring.h" #include "virstring.h"
#define VIRSH_COMMON_OPT_DOMAIN_FULL \ #define VIRSH_COMMON_OPT_DOMAIN_FULL \
VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid")) \ VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"))
VIR_ENUM_DECL(virshDomainIOError) VIR_ENUM_DECL(virshDomainIOError)
VIR_ENUM_IMPL(virshDomainIOError, VIR_ENUM_IMPL(virshDomainIOError,

View File

@ -66,22 +66,22 @@
#endif #endif
#define VIRSH_COMMON_OPT_DOMAIN_FULL \ #define VIRSH_COMMON_OPT_DOMAIN_FULL \
VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid")) \ VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"))
#define VIRSH_COMMON_OPT_DOMAIN_PERSISTENT \ #define VIRSH_COMMON_OPT_DOMAIN_PERSISTENT \
{.name = "persistent", \ {.name = "persistent", \
.type = VSH_OT_BOOL, \ .type = VSH_OT_BOOL, \
.help = N_("make live change persistent") \ .help = N_("make live change persistent") \
} \ }
#define VIRSH_COMMON_OPT_DOMAIN_CONFIG \ #define VIRSH_COMMON_OPT_DOMAIN_CONFIG \
VIRSH_COMMON_OPT_CONFIG(N_("affect next boot")) \ VIRSH_COMMON_OPT_CONFIG(N_("affect next boot"))
#define VIRSH_COMMON_OPT_DOMAIN_LIVE \ #define VIRSH_COMMON_OPT_DOMAIN_LIVE \
VIRSH_COMMON_OPT_LIVE(N_("affect running domain")) \ VIRSH_COMMON_OPT_LIVE(N_("affect running domain"))
#define VIRSH_COMMON_OPT_DOMAIN_CURRENT \ #define VIRSH_COMMON_OPT_DOMAIN_CURRENT \
VIRSH_COMMON_OPT_CURRENT(N_("affect current domain")) \ VIRSH_COMMON_OPT_CURRENT(N_("affect current domain"))
static virDomainPtr static virDomainPtr
@ -1302,7 +1302,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
VIR_DOMAIN_BLOCK_IOTUNE_##CONST, \ VIR_DOMAIN_BLOCK_IOTUNE_##CONST, \
value) < 0) \ value) < 0) \
goto save_error; \ goto save_error; \
} \ }
VSH_ADD_IOTUNE_SCALED(total-bytes-sec, TOTAL_BYTES_SEC); VSH_ADD_IOTUNE_SCALED(total-bytes-sec, TOTAL_BYTES_SEC);
VSH_ADD_IOTUNE_SCALED(read-bytes-sec, READ_BYTES_SEC); VSH_ADD_IOTUNE_SCALED(read-bytes-sec, READ_BYTES_SEC);
@ -1320,7 +1320,7 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
VIR_DOMAIN_BLOCK_IOTUNE_##CONST, \ VIR_DOMAIN_BLOCK_IOTUNE_##CONST, \
value) < 0) \ value) < 0) \
goto save_error; \ goto save_error; \
} \ }
VSH_ADD_IOTUNE(total-iops-sec, TOTAL_IOPS_SEC); VSH_ADD_IOTUNE(total-iops-sec, TOTAL_IOPS_SEC);
VSH_ADD_IOTUNE(read-iops-sec, READ_IOPS_SEC); VSH_ADD_IOTUNE(read-iops-sec, READ_IOPS_SEC);
@ -9104,7 +9104,7 @@ cmdMemtune(vshControl *ctl, const vshCmd *cmd)
if (virTypedParamsAddULLong(&params, &nparams, &maxparams, \ if (virTypedParamsAddULLong(&params, &nparams, &maxparams, \
FIELD, tmpVal) < 0) \ FIELD, tmpVal) < 0) \
goto save_error; \ goto save_error; \
} \ }
PARSE_MEMTUNE_PARAM("hard-limit", VIR_DOMAIN_MEMORY_HARD_LIMIT); PARSE_MEMTUNE_PARAM("hard-limit", VIR_DOMAIN_MEMORY_HARD_LIMIT);

View File

@ -28,7 +28,7 @@
.type = VSH_OT_DATA, \ .type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \ .flags = VSH_OFLAG_REQ, \
.help = N_("interface name or MAC address") \ .help = N_("interface name or MAC address") \
} \ }
#include <config.h> #include <config.h>
#include "virsh-interface.h" #include "virsh-interface.h"

View File

@ -39,7 +39,7 @@
.type = VSH_OT_DATA, \ .type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \ .flags = VSH_OFLAG_REQ, \
.help = N_("network name or uuid") \ .help = N_("network name or uuid") \
} \ }
virNetworkPtr virNetworkPtr
virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd,

View File

@ -35,28 +35,28 @@
#include "virtime.h" #include "virtime.h"
#define VIRSH_COMMON_OPT_POOL_FULL \ #define VIRSH_COMMON_OPT_POOL_FULL \
VIRSH_COMMON_OPT_POOL(N_("pool name or uuid")) \ VIRSH_COMMON_OPT_POOL(N_("pool name or uuid"))
#define VIRSH_COMMON_OPT_POOL_BUILD \ #define VIRSH_COMMON_OPT_POOL_BUILD \
{.name = "build", \ {.name = "build", \
.type = VSH_OT_BOOL, \ .type = VSH_OT_BOOL, \
.flags = 0, \ .flags = 0, \
.help = N_("build the pool as normal") \ .help = N_("build the pool as normal") \
} \ }
#define VIRSH_COMMON_OPT_POOL_NO_OVERWRITE \ #define VIRSH_COMMON_OPT_POOL_NO_OVERWRITE \
{.name = "no-overwrite", \ {.name = "no-overwrite", \
.type = VSH_OT_BOOL, \ .type = VSH_OT_BOOL, \
.flags = 0, \ .flags = 0, \
.help = N_("do not overwrite any existing data") \ .help = N_("do not overwrite any existing data") \
} \ }
#define VIRSH_COMMON_OPT_POOL_OVERWRITE \ #define VIRSH_COMMON_OPT_POOL_OVERWRITE \
{.name = "overwrite", \ {.name = "overwrite", \
.type = VSH_OT_BOOL, \ .type = VSH_OT_BOOL, \
.flags = 0, \ .flags = 0, \
.help = N_("overwrite any existing data") \ .help = N_("overwrite any existing data") \
} \ }
#define VIRSH_COMMON_OPT_POOL_X_AS \ #define VIRSH_COMMON_OPT_POOL_X_AS \
{.name = "name", \ {.name = "name", \
@ -128,7 +128,7 @@
{.name = "adapter-parent", \ {.name = "adapter-parent", \
.type = VSH_OT_STRING, \ .type = VSH_OT_STRING, \
.help = N_("adapter parent to be used for underlying storage") \ .help = N_("adapter parent to be used for underlying storage") \
} \ }
virStoragePoolPtr virStoragePoolPtr
virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname, virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,

View File

@ -43,7 +43,7 @@
#include "conf/snapshot_conf.h" #include "conf/snapshot_conf.h"
#define VIRSH_COMMON_OPT_DOMAIN_FULL \ #define VIRSH_COMMON_OPT_DOMAIN_FULL \
VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid")) \ VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"))
/* Helper for snapshot-create and snapshot-create-as */ /* Helper for snapshot-create and snapshot-create-as */
static bool static bool

View File

@ -44,23 +44,23 @@
#include "virstring.h" #include "virstring.h"
#define VIRSH_COMMON_OPT_POOL_FULL \ #define VIRSH_COMMON_OPT_POOL_FULL \
VIRSH_COMMON_OPT_POOL(N_("pool name or uuid")) \ VIRSH_COMMON_OPT_POOL(N_("pool name or uuid"))
#define VIRSH_COMMON_OPT_POOL_NAME \ #define VIRSH_COMMON_OPT_POOL_NAME \
VIRSH_COMMON_OPT_POOL(N_("pool name")) \ VIRSH_COMMON_OPT_POOL(N_("pool name"))
#define VIRSH_COMMON_OPT_POOL_OPTIONAL \ #define VIRSH_COMMON_OPT_POOL_OPTIONAL \
{.name = "pool", \ {.name = "pool", \
.type = VSH_OT_STRING, \ .type = VSH_OT_STRING, \
.help = N_("pool name or uuid") \ .help = N_("pool name or uuid") \
} \ }
#define VIRSH_COMMON_OPT_VOLUME_VOL \ #define VIRSH_COMMON_OPT_VOLUME_VOL \
{.name = "vol", \ {.name = "vol", \
.type = VSH_OT_DATA, \ .type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \ .flags = VSH_OFLAG_REQ, \
.help = N_("vol name, key or path") \ .help = N_("vol name, key or path") \
} \ }
virStorageVolPtr virStorageVolPtr
virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd, virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,

View File

@ -68,39 +68,39 @@
.type = VSH_OT_DATA, \ .type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \ .flags = VSH_OFLAG_REQ, \
.help = _helpstr \ .help = _helpstr \
} \ }
# define VIRSH_COMMON_OPT_DOMAIN(_helpstr) \ # define VIRSH_COMMON_OPT_DOMAIN(_helpstr) \
{.name = "domain", \ {.name = "domain", \
.type = VSH_OT_DATA, \ .type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \ .flags = VSH_OFLAG_REQ, \
.help = _helpstr \ .help = _helpstr \
} \ }
# define VIRSH_COMMON_OPT_CONFIG(_helpstr) \ # define VIRSH_COMMON_OPT_CONFIG(_helpstr) \
{.name = "config", \ {.name = "config", \
.type = VSH_OT_BOOL, \ .type = VSH_OT_BOOL, \
.help = _helpstr \ .help = _helpstr \
} \ }
# define VIRSH_COMMON_OPT_LIVE(_helpstr) \ # define VIRSH_COMMON_OPT_LIVE(_helpstr) \
{.name = "live", \ {.name = "live", \
.type = VSH_OT_BOOL, \ .type = VSH_OT_BOOL, \
.help = _helpstr \ .help = _helpstr \
} \ }
# define VIRSH_COMMON_OPT_CURRENT(_helpstr) \ # define VIRSH_COMMON_OPT_CURRENT(_helpstr) \
{.name = "current", \ {.name = "current", \
.type = VSH_OT_BOOL, \ .type = VSH_OT_BOOL, \
.help = _helpstr \ .help = _helpstr \
} \ }
# define VIRSH_COMMON_OPT_FILE(_helpstr) \ # define VIRSH_COMMON_OPT_FILE(_helpstr) \
{.name = "file", \ {.name = "file", \
.type = VSH_OT_DATA, \ .type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \ .flags = VSH_OFLAG_REQ, \
.help = _helpstr \ .help = _helpstr \
} \ }
typedef struct _virshControl virshControl; typedef struct _virshControl virshControl;
typedef virshControl *virshControlPtr; typedef virshControl *virshControlPtr;

View File

@ -37,7 +37,7 @@
_("%s module is not loaded, " err_msg), \ _("%s module is not loaded, " err_msg), \
#mod); \ #mod); \
ret = -1; \ ret = -1; \
} \ }
#define MODULE_STATUS_FAIL(mod, err_msg) \ #define MODULE_STATUS_FAIL(mod, err_msg) \
MODULE_STATUS(mod, err_msg, VIR_HOST_VALIDATE_FAIL) MODULE_STATUS(mod, err_msg, VIR_HOST_VALIDATE_FAIL)