提交 0f35e001 编写于 作者: H Harry Wei 提交者: Eric Blake

sheepdog: Omit braces with a single-line body

libvirt/HACKING suggests omitting braces with a
single-line body; this patch fixes the coding style
problem for the Sheepdog storage backend driver.
Signed-off-by: NHarry Wei <harryxiyou@gmail.com>
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 aed49863
......@@ -97,12 +97,10 @@ virStorageBackendSheepdogAddHostArg(virCommandPtr cmd,
const char *address = "localhost";
int port = 7000;
if (pool->def->source.nhost > 0) {
if (pool->def->source.hosts[0].name != NULL) {
if (pool->def->source.hosts[0].name != NULL)
address = pool->def->source.hosts[0].name;
}
if (pool->def->source.hosts[0].port) {
if (pool->def->source.hosts[0].port)
port = pool->def->source.hosts[0].port;
}
}
virCommandAddArg(cmd, "-a");
virCommandAddArgFormat(cmd, "%s", address);
......@@ -210,11 +208,10 @@ virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol,
continue;
/* skip space */
if (p + 2 < next) {
if (p + 2 < next)
p += 2;
} else {
else
return -1;
}
/* skip name */
while (*p != '\0' && *p != ' ') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册