mirror of https://gitee.com/openkylin/libvirt.git
domain_conf: make virDomainLeaseInsertPreAlloc() void
This function always returns zero, so it might as well be void. Signed-off-by: Matt Coleman <matt@datto.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
28a8699316
commit
56dab2f0b3
|
@ -18272,17 +18272,15 @@ int virDomainLeaseIndex(virDomainDefPtr def,
|
|||
}
|
||||
|
||||
|
||||
int virDomainLeaseInsertPreAlloc(virDomainDefPtr def)
|
||||
void virDomainLeaseInsertPreAlloc(virDomainDefPtr def)
|
||||
{
|
||||
def->leases = g_renew(virDomainLeaseDefPtr, def->leases, def->nleases + 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int virDomainLeaseInsert(virDomainDefPtr def,
|
||||
virDomainLeaseDefPtr lease)
|
||||
{
|
||||
if (virDomainLeaseInsertPreAlloc(def) < 0)
|
||||
return -1;
|
||||
virDomainLeaseInsertPreAlloc(def);
|
||||
|
||||
virDomainLeaseInsertPreAlloced(def, lease);
|
||||
return 0;
|
||||
|
|
|
@ -3434,8 +3434,7 @@ int virDomainLeaseIndex(virDomainDefPtr def,
|
|||
virDomainLeaseDefPtr lease);
|
||||
int virDomainLeaseInsert(virDomainDefPtr def,
|
||||
virDomainLeaseDefPtr lease);
|
||||
int virDomainLeaseInsertPreAlloc(virDomainDefPtr def)
|
||||
G_GNUC_WARN_UNUSED_RESULT;
|
||||
void virDomainLeaseInsertPreAlloc(virDomainDefPtr def);
|
||||
void virDomainLeaseInsertPreAlloced(virDomainDefPtr def,
|
||||
virDomainLeaseDefPtr lease);
|
||||
virDomainLeaseDefPtr
|
||||
|
|
|
@ -3321,8 +3321,7 @@ qemuDomainAttachLease(virQEMUDriverPtr driver,
|
|||
{
|
||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
if (virDomainLeaseInsertPreAlloc(vm->def) < 0)
|
||||
return -1;
|
||||
virDomainLeaseInsertPreAlloc(vm->def);
|
||||
|
||||
if (virDomainLockLeaseAttach(driver->lockManager, cfg->uri,
|
||||
vm, lease) < 0) {
|
||||
|
|
Loading…
Reference in New Issue