Skip to contentSkip to conversation

kvm tools: init: fix usage of hlist iterators

PATCH In review Will Deacon 1 participant 3 messages Mar 4, 2013 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 kvm tools: init: fix usage of hlist iterators

From: Marc Zyngier <[email protected]>

Commit b67bfe0d42ca ("hlist: drop the node parameter from iterators") incorrectly changed the way that hlist iterators are used.

This patch fixes util/init.c so it passes parameters to the new iterators in the right manner.

---
 tools/kvm/util/init.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
tools/kvm/util/init.c +2 -4
index 33a5952..d4ce144 100644
@@ -33,11 +33,10 @@ int init_list__init(struct kvm *kvm)
 {
 	unsigned int i;
 	int r = 0;
-	struct hlist_node *n;
 	struct init_item *t;
 
 	for (i = 0; i < ARRAY_SIZE(init_lists); i++)
-		hlist_for_each_entry(t, n, &init_lists[i], n) {
+		hlist_for_each_entry(t, &init_lists[i], n) {
 			r = t->init(kvm);
 			if (r < 0) {
 				pr_warning("Failed init: %s\n", t->fn_name);
@@ -53,11 +52,10 @@ int init_list__exit(struct kvm *kvm)
 {
 	int i;
 	int r = 0;
-	struct hlist_node *n;
 	struct init_item *t;
 
 	for (i = ARRAY_SIZE(exit_lists) - 1; i >= 0; i--)
-		hlist_for_each_entry(t, n, &exit_lists[i], n) {
+		hlist_for_each_entry(t, &exit_lists[i], n) {
 			r = t->init(kvm);
 			if (r < 0) {
 				pr_warning("%s failed.\n", t->fn_name);
Signature · 1 line
1.8.0
#1 lore raw

PATCH 2/2 kvm tools: 9p: fix compilation broken by new stat structures

From: Marc Zyngier <[email protected]>

Commit 447c50943fd0 ("9p: Modify the stat structures to use kuid_t and kgid_t") broke the 9p backend by introducing the k{u,g}id_t types, which aren't currently in scope.

Just fix the damn thing by including linux/uidgid.h.

---
 tools/kvm/virtio/9p-pdu.c | 1 +
 tools/kvm/virtio/9p.c     | 1 +
 2 files changed, 2 insertions(+)
tools/kvm/virtio/9p-pdu.c +1 -0
index b9ce8ce..9e95f3b 100644
@@ -5,6 +5,7 @@
 #include <stdint.h>
 
 #include <linux/compiler.h>
+#include <linux/uidgid.h>
 #include <net/9p/9p.h>
 
 static void virtio_p9_pdu_read(struct p9_pdu *pdu, void *data, size_t size)
tools/kvm/virtio/9p.c +1 -0
index 60865dd..b7a5723 100644
@@ -18,6 +18,7 @@
 
 #include <linux/virtio_ring.h>
 #include <linux/virtio_9p.h>
+#include <linux/uidgid.h>
 #include <net/9p/9p.h>
 
 static LIST_HEAD(devs);
Signature · 1 line
1.8.0
#2 lore raw
In reply to Will Deacon

Hi Pekka,

Quoted 7 lines · Will Deacon

From: Marc Zyngier <[email protected]>

Commit b67bfe0d42ca ("hlist: drop the node parameter from iterators") incorrectly changed the way that hlist iterators are used.

This patch fixes util/init.c so it passes parameters to the new iterators in the right manner.

Actually, the offending commit was only introduced during the recent merge window, so it's best to avoid this patch until you update kvmtool to a 3.9-based kernel tree (which will pull in the kernel-side ARM kvm bits too).

I just saw Sasha as the author and assumed it was a kvmtool regression :)

Cheers,

Will