[Qemu-devel] Difference between commit and rebase

2019-08-20 Thread lampahome
I want to remove snapshots and I found two ways: qemu-img commit qemu-img rebase I found they both can choose where to rebase(merge) the images. commit can truncate or not on specific image. rebase won't truncate rebased image. I found they have something similarity and I don't know what situatio

Re: [Qemu-devel] qemu-nbd performance

2018-09-25 Thread lampahome
I put image on the 3xSSD RAID0, and the raw performance of block device is read:1500MB/s, write:1400MB/s The bottleneck I thought is the number of backing files. The more images I divide into, lower the read performance Write performance looks like bad originally.

Re: [Qemu-devel] qemu-nbd performance

2018-09-18 Thread lampahome
> > All images are on the RAID0(3 SSD). >> Below is the performance: >> > image numberseq. read(MB/s)seq. write(MB/s) 11480 60 16 1453 36 32 1450 36 64

Re: [Qemu-devel] Different type of qcow2_get_cluster_type

2018-09-18 Thread lampahome
> > > Both values correspond to L2 entries with bit 0 set. However, > QCOW2_CLUSTER_ZERO_ALLOC is an entry that has a non-zero value in bits 9-55 > (the cluster has an allocated host location, we guarantee that things read > as zero regardless of whether the host data actually contains zeroes at >

[Qemu-devel] qemu-nbd performance

2018-09-18 Thread lampahome
I test nbd performance when I divide image into multiple backing files. The image is 512GB, I divide it into 1, 16, 32, 64, and 128 backing files. Ex: If I divide it into 16 files, each backing file is 512/16=32GB. If I divide it into 64 files, each backing file is 512/64=8GB and so on. *Mount c

[Qemu-devel] Cluster doesn't truncate after commit to backing file

2018-09-17 Thread lampahome
I have two image A and B, and A is the backing file of B I write data in address addr in A. Then create B and set A as backing file of B. Then I discard the same addr in B. So the entry of addr in l2 table should be 1( also is QCOW2_CLUSTER_ZERO_PLAIN) , right? But the addr cluster in A will fil

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-16 Thread lampahome
> > > *(That's what I said range is different)* >> Ex: 1st chunk of device will save into image.000 >> 2nd chunk of device will save into image.001 >> Nth chunk of device will save into image.(N-1) >> ...etc >> >> I can see all block device data when I mount image.(N-1) by qemu-nbd cuz >> the chunk

[Qemu-devel] Different type of qcow2_get_cluster_type

2018-09-14 Thread lampahome
The function qcow2_get_cluster_type() is in /block/qcow2.h It will return the flage based on the entry. There're some flags confused me. What's difference between QCOW2_CLUSTER_ZERO_ALLOC & QCOW2_CLUSTER_ZERO_PLAIN in there?

Re: [Qemu-devel] Can I convert backing file to internal snapshot?

2018-09-13 Thread lampahome
Can I convert from internap snapshot to external snapshot? If there's 3 snapshots in one qcow2, can I convert them all to external snapshots?

Re: [Qemu-devel] What kind of situation to use internal or external snapshot?

2018-09-13 Thread lampahome
In general case, what's difference between internal and external snapshot? I mean in some user situation. Ex: If I want to all snapshots in only one qcow2, I should use internal snapshot. thx

Re: [Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-13 Thread lampahome
Sorry, I need to explain what case I want to do Todo: I want to *backup a block device into qcow2 format image.* I met a problem which is the *file size limit of filesystem* ex: Max is 16TB for any file in ext4, but the block device maybe 32TB or more. I figure out one way is to *divide data of d

[Qemu-devel] Can I only commit from active image to corresponding range of its backing file by qemu cmd?

2018-09-12 Thread lampahome
I split data to 3 chunks and save it in 3 independent backing files like below: img.000 <-- img.001 <-- img.002 img.000 is the backing file of img.001 and 001 is the backing file of 002. img.000 saves the 1st chunk of data and img.001 saves the 2nd chunk of data, and img.002 saves the 3rd chunk of

Re: [Qemu-devel] What kind of situation to use internal or external snapshot?

2018-09-12 Thread lampahome
> > In general, we've spent more resources developing external snapshots. So > if you want the most support and the fastest response on resolving any > issues that you may encounter, external snapshots are the way to go. > > So internal snapshot is hard to use than external snapshot? Is that becaus

[Qemu-devel] Can I convert backing file to internal snapshot?

2018-09-12 Thread lampahome
I have two qcow2 A & B, and A is backing file of B. Can I convert both A&B to one image and containing data of both? ex: one new image will contain data of A and B. When I check it by qemu-img info, I can see one snapshot in the new image. thanks

[Qemu-devel] What kind of situation to use internal or external snapshot?

2018-09-11 Thread lampahome
as title, I know there're two snapshots in qemu, but I don't know when to use them well. What I know is internal snapshot will save the info of L1 and L2 table in the end of image but external snapshot won't because external snapshot create new file to save cow data. So when to use internal snaps

[Qemu-devel] What does VM SIZE means when entering qemu-img info xx.qcow2

2018-08-21 Thread lampahome
I have an qcow2 image and I mount it to /dev/nbd then write somethin. Then I take internal snapshot in the qcow2. I enter the command qemu-img info qcow2 It shows: image: qcow2 file format: qcow2 virtual size: 30G disk size:4M x Snapshot list: ID, TAG, VM SIZE, DATE, VM CLOCK 1, snap1, 0, xxx

Re: [Qemu-devel] How do you do when write more than 16TB data to qcow2 on ext4?

2018-08-17 Thread lampahome
Really? How to mount a blk device to /dev/nbdN? I always find tips to mount from file-like image to /dev/nbdN 2018-08-16 19:46 GMT+08:00 Eric Blake : > On 08/16/2018 03:22 AM, Daniel P. Berrangé wrote: > >> On Thu, Aug 16, 2018 at 09:35:52AM +0800, lampahome wrote: >> >>

[Qemu-devel] How do you do when write more than 16TB data to qcow2 on ext4?

2018-08-15 Thread lampahome
We all know there's a file size limit 16TB in ext4 and other fs has their limit,too. If I create an qcow2 20TB on ext4 and write to it more than 16TB. Data more than 16TB can't be written to qcow2. So, is there any better ways to solve this situation? What I thought is to create new qcow2 called

[Qemu-devel] How to discard one range which overlap with backing file and its children img?

2018-08-07 Thread lampahome
I have image A & B, and A is backing file of B. After I mount A to /dev/nbd0 and I write from position 0~999 in nbd0. Then create B and set A as backing file of B. I mount B on /dev/nbd1 and I can saw the data from pos:0~999 because A is B's backing file. That's reasonable. But I want to disca

[Qemu-devel] Can I create img more thant 16TB?

2018-08-02 Thread lampahome
There's file size maximum in ext4 and it's 16TB Can I create qcow2 ex:32TB and write more than 16TB? thx

Re: [Qemu-devel] Any tutorial to read/write in qcow2 format by programming way?

2018-08-01 Thread lampahome
I have some questions about qcow2 If I have 2 img A & B, and A is backing file of B. Is the format(such as L1, L2, ref block...etc) different from A and B? > No real tutorial other than reading the code and the file format > specification (it's open source, after all). See: > block/qcow2* > doc

[Qemu-devel] Any tutorial to read/write in qcow2 format by programming way?

2018-07-31 Thread lampahome
As titled I learn some info about qcow2 and tried to write some data and make it qualified for qcow2 format. I do it and mount through qemu-nbd successfully. But I don't know how taking snapshot and backing file works in programming way. Can someone tell me some tutorial to know or code snippet

[Qemu-devel] why marking qcow2 img as corrupted

2017-07-26 Thread lampahome
I tried take snapshots on a demo.qcow2 10 times. cmd is below: > qemu-img snapshots -c tag_1 demo.qcow2 when I take snapshots 7 times and console shows: > mark image as corrupted and preventing from invalid write and I can't take snapshots anymore then. Can I avoid this situation or remove th

Re: [Qemu-devel] Can I mount encrypt qcow2?

2017-07-24 Thread lampahome
I thought 2.9.0 is the latest and check to the wrong commit. Now it supports encryption. My cmd is: > qemu-nbd --object secret,id=sec0,file=passwd.txt,format=raw \ > --image-opts > driver=qcow2,file.filename=demo.qcow2,encrypt.format=luks,encrypt.key-secret=sec0 But it shows error m