Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-28 Thread Stefan Hajnoczi
On Wed, Feb 22, 2017 at 06:15:47PM +0200, Maor Lipchuk wrote: > Hi all, > > Thank you very much for your help, it was much helpful > We adopted John Snow advice and implemented our own calculation so we > can resolve the issue now, > We plan to drop this code once we can get this estimation from q

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-22 Thread Maor Lipchuk
Hi, I added a few clarifications inline. The relevant calculation is: header_size + l2_tables_size + refcounts_tables_size + data_size and it is also described inline. I will be happy if you can confirm this calculation is acceptable Thanks, Maor On Wed, Feb 22, 2017 at 6:15 PM, Maor Lipch

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-22 Thread Maor Lipchuk
Hi all, Thank you very much for your help, it was much helpful We adopted John Snow advice and implemented our own calculation so we can resolve the issue now, We plan to drop this code once we can get this estimation from qemu-img. This is the link to the patch introducing the calculation: https

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-20 Thread Stefan Hajnoczi
On Wed, Feb 15, 2017 at 04:07:43PM +, Daniel P. Berrange wrote: > On Wed, Feb 15, 2017 at 05:57:12PM +0200, Nir Soffer wrote: > > On Wed, Feb 15, 2017 at 5:20 PM, Daniel P. Berrange > > wrote: > > > On Wed, Feb 15, 2017 at 03:14:19PM +, Stefan Hajnoczi wrote: > > >> On Mon, Feb 13, 2017 a

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-20 Thread Stefan Hajnoczi
On Wed, Feb 15, 2017 at 05:49:58PM +0200, Nir Soffer wrote: > On Wed, Feb 15, 2017 at 5:14 PM, Stefan Hajnoczi wrote: > > On Mon, Feb 13, 2017 at 05:46:19PM +0200, Maor Lipchuk wrote: > >> I was wondering if that is possible to provide a new API that > >> estimates the size of > >> qcow2 image con

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-15 Thread Eric Blake
On 02/15/2017 09:20 AM, Daniel P. Berrange wrote: >> Let's try this syntax: >> >> $ qemu-img query-max-size -f raw -O qcow2 input.raw >> 1234678000 >> >> As John explained, it is only an estimate. But it will be a >> conservative maximum. > > This forces you to have an input file. It would be

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-15 Thread Daniel P. Berrange
On Wed, Feb 15, 2017 at 05:05:04PM +0100, Alberto Garcia wrote: > On Wed 15 Feb 2017 04:57:12 PM CET, Nir Soffer wrote: > >>> Let's try this syntax: > >>> > >>> $ qemu-img query-max-size -f raw -O qcow2 input.raw > >>> 1234678000 > >>> > >>> As John explained, it is only an estimate. But it wi

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-15 Thread Daniel P. Berrange
On Wed, Feb 15, 2017 at 05:57:12PM +0200, Nir Soffer wrote: > On Wed, Feb 15, 2017 at 5:20 PM, Daniel P. Berrange > wrote: > > On Wed, Feb 15, 2017 at 03:14:19PM +, Stefan Hajnoczi wrote: > >> On Mon, Feb 13, 2017 at 05:46:19PM +0200, Maor Lipchuk wrote: > >> > I was wondering if that is poss

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-15 Thread Alberto Garcia
On Wed 15 Feb 2017 04:57:12 PM CET, Nir Soffer wrote: >>> Let's try this syntax: >>> >>> $ qemu-img query-max-size -f raw -O qcow2 input.raw >>> 1234678000 >>> >>> As John explained, it is only an estimate. But it will be a >>> conservative maximum. >> >> This forces you to have an input file.

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-15 Thread Nir Soffer
On Wed, Feb 15, 2017 at 5:20 PM, Daniel P. Berrange wrote: > On Wed, Feb 15, 2017 at 03:14:19PM +, Stefan Hajnoczi wrote: >> On Mon, Feb 13, 2017 at 05:46:19PM +0200, Maor Lipchuk wrote: >> > I was wondering if that is possible to provide a new API that >> > estimates the size of >> > qcow2 im

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-15 Thread Nir Soffer
On Wed, Feb 15, 2017 at 5:14 PM, Stefan Hajnoczi wrote: > On Mon, Feb 13, 2017 at 05:46:19PM +0200, Maor Lipchuk wrote: >> I was wondering if that is possible to provide a new API that >> estimates the size of >> qcow2 image converted from a raw image. We could use this new API to >> allocate the

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-15 Thread Daniel P. Berrange
On Wed, Feb 15, 2017 at 03:14:19PM +, Stefan Hajnoczi wrote: > On Mon, Feb 13, 2017 at 05:46:19PM +0200, Maor Lipchuk wrote: > > I was wondering if that is possible to provide a new API that > > estimates the size of > > qcow2 image converted from a raw image. We could use this new API to > > a

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-15 Thread Stefan Hajnoczi
On Mon, Feb 13, 2017 at 05:46:19PM +0200, Maor Lipchuk wrote: > I was wondering if that is possible to provide a new API that > estimates the size of > qcow2 image converted from a raw image. We could use this new API to > allocate the > size more precisely before the convert operation. > [...] >

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-13 Thread John Snow
On 02/13/2017 12:16 PM, Daniel P. Berrange wrote: > On Mon, Feb 13, 2017 at 12:03:35PM -0500, John Snow wrote: >> Also keep in mind that changing the cluster size will give you different >> answers, too -- but that different cluster sizes will effect the runtime >> performance of the image as wel

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-13 Thread Daniel P. Berrange
On Mon, Feb 13, 2017 at 12:03:35PM -0500, John Snow wrote: > Also keep in mind that changing the cluster size will give you different > answers, too -- but that different cluster sizes will effect the runtime > performance of the image as well. This means that apps trying to figure out this future

Re: [Qemu-discuss] [Qemu-devel] Estimation of qcow2 image size converted from raw image

2017-02-13 Thread John Snow
CCing qemu-block; On 02/13/2017 10:46 AM, Maor Lipchuk wrote: > Hi all, > > I was wondering if that is possible to provide a new API that > estimates the size of > qcow2 image converted from a raw image. We could use this new API to > allocate the > size more precisely before the convert operatio