Skip to contentSkip to conversation

qemu-img: fix segment fault when the image format is qed

PATCH Applied [email protected] 3 participants 3 messages Feb 19, 2012 – Feb 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 qemu-img: fix segment fault when the image format is qed

From: Zhi Yong Wu <[email protected]>

[root@f15 qemu]# qemu-img info /home/zwu/work/misc/rh6.img
image: /home/zwu/work/misc/rh6.img
file format: qed
virtual size: 4.0G (4294967296 bytes)
disk size: 1.2G
cluster_size: 65536
Segmentation fault (core dumped)

Today when i were fixing another issue, i found this issue; After simple investigation, i found that the required clock vm_clock is not created for qemu tool.

---
 qemu-img.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
qemu-img.c +2 -0
index c4bcf41..8df3564 100644
@@ -1655,6 +1655,8 @@ int main(int argc, char **argv)
     cmdname = argv[1];
     argc--; argv++;
 
+    qemu_init_main_loop();
+
     /* find the command */
     for(cmd = img_cmds; cmd->name != NULL; cmd++) {
         if (!strcmp(cmdname, cmd->name)) {
Signature · 1 line
1.7.6
Reviewed-by on v1 1/2
#1 lore raw
Quoted 10 lines · On Sun, Feb 19, 2012 at 2:24 PM, <[email protected]> wrote:

From: Zhi Yong Wu <[email protected]>

[root@f15 qemu]# qemu-img info /home/zwu/work/misc/rh6.img
image: /home/zwu/work/misc/rh6.img
file format: qed
virtual size: 4.0G (4294967296 bytes)
disk size: 1.2G
cluster_size: 65536
Segmentation fault (core dumped)

Quoted 6 lines

Today when i were fixing another issue, i found this issue; After simple investigation, i found that the required clock vm_clock is not created for qemu tool.

---
 qemu-img.c |    2 ++

 1 files changed, 2 insertions(+), 0 deletions(-)

Please also see the "qed: replace vm_clock with rt_clock for qemu-tool compatibility" patch which I just sent. Using vm_clock is not possible in qemu-tool and leads to abort(3) when running qemu-io write commands.

Applied
#2 lore raw
In reply to [email protected]

Am 19.02.2012 15:24, schrieb [email protected]:

Quoted 10 lines

From: Zhi Yong Wu <[email protected]>

[root@f15 qemu]# qemu-img info /home/zwu/work/misc/rh6.img
image: /home/zwu/work/misc/rh6.img
file format: qed
virtual size: 4.0G (4294967296 bytes)
disk size: 1.2G
cluster_size: 65536
Segmentation fault (core dumped)

Quoted 3 lines

Today when i were fixing another issue, i found this issue; After simple investigation, i found that the required clock vm_clock is not created for qemu tool.

Thanks, applied both to the block branch.

Kevin