mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
Remove checking of return value of virHashNew
There are two calls to virHashNew which check the return value. It's not necessary any more as virHashNew always returns a valid pointer. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2a5ea0a0c1
commit
6eab924daa
@ -439,15 +439,11 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def,
|
|||||||
virDomainDefPtr dom,
|
virDomainDefPtr dom,
|
||||||
const char *suffix)
|
const char *suffix)
|
||||||
{
|
{
|
||||||
g_autoptr(virHashTable) disks = NULL;
|
g_autoptr(virHashTable) disks = virHashNew(NULL);
|
||||||
size_t i;
|
size_t i;
|
||||||
int ndisks;
|
int ndisks;
|
||||||
bool backup_all = false;
|
bool backup_all = false;
|
||||||
|
|
||||||
|
|
||||||
if (!(disks = virHashNew(NULL)))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/* Unlikely to have a guest without disks but technically possible. */
|
/* Unlikely to have a guest without disks but technically possible. */
|
||||||
if (!dom->ndisks) {
|
if (!dom->ndisks) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
@ -2990,8 +2990,7 @@ qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes)
|
|||||||
{
|
{
|
||||||
g_autoptr(virHashTable) ret = NULL;
|
g_autoptr(virHashTable) ret = NULL;
|
||||||
|
|
||||||
if (!(ret = virHashNew((virHashDataFree) qemuMonitorJSONBlockNamedNodeDataFree)))
|
ret = virHashNew((virHashDataFree) qemuMonitorJSONBlockNamedNodeDataFree);
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (virJSONValueArrayForeachSteal(nodes,
|
if (virJSONValueArrayForeachSteal(nodes,
|
||||||
qemuMonitorJSONBlockGetNamedNodeDataWorker,
|
qemuMonitorJSONBlockGetNamedNodeDataWorker,
|
||||||
|
Loading…
Reference in New Issue
Block a user