And redundant error resetting.
Pushed under trivial rule.
int nInactiveNets = 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,
&list->nets,
flags)) >= 0) {
}
/* check if the command is actually supported */
- if (last_error && last_error->code == VIR_ERR_NO_SUPPORT) {
- vshResetLibvirtError();
+ if (last_error && last_error->code == VIR_ERR_NO_SUPPORT)
goto fallback;
- }
if (last_error && last_error->code == VIR_ERR_INVALID_ARG) {
/* try the new API again but mask non-guaranteed flags */
fallback:
- /* fall back to old method (0.9.13 and older) */
+ /* fall back to old method (0.10.1 and older) */
vshResetLibvirtError();
/* Get the number of active networks */
int nInactivePools = 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,
&list->pools,
flags)) >= 0) {
}
/* check if the command is actually supported */
- if (last_error && last_error->code == VIR_ERR_NO_SUPPORT) {
- vshResetLibvirtError();
+ if (last_error && last_error->code == VIR_ERR_NO_SUPPORT)
goto fallback;
- }
if (last_error && last_error->code == VIR_ERR_INVALID_ARG) {
/* try the new API again but mask non-guaranteed flags */
fallback:
- /* fall back to old method (0.9.13 and older) */
+ /* fall back to old method (0.10.1 and older) */
vshResetLibvirtError();
/* There is no way to get the pool type */
int nvols = 0;
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,
&list->vols,
flags)) >= 0) {
}
/* check if the command is actually supported */
- if (last_error && last_error->code == VIR_ERR_NO_SUPPORT) {
- vshResetLibvirtError();
+ if (last_error && last_error->code == VIR_ERR_NO_SUPPORT)
goto fallback;
- }
/* there was an error during the call */
vshError(ctl, "%s", _("Failed to list volumes"));
goto cleanup;
fallback:
- /* fall back to old method (0.9.13 and older) */
+ /* fall back to old method (0.10.1 and older) */
vshResetLibvirtError();
/* Determine the number of volumes in the pool */