mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virsh: remove variable 'ret' and 'inactive'
Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
409ccebcaa
commit
45b17385e7
@ -485,26 +485,23 @@ static bool
|
||||
cmdInterfaceDumpXML(vshControl *ctl, const vshCmd *cmd)
|
||||
{
|
||||
virInterfacePtr iface;
|
||||
bool ret = true;
|
||||
g_autofree char *dump = NULL;
|
||||
unsigned int flags = 0;
|
||||
bool inactive = vshCommandOptBool(cmd, "inactive");
|
||||
|
||||
if (inactive)
|
||||
if (vshCommandOptBool(cmd, "inactive"))
|
||||
flags |= VIR_INTERFACE_XML_INACTIVE;
|
||||
|
||||
if (!(iface = virshCommandOptInterface(ctl, cmd, NULL)))
|
||||
return false;
|
||||
|
||||
dump = virInterfaceGetXMLDesc(iface, flags);
|
||||
if (dump != NULL) {
|
||||
vshPrint(ctl, "%s", dump);
|
||||
} else {
|
||||
ret = false;
|
||||
if (!(dump = virInterfaceGetXMLDesc(iface, flags))) {
|
||||
virInterfaceFree(iface);
|
||||
return false;
|
||||
}
|
||||
|
||||
vshPrint(ctl, "%s", dump);
|
||||
virInterfaceFree(iface);
|
||||
return ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -360,28 +360,23 @@ static bool
|
||||
cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd)
|
||||
{
|
||||
virNetworkPtr network;
|
||||
bool ret = true;
|
||||
g_autofree char *dump = NULL;
|
||||
unsigned int flags = 0;
|
||||
int inactive;
|
||||
|
||||
if (!(network = virshCommandOptNetwork(ctl, cmd, NULL)))
|
||||
return false;
|
||||
|
||||
inactive = vshCommandOptBool(cmd, "inactive");
|
||||
if (inactive)
|
||||
if (vshCommandOptBool(cmd, "inactive"))
|
||||
flags |= VIR_NETWORK_XML_INACTIVE;
|
||||
|
||||
dump = virNetworkGetXMLDesc(network, flags);
|
||||
|
||||
if (dump != NULL) {
|
||||
vshPrint(ctl, "%s", dump);
|
||||
} else {
|
||||
ret = false;
|
||||
if (!(dump = virNetworkGetXMLDesc(network, flags))) {
|
||||
virNetworkFree(network);
|
||||
return false;
|
||||
}
|
||||
|
||||
vshPrint(ctl, "%s", dump);
|
||||
virNetworkFree(network);
|
||||
return ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user