location of snapshots generated by savevm option

64 views
Skip to first unread message

Hossein Hadian Jazi

unread,
Jul 9, 2015, 9:52:52 AM7/9/15
to bitblaz...@googlegroups.com
I am using savevm and loadvm of TEMU. I want to use python to wrote some script to access the snapshot that was generated by savevm but I could not find it. 
Could you pleas help me where is the location of snapshots which was generated by savevm option?

Antonio Nappa

unread,
Jul 9, 2015, 9:58:07 AM7/9/15
to bitblaz...@googlegroups.com

Hi, the savevm will save the snapshot in the qcow disk file. It is not a standalone file.

Cheers
Antonio

On Jul 9, 2015 3:52 PM, "Hossein Hadian Jazi" <hadianjaz...@gmail.com> wrote:
I am using savevm and loadvm of TEMU. I want to use python to wrote some script to access the snapshot that was generated by savevm but I could not find it. 
Could you pleas help me where is the location of snapshots which was generated by savevm option?

--

---
You received this message because you are subscribed to the Google Groups "BitBlaze User Discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitblaze-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hossein Hadian Jazi

unread,
Jul 9, 2015, 10:02:03 AM7/9/15
to bitblaz...@googlegroups.com
Thanks for your reply. So could you help me how can I access that via python subprocess?

Antonio Nappa

unread,
Jul 9, 2015, 10:09:45 AM7/9/15
to bitblaz...@googlegroups.com

You can start qemu as a subprocess and use -loadvm as an option to load your snapshot then you can type commands to the emulator using the .stdin object of the process that you generate with subprocess.

Cheers

Heng Yin

unread,
Jul 9, 2015, 10:13:06 AM7/9/15
to bitblaz...@googlegroups.com
A VM snapshot includes memory, CPU state, and states of IO devices, which are all packaged and saved in the qcow2 image. If you are only interested in memory state, you could just save the memory by yourself and dump it to a file. For example, a monitor command called pmemsave can achieve this. 

Heng

Hossein Hadian Jazi

unread,
Jul 9, 2015, 10:15:29 AM7/9/15
to bitblaz...@googlegroups.com
I already do that but got the exception. I saved the vm after load_plugin. 
I should mention that without loadvm option everything work but when I add it got fatal error..
This is my python code:

# -*- coding: utf-8 -*-
from subprocess import Popen, PIPE, STDOUT

# pass initial command as list of individual args
p = Popen([r"/home/bitblaze/temu-1.0/tracecap/temu","-monitor","stdio","-m","1024", "-loadvm", "vmsnapshot", "/home/hossein/windowsxp.qcow"],stdout=PIPE, stdin=PIPE)
#p = Popen(["qemu-system-i386","-monitor","stdio","-m","512","­-netdev","user,id=mynet", "-­device", "rtl8139,netdev=mynet" ,"-loadvm", "decafvm", "/home/hossein/windowsxp.qcow"],stdout=PIPE, stdin=PIPE)
# store all the next arguments to pass
args = iter(["enable_emulation","tracebyname foo.exe /home/hossein/traceexample/foopython.trace","stop_emulation"])
# iterate over stdout so we can check where we are
for line in iter(p.stdout.readline,""):
    # if (qemu) is at the prompt, enter a command
    if line.startswith("(qemu)"):
        arg = next(args,"") 
        # if we have used all args break
        if not arg:
            break
        # else we write the arg with a newline
        p.stdin.write(arg+"\n")
    print(line)# just use to see the output

And this is the exception that I got:
qemu: warning: error while loading state for instance 0x0 of device 'ram'
qemu: warning: instance 0x0 of device 'funmap' not present in current VM
qemu: warning: instance 0x0 of device 'hookapi' not present in current VM
qemu: warning: instance 0x0 of device 'procmod' not present in current VM
qemu: warning: instance 0x0 of device 'taintcheck' not present in current VM
qemu: fatal: triple fault
EAX=00000000 EBX=015af758 ECX=015af99c EDX=015af78a
ESI=015af758 EDI=015af99c EBP=015af720 ESP=015af500
EIP=77f679fe EFL=00000202 [-------] CPL=3 II=0 A20=1 SMM=0 HLT=0
ES =0023 00000000 ffffffff 00cff300
CS =001b 00000000 ffffffff 00c0fb00
SS =0023 00000000 ffffffff 00c0f300
DS =0023 00000000 ffffffff 00cff300
FS =003b 7ffaf000 00000fff 7f40f3fa
GS =0000 00000000 00000000 00000000
LDT=0000 00000000 00000000 00008000
TR =0028 80042000 000020ab 00008900
GDT=     8003f000 000003ff
IDT=     8003f400 000007ff
CR0=e001003b CR2=8003f440 CR3=0b7f9000 CR4=00000698
CCS=00000000 CCD=00001ec0 CCO=EFLAGS  
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=8a885d0400000000 0048
FPR2=0000000277de612a 6148 FPR3=0000000000000000 6134
FPR4=0000000000000000 0000 FPR5=0000000800000000 0000
FPR6=a219166666666787 401d FPR7=a880000000000000 400a
XMM00=7db51942000002000007fa740007fa74 XMM01=00000002000000010007fa3800000000
XMM02=000000000007fb04000000000007fa2c XMM03=000000000007fac8000efc687c809668
XMM04=0007fad000000000000efc6800001001 XMM05=0007fb9c000ee4380235000000000000
XMM06=7c91009800000000000901787c910021 XMM07=000f27707c9100210000000000360178

It seems I got fatal error but I do not know why? Could you please help me what is the problem?
Reply all
Reply to author
Forward
0 new messages