Re: [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

Re: [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

Re: [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:

Re: [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: > > >>

Re: [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

Re: [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

Re: [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

Re: [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

Re: [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

Re: [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

Re: [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

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

2017-02-13 Thread Maor Lipchuk
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 operation. What are we trying to do: - Convert raw sparse image from NFS or from