mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +00:00
vbox: remove unneeded labels
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
9000b2f298
commit
5731181fbd
@ -357,24 +357,24 @@ vboxLookupRegistryValue(HKEY key, const char *keyName, const char *valueName)
|
|||||||
if (status != ERROR_SUCCESS) {
|
if (status != ERROR_SUCCESS) {
|
||||||
VIR_ERROR(_("Could not query registry value '%s\\%s'"),
|
VIR_ERROR(_("Could not query registry value '%s\\%s'"),
|
||||||
keyName, valueName);
|
keyName, valueName);
|
||||||
goto cleanup;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type != REG_SZ) {
|
if (type != REG_SZ) {
|
||||||
VIR_ERROR(_("Registry value '%s\\%s' has unexpected type"),
|
VIR_ERROR(_("Registry value '%s\\%s' has unexpected type"),
|
||||||
keyName, valueName);
|
keyName, valueName);
|
||||||
goto cleanup;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length < 2) {
|
if (length < 2) {
|
||||||
VIR_ERROR(_("Registry value '%s\\%s' is too short"),
|
VIR_ERROR(_("Registry value '%s\\%s' is too short"),
|
||||||
keyName, valueName);
|
keyName, valueName);
|
||||||
goto cleanup;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* +1 for the null-terminator if it's missing */
|
/* +1 for the null-terminator if it's missing */
|
||||||
if (VIR_ALLOC_N(value, length + 1) < 0)
|
if (VIR_ALLOC_N(value, length + 1) < 0)
|
||||||
goto cleanup;
|
return NULL;
|
||||||
|
|
||||||
status = RegQueryValueEx(key, valueName, NULL, NULL, (LPBYTE)value, &length);
|
status = RegQueryValueEx(key, valueName, NULL, NULL, (LPBYTE)value, &length);
|
||||||
|
|
||||||
@ -382,13 +382,12 @@ vboxLookupRegistryValue(HKEY key, const char *keyName, const char *valueName)
|
|||||||
VIR_FREE(value);
|
VIR_FREE(value);
|
||||||
VIR_ERROR(_("Could not query registry value '%s\\%s'"),
|
VIR_ERROR(_("Could not query registry value '%s\\%s'"),
|
||||||
keyName, valueName);
|
keyName, valueName);
|
||||||
goto cleanup;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value[length - 1] != '\0')
|
if (value[length - 1] != '\0')
|
||||||
value[length] = '\0';
|
value[length] = '\0';
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1228,23 +1228,20 @@ virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine,
|
|||||||
if (machine == NULL) {
|
if (machine == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Machine is null"));
|
_("Machine is null"));
|
||||||
goto cleanup;
|
return 0;
|
||||||
}
|
}
|
||||||
if (snapshotName == NULL) {
|
if (snapshotName == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("snapshotName is null"));
|
_("snapshotName is null"));
|
||||||
goto cleanup;
|
return 0;
|
||||||
}
|
}
|
||||||
snapshot = virVBoxSnapshotConfSnapshotByName(machine->snapshot, snapshotName);
|
snapshot = virVBoxSnapshotConfSnapshotByName(machine->snapshot, snapshotName);
|
||||||
if (snapshot == NULL) {
|
if (snapshot == NULL) {
|
||||||
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
|
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
|
||||||
_("Unable to find the snapshot %s"), snapshotName);
|
_("Unable to find the snapshot %s"), snapshotName);
|
||||||
goto cleanup;
|
return 0;
|
||||||
}
|
}
|
||||||
return STREQ(snapshot->uuid, machine->currentSnapshot);
|
return STREQ(snapshot->uuid, machine->currentSnapshot);
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user