mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
hyperv: make HvSintRoute reference-counted
Multiple entities (e.g. VMBus devices) can use the same SINT route. To make their lives easier in maintaining SINT route ownership, make it reference-counted. Adjust the respective API names accordingly. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> Message-Id: <20180921081836.29230-8-rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
09cfb2f635
commit
3d3e6e85c3
3 changed files with 28 additions and 11 deletions
|
@ -52,7 +52,7 @@ static void sint_route_create(HypervTestDev *dev,
|
|||
sint_route->vp_index = vp_index;
|
||||
sint_route->sint = sint;
|
||||
|
||||
sint_route->sint_route = kvm_hv_sint_route_create(vp_index, sint, NULL, NULL);
|
||||
sint_route->sint_route = hyperv_sint_route_new(vp_index, sint, NULL, NULL);
|
||||
assert(sint_route->sint_route);
|
||||
|
||||
QLIST_INSERT_HEAD(&dev->sint_routes, sint_route, le);
|
||||
|
@ -79,7 +79,7 @@ static void sint_route_destroy(HypervTestDev *dev,
|
|||
|
||||
sint_route = sint_route_find(dev, vp_index, sint);
|
||||
QLIST_REMOVE(sint_route, le);
|
||||
kvm_hv_sint_route_destroy(sint_route->sint_route);
|
||||
hyperv_sint_route_unref(sint_route->sint_route);
|
||||
g_free(sint_route);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue