Tomáš Golembiovský
2016-Sep-30 10:55 UTC
Re: [Libguestfs] [PATCH 1/2] v2v: ova: fix checking of the manifest file
On Thu, 29 Sep 2016 15:53:18 +0200 Pino Toscano <ptoscano@redhat.com> wrote:> On Thursday, 29 September 2016 14:59:14 CEST Tomáš Golembiovský wrote: > > The regular expression for parsing the manifest line was wrong. There is > > a mandatory space between '=' and the hash. > > > > Another problem was that only the first line of the manifest file was > > actually processed. > > Can you please provide an example of manifest file with more than one > line? A real-life example, I mean. >Sure, this is from OVA created by VMware: $ cat 2003-32b.mf SHA1(2003-32b.ovf)= 7c8e2cfebb540c4fa86df8413604408359b35cd9 SHA1(2003-32b-disk1.vmdk)= fef670f077ba7df83d35d8849f666d399f355bb5 If there are multiple disks in the VM there will be one line for each disk. Tomas -- Tomáš Golembiovský <tgolembi@redhat.com>
Richard W.M. Jones
2016-Oct-03 08:11 UTC
Re: [Libguestfs] [PATCH 1/2] v2v: ova: fix checking of the manifest file
On Fri, Sep 30, 2016 at 12:55:05PM +0200, Tomáš Golembiovský wrote:> > On Thu, 29 Sep 2016 15:53:18 +0200 > Pino Toscano <ptoscano@redhat.com> wrote: > > > On Thursday, 29 September 2016 14:59:14 CEST Tomáš Golembiovský wrote: > > > The regular expression for parsing the manifest line was wrong. There is > > > a mandatory space between '=' and the hash. > > > > > > Another problem was that only the first line of the manifest file was > > > actually processed. > > > > Can you please provide an example of manifest file with more than one > > line? A real-life example, I mean. > > > > Sure, this is from OVA created by VMware: > > $ cat 2003-32b.mf > SHA1(2003-32b.ovf)= 7c8e2cfebb540c4fa86df8413604408359b35cd9 > SHA1(2003-32b-disk1.vmdk)= fef670f077ba7df83d35d8849f666d399f355bb5 > > > If there are multiple disks in the VM there will be one line for each > disk.This is correct, but ... This code works currently. How? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Pino Toscano
2016-Oct-03 08:16 UTC
Re: [Libguestfs] [PATCH 1/2] v2v: ova: fix checking of the manifest file
On Monday, 3 October 2016 09:11:23 CEST Richard W.M. Jones wrote:> On Fri, Sep 30, 2016 at 12:55:05PM +0200, Tomáš Golembiovský wrote: > > > > On Thu, 29 Sep 2016 15:53:18 +0200 > > Pino Toscano <ptoscano@redhat.com> wrote: > > > > > On Thursday, 29 September 2016 14:59:14 CEST Tomáš Golembiovský wrote: > > > > The regular expression for parsing the manifest line was wrong. There is > > > > a mandatory space between '=' and the hash. > > > > > > > > Another problem was that only the first line of the manifest file was > > > > actually processed. > > > > > > Can you please provide an example of manifest file with more than one > > > line? A real-life example, I mean. > > > > > > > Sure, this is from OVA created by VMware: > > > > $ cat 2003-32b.mf > > SHA1(2003-32b.ovf)= 7c8e2cfebb540c4fa86df8413604408359b35cd9 > > SHA1(2003-32b-disk1.vmdk)= fef670f077ba7df83d35d8849f666d399f355bb5 > > > > > > If there are multiple disks in the VM there will be one line for each > > disk. > > This is correct, but ... > > This code works currently. How?Simple: the regex does not match any line, so no checksum verification is actually performed. That's why Tomáš added a warning message, so it is easier to spot when finding lines not matching the regex. (Most probably the loop () function should ignore empty lines, though.) -- Pino Toscano
Maybe Matching Threads
- Re: [PATCH 1/2] v2v: ova: fix checking of the manifest file
- [PATCH 1/2] v2v: ova: fix checking of the manifest file
- Re: [PATCH v2 5/5] v2v: update tests to match changes in OVA import
- Re: [PATCH v2 5/5] v2v: update tests to match changes in OVA import
- Re: [PATCH v2 5/5] v2v: update tests to match changes in OVA import