hmat = true;
}
- if (VIR_ALLOC_N(nodeBackends, ncells) < 0)
- goto cleanup;
+ nodeBackends = g_new0(virBuffer, ncells);
/* using of -numa memdev= cannot be combined with -numa mem=, thus we
* need to check which approach to use */
if (!tapfdSize)
tapfdSize = 1;
- if (VIR_ALLOC_N(tapfd, tapfdSize) < 0 ||
- VIR_ALLOC_N(tapfdName, tapfdSize) < 0)
- goto cleanup;
+ tapfd = g_new0(int, tapfdSize);
+ tapfdName = g_new0(char *, tapfdSize);
memset(tapfd, -1, tapfdSize * sizeof(tapfd[0]));
if (!tapfdSize)
tapfdSize = 1;
- if (VIR_ALLOC_N(tapfd, tapfdSize) < 0 ||
- VIR_ALLOC_N(tapfdName, tapfdSize) < 0)
- goto cleanup;
+ tapfd = g_new0(int, tapfdSize);
+ tapfdName = g_new0(char *, tapfdSize);
memset(tapfd, -1, tapfdSize * sizeof(tapfd[0]));
if (!tapfdSize)
tapfdSize = 1;
- if (VIR_ALLOC_N(tapfd, tapfdSize) < 0 ||
- VIR_ALLOC_N(tapfdName, tapfdSize) < 0)
- goto cleanup;
+ tapfd = g_new0(int, tapfdSize);
+ tapfdName = g_new0(char *, tapfdSize);
memset(tapfd, -1, tapfdSize * sizeof(tapfd[0]));
if (!vhostfdSize)
vhostfdSize = 1;
- if (VIR_ALLOC_N(vhostfd, vhostfdSize) < 0 ||
- VIR_ALLOC_N(vhostfdName, vhostfdSize))
- goto cleanup;
+ vhostfd = g_new0(int, vhostfdSize);
+ vhostfdName = g_new0(char *, vhostfdSize);
memset(vhostfd, -1, vhostfdSize * sizeof(vhostfd[0]));
{
g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
- if (VIR_ALLOC(data) < 0)
- return NULL;
+ data = g_new0(qemuBlockStorageSourceAttachData, 1);
if (!(data->driveCmd = qemuBuildDriveStr(disk, qemuCaps)) ||
!(data->driveAlias = qemuAliasDiskDriveFromDisk(disk)))
g_autoptr(qemuBlockStorageSourceAttachData) elem = NULL;
g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
- if (VIR_ALLOC(data) < 0)
- return NULL;
+ data = g_new0(qemuBlockStorageSourceChainData, 1);
if (!(elem = qemuBuildStorageSourceAttachPrepareDrive(disk, qemuCaps)))
return NULL;
g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
virStorageSourcePtr n;
- if (VIR_ALLOC(data) < 0)
- return NULL;
+ data = g_new0(qemuBlockStorageSourceChainData, 1);
for (n = top; virStorageSourceIsBacking(n); n = n->backingStore) {
if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, n,
{
g_autoptr(qemuBlockStorageSourceChainData) data = NULL;
- if (VIR_ALLOC(data) < 0)
- return NULL;
+ data = g_new0(qemuBlockStorageSourceChainData, 1);
if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, top, backingStore,
qemuCaps) < 0)