[PATCH kvmtool v2 1/9] qcow: Fix qcow1 exit fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Even though qcow1 doesn't use the refcount table, the cleanup path still
attempts to iterate over its LRU list. Initialize the list to avoid a
segfault on exit.

Reviewed-by: Andre Przywara <andre.przywara@xxxxxxx>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@xxxxxxx>
---
 disk/qcow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/disk/qcow.c b/disk/qcow.c
index 64cf9270a..bed70c65c 100644
--- a/disk/qcow.c
+++ b/disk/qcow.c
@@ -1437,6 +1437,7 @@ static struct disk_image *qcow1_probe(int fd, bool readonly)
 
 	l1t->root = (struct rb_root)RB_ROOT;
 	INIT_LIST_HEAD(&l1t->lru_list);
+	INIT_LIST_HEAD(&q->refcount_table.lru_list);
 
 	h = q->header = qcow1_read_header(fd);
 	if (!h)
-- 
2.21.0




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux