virsh: Fix version numbers in comments

And redundant error resetting.

Pushed under trivial rule.
This commit is contained in:
Osier Yang 2012-09-13 16:56:07 +08:00
parent 16e41ab656
commit aa81db3ff8
3 changed files with 9 additions and 15 deletions

View File

@ -397,7 +397,7 @@ vshNetworkListCollect(vshControl *ctl,
int nInactiveNets = 0; int nInactiveNets = 0;
int nAllNets = 0; int nAllNets = 0;
/* try the list with flags support (0.10.0 and later) */ /* try the list with flags support (0.10.2 and later) */
if ((ret = virConnectListAllNetworks(ctl->conn, if ((ret = virConnectListAllNetworks(ctl->conn,
&list->nets, &list->nets,
flags)) >= 0) { flags)) >= 0) {
@ -406,10 +406,8 @@ vshNetworkListCollect(vshControl *ctl,
} }
/* check if the command is actually supported */ /* check if the command is actually supported */
if (last_error && last_error->code == VIR_ERR_NO_SUPPORT) { if (last_error && last_error->code == VIR_ERR_NO_SUPPORT)
vshResetLibvirtError();
goto fallback; goto fallback;
}
if (last_error && last_error->code == VIR_ERR_INVALID_ARG) { if (last_error && last_error->code == VIR_ERR_INVALID_ARG) {
/* try the new API again but mask non-guaranteed flags */ /* try the new API again but mask non-guaranteed flags */
@ -430,7 +428,7 @@ vshNetworkListCollect(vshControl *ctl,
fallback: fallback:
/* fall back to old method (0.9.13 and older) */ /* fall back to old method (0.10.1 and older) */
vshResetLibvirtError(); vshResetLibvirtError();
/* Get the number of active networks */ /* Get the number of active networks */

View File

@ -606,7 +606,7 @@ vshStoragePoolListCollect(vshControl *ctl,
int nInactivePools = 0; int nInactivePools = 0;
int nAllPools = 0; int nAllPools = 0;
/* try the list with flags support (0.10.0 and later) */ /* try the list with flags support (0.10.2 and later) */
if ((ret = virConnectListAllStoragePools(ctl->conn, if ((ret = virConnectListAllStoragePools(ctl->conn,
&list->pools, &list->pools,
flags)) >= 0) { flags)) >= 0) {
@ -615,10 +615,8 @@ vshStoragePoolListCollect(vshControl *ctl,
} }
/* check if the command is actually supported */ /* check if the command is actually supported */
if (last_error && last_error->code == VIR_ERR_NO_SUPPORT) { if (last_error && last_error->code == VIR_ERR_NO_SUPPORT)
vshResetLibvirtError();
goto fallback; goto fallback;
}
if (last_error && last_error->code == VIR_ERR_INVALID_ARG) { if (last_error && last_error->code == VIR_ERR_INVALID_ARG) {
/* try the new API again but mask non-guaranteed flags */ /* try the new API again but mask non-guaranteed flags */
@ -638,7 +636,7 @@ vshStoragePoolListCollect(vshControl *ctl,
fallback: fallback:
/* fall back to old method (0.9.13 and older) */ /* fall back to old method (0.10.1 and older) */
vshResetLibvirtError(); vshResetLibvirtError();
/* There is no way to get the pool type */ /* There is no way to get the pool type */

View File

@ -1017,7 +1017,7 @@ vshStorageVolListCollect(vshControl *ctl,
int nvols = 0; int nvols = 0;
int ret = -1; int ret = -1;
/* try the list with flags support (0.10.0 and later) */ /* try the list with flags support (0.10.2 and later) */
if ((ret = virStoragePoolListAllVolumes(pool, if ((ret = virStoragePoolListAllVolumes(pool,
&list->vols, &list->vols,
flags)) >= 0) { flags)) >= 0) {
@ -1026,17 +1026,15 @@ vshStorageVolListCollect(vshControl *ctl,
} }
/* check if the command is actually supported */ /* check if the command is actually supported */
if (last_error && last_error->code == VIR_ERR_NO_SUPPORT) { if (last_error && last_error->code == VIR_ERR_NO_SUPPORT)
vshResetLibvirtError();
goto fallback; goto fallback;
}
/* there was an error during the call */ /* there was an error during the call */
vshError(ctl, "%s", _("Failed to list volumes")); vshError(ctl, "%s", _("Failed to list volumes"));
goto cleanup; goto cleanup;
fallback: fallback:
/* fall back to old method (0.9.13 and older) */ /* fall back to old method (0.10.1 and older) */
vshResetLibvirtError(); vshResetLibvirtError();
/* Determine the number of volumes in the pool */ /* Determine the number of volumes in the pool */