提交 6c0af6be 编写于 作者: M Michal Privoznik

virNetDevOpenvswitchConstructVlans: return void

This function returns nothing else than zero. Make it void.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 27761b17
...@@ -64,17 +64,14 @@ virNetDevOpenvswitchAddTimeout(virCommandPtr cmd) ...@@ -64,17 +64,14 @@ virNetDevOpenvswitchAddTimeout(virCommandPtr cmd)
* *
* Construct the VLAN configuration parameters to be passed to * Construct the VLAN configuration parameters to be passed to
* ovs-vsctl command. * ovs-vsctl command.
*
* Returns 0 in case of success or -1 in case of failure.
*/ */
static int static void
virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtVlan) virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtVlan)
{ {
int ret = -1;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
if (!virtVlan || !virtVlan->nTags) if (!virtVlan || !virtVlan->nTags)
return 0; return;
switch (virtVlan->nativeMode) { switch (virtVlan->nativeMode) {
case VIR_NATIVE_VLAN_MODE_TAGGED: case VIR_NATIVE_VLAN_MODE_TAGGED:
...@@ -112,9 +109,6 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV ...@@ -112,9 +109,6 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtV
} else if (virtVlan->nTags) { } else if (virtVlan->nTags) {
virCommandAddArgFormat(cmd, "tag=%d", virtVlan->tag[0]); virCommandAddArgFormat(cmd, "tag=%d", virtVlan->tag[0]);
} }
ret = 0;
return ret;
} }
/** /**
...@@ -162,8 +156,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, ...@@ -162,8 +156,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
virCommandAddArgList(cmd, "--", "--if-exists", "del-port", virCommandAddArgList(cmd, "--", "--if-exists", "del-port",
ifname, "--", "add-port", brname, ifname, NULL); ifname, "--", "add-port", brname, ifname, NULL);
if (virNetDevOpenvswitchConstructVlans(cmd, virtVlan) < 0) virNetDevOpenvswitchConstructVlans(cmd, virtVlan);
return -1;
if (ovsport->profileID[0] == '\0') { if (ovsport->profileID[0] == '\0') {
virCommandAddArgList(cmd, virCommandAddArgList(cmd,
...@@ -547,8 +540,7 @@ int virNetDevOpenvswitchUpdateVlan(const char *ifname, ...@@ -547,8 +540,7 @@ int virNetDevOpenvswitchUpdateVlan(const char *ifname,
"--", "--if-exists", "clear", "Port", ifname, "vlan_mode", "--", "--if-exists", "clear", "Port", ifname, "vlan_mode",
"--", "--if-exists", "set", "Port", ifname, NULL); "--", "--if-exists", "set", "Port", ifname, NULL);
if (virNetDevOpenvswitchConstructVlans(cmd, virtVlan) < 0) virNetDevOpenvswitchConstructVlans(cmd, virtVlan);
return -1;
if (virCommandRun(cmd, NULL) < 0) { if (virCommandRun(cmd, NULL) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册