]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
security_stack: Turn list of nested drivers into a doubly linked list
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 11 Sep 2019 08:33:19 +0000 (10:33 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 14 Oct 2019 15:21:59 +0000 (17:21 +0200)
In near future we will need to walk through the list of internal
drivers in reversed order. The simplest solution is to turn
singly linked list into a doubly linked list.
We will not need to start from the end really, so there's no tail
pointer kept.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/security/security_stack.c

index dd055075cbad1fb46d34bf2f54b6fcfd9ba63ed8..51a8b767480a806a145de12595f35f818a916262 100644 (file)
@@ -35,6 +35,7 @@ typedef virSecurityStackItem *virSecurityStackItemPtr;
 struct _virSecurityStackItem {
     virSecurityManagerPtr securityManager;
     virSecurityStackItemPtr next;
+    virSecurityStackItemPtr prev;
 };
 
 struct _virSecurityStackData {
@@ -56,6 +57,7 @@ virSecurityStackAddNested(virSecurityManagerPtr mgr,
     if (VIR_ALLOC(item) < 0)
         return -1;
     item->securityManager = nested;
+    item->prev = tmp;
     if (tmp)
         tmp->next = item;
     else