All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tomáš Golembiovský" <tgolembi@redhat.com>
To: Gandalf Corvotempesta <gandalf.corvotempesta@gmail.com>
Cc: "Richard W.M. Jones" <rjones@redhat.com>,
	libguestfs <libguestfs@redhat.com>,
	qemu-devel@nongnu.org, Qemu-block <qemu-block@nongnu.org>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [Libguestfs]  [qemu-img] support for XVA
Date: Thu, 16 Nov 2017 13:56:16 +0100	[thread overview]
Message-ID: <20171116135616.63dab444@fiorina> (raw)
In-Reply-To: <CAJH6TXiPuLu62-+o2+PrUGpstrks_5pLotFEe1bAOmsbn20otw@mail.gmail.com>

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

On Wed, 15 Nov 2017 21:41:20 +0100
Gandalf Corvotempesta <gandalf.corvotempesta@gmail.com> wrote:

> 2017-11-15 21:29 GMT+01:00 Richard W.M. Jones <rjones@redhat.com>:
> > Gandalf, is there an XVA file publically available (pref. not
> > too big) that we can look at?
> 
> I can try to provide one, but it's simple:
> 
> # tar tvf 20160630_124823_aa72_.xva.gz | head -n 50
> ---------- 0/0           42353 1970-01-01 01:00 ova.xml
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000000
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000000.checksum
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000001
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000001.checksum
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000003
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000003.checksum
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000004
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000004.checksum
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000005
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000005.checksum
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000006
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000006.checksum
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000007
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000007.checksum
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000009
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000009.checksum
> ---------- 0/0         1048576 1970-01-01 01:00 Ref:175/00000010
> ---------- 0/0              40 1970-01-01 01:00 Ref:175/00000010.checksum
> 
> 
> You can ignore the ova.xml and just use the "Ref:175" directory.
> Inside the XVA you'll fine one "Ref" directory for each virtual disk
> (ref number is different for each disk)
> Inside each Ref directory, you'll get tons of 1MB file, corrisponding
> to the RAW image.
> You have to merge these files in a single raw file with just an
> exception: numbers are not sequential.
> as you can see above, we have: 00000000, 00000001, 00000003
> 
> The 00000002 is missing, because it's totally blank. XenServer doesn't
> export any empty block, thus it will skip the corrisponding 1MB file.
> When building the raw image, you have to replace empty blocks with 1MB
> full of zeros.
> 
> This is (in addition to the tar extract) the most time-consuming part.
> Currently I'm rebuilding a 250GB image, with tons of files to be
> merge.
> If qemu-img can be patched to automatically convert this kind of
> format, I can save about 3 hours (30 minutes for extracting the
> tarball, and about 2 hours to merge 250-300GB image)
> 

Hi,

I like what Richard and Max came up with. Pretty nifty solutions.
While there's nothing wrong with them I decided to take my own shot at
it. Since the blocks in tar file are pieces of raw image there is no
conversion happening. All in all it's just moving bytes from one place
to another. That means there shouldn't be a need for any heavy
machinery, right? :)

Attached is a shell script that uses dd to do the byte-shuffling.
I'm pretty sure this could even be safely parallelized by running
multiple instances of dd at the same time (e.g. with xargs). But I did
not try that.


    Tomas

-- 
Tomáš Golembiovský <tgolembi@redhat.com>

[-- Attachment #2: xva2raw.sh --]
[-- Type: application/x-shellscript, Size: 816 bytes --]

  parent reply	other threads:[~2017-11-16 12:56 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 15:52 [Qemu-devel] [qemu-img] support for XVA Gandalf Corvotempesta
2017-11-15 17:33 ` Eric Blake
2017-11-15 17:44   ` Gandalf Corvotempesta
2017-11-15 19:59     ` Max Reitz
2017-11-15 20:06       ` Gandalf Corvotempesta
2017-11-15 20:07         ` Max Reitz
2017-11-15 20:24           ` [Qemu-devel] [Libguestfs] " Richard W.M. Jones
2017-11-15 20:27             ` Max Reitz
2017-11-15 20:29               ` Richard W.M. Jones
2017-11-15 20:41                 ` Gandalf Corvotempesta
2017-11-15 21:05                   ` Richard W.M. Jones
2017-11-15 21:15                     ` Richard W.M. Jones
2017-11-15 21:30                   ` Max Reitz
2017-11-15 21:42                     ` Gandalf Corvotempesta
2017-11-15 21:49                       ` Richard W.M. Jones
2017-11-15 21:50                       ` Gandalf Corvotempesta
2017-11-15 21:50                         ` Max Reitz
2017-11-15 22:28                         ` Max Reitz
2017-11-15 22:47                           ` Gandalf Corvotempesta
2017-11-15 22:55                           ` Max Reitz
2017-11-15 22:57                             ` Max Reitz
2017-11-16 10:08                             ` Gandalf Corvotempesta
2017-11-16 14:02                               ` Max Reitz
2017-11-20 21:48                                 ` Gandalf Corvotempesta
2017-11-15 21:51                     ` Richard W.M. Jones
2017-11-16 10:01                   ` Richard W.M. Jones
2017-11-16 10:07                     ` Gandalf Corvotempesta
2017-11-16 10:11                       ` Richard W.M. Jones
2017-11-16 12:56                   ` Tomáš Golembiovský [this message]
2017-11-16 13:07                     ` Tomáš Golembiovský
2017-11-16 13:08                     ` Richard W.M. Jones
2017-11-15 19:43 ` [Qemu-devel] " Richard W.M. Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171116135616.63dab444@fiorina \
    --to=tgolembi@redhat.com \
    --cc=gandalf.corvotempesta@gmail.com \
    --cc=libguestfs@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.