qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [Qemu-discuss] Qemu snapshot mode
       [not found] ` <CAOZVR5aF39dqUufB3v5+pnWVeOTXzmLcdaT4KPu0w6gMYXk9CQ@mail.gmail.com>
@ 2012-09-24  1:18   ` xuanmao_001
  2012-09-24  2:25     ` Dunrong Huang
  0 siblings, 1 reply; 2+ messages in thread
From: xuanmao_001 @ 2012-09-24  1:18 UTC (permalink / raw)
  To: Dunrong Huang; +Cc: qemu-devel, qemu-discuss

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

Hi, all
I want to change the path of temporary snapshot file. Can you gei me some ideas, or tell me which file will write the  temporary snapshot file in qemu source code. thanks.




xuanmao_001

From: Dunrong Huang
Date: 2012-09-06 18:00
To: xuanmao_001
CC: qemu-discuss; Jakob Bohm
Subject: Re: [Qemu-discuss] Qemu snapshot mode
2012/9/6 xuanmao_001 <xuanmao_001@163.com>:
> Hi, all,
> When I start VM with snapshot mode(--snapshot). I do some operations,like
> copy, delete files. I must shutdown VM, the disk state can revert.
> so I want to know if the snapshot mode can revert when I reboot VM.
>
No, it cant.
Actually, when you start QEMU with -snapshot, a temporary snapshot file
which is not visible to the user will be created in /tmp, the file
will exist util QEMU exit.
So even if you reboot VM, QEMU is still running and the temporary
snapshot also exists.
This make you failed to convert VM after reboot.
> Thanks.
> ________________________________
> xuanmao_001



-- 
Best Regards,

Dunrong Huang

[-- Attachment #2: Type: text/html, Size: 3301 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [Qemu-discuss] Qemu snapshot mode
  2012-09-24  1:18   ` [Qemu-devel] [Qemu-discuss] Qemu snapshot mode xuanmao_001
@ 2012-09-24  2:25     ` Dunrong Huang
  0 siblings, 0 replies; 2+ messages in thread
From: Dunrong Huang @ 2012-09-24  2:25 UTC (permalink / raw)
  To: xuanmao_001; +Cc: qemu-devel, qemu-discuss

2012/9/24 xuanmao_001 <xuanmao_001@163.com>:
> Hi, all
> I want to change the path of temporary snapshot file. Can you gei me some
> ideas, or tell me which file will write the  temporary snapshot file in qemu
> source code. thanks.
Hi,
You should take a quick look at block.c:get_tmp_filename(),
int get_tmp_filename(char *filename, int size)
{
// snippet
    int fd;
    const char *tmpdir;
    tmpdir = getenv("TMPDIR");
    if (!tmpdir)
        tmpdir = "/tmp";
    if (snprintf(filename, size, "%s/vl.XXXXXX", tmpdir) >= size) {
        return -EOVERFLOW;
    }
    fd = mkstemp(filename);
    if (fd < 0 || close(fd)) {
        return -errno;
    }
    return 0;
}
So you can simply set a "TMPDIR=/var/whatyouwant" and run QEMU.
>
> ________________________________
> xuanmao_001
>
> From: Dunrong Huang
> Date: 2012-09-06 18:00
> To: xuanmao_001
> CC: qemu-discuss; Jakob Bohm
> Subject: Re: [Qemu-discuss] Qemu snapshot mode
> 2012/9/6 xuanmao_001 <xuanmao_001@163.com>:
>> Hi, all,
>> When I start VM with snapshot mode(--snapshot). I do some operations,like
>> copy, delete files. I must shutdown VM, the disk state can revert.
>> so I want to know if the snapshot mode can revert when I reboot VM.
>>
> No, it cant.
> Actually, when you start QEMU with -snapshot, a temporary snapshot file
> which is not visible to the user will be created in /tmp, the file
> will exist util QEMU exit.
> So even if you reboot VM, QEMU is still running and the temporary
> snapshot also exists.
> This make you failed to convert VM after reboot.
>> Thanks.
>> ________________________________
>> xuanmao_001
>
>
>
> --
> Best Regards,
>
> Dunrong Huang



-- 
Best Regards,

Dunrong Huang

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-24  2:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2012090615314646799419@163.com>
     [not found] ` <CAOZVR5aF39dqUufB3v5+pnWVeOTXzmLcdaT4KPu0w6gMYXk9CQ@mail.gmail.com>
2012-09-24  1:18   ` [Qemu-devel] [Qemu-discuss] Qemu snapshot mode xuanmao_001
2012-09-24  2:25     ` Dunrong Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).