On Mon, Nov 25, 2019, 11:15 Richard W.M. Jones <rjones@redhat.com> wrote:> On Wed, Nov 20, 2019 at 03:06:55AM +0200, Nir Soffer wrote: > > diff --git a/v2v/v2v.ml b/v2v/v2v.ml > > index 03590c9e..58bb06c3 100644 > > --- a/v2v/v2v.ml > > +++ b/v2v/v2v.ml > > @@ -739,7 +739,9 @@ and copy_targets cmdline targets input output > > | TargetURI uri -> uri in > > [ "qemu-img"; "convert" ] @ > > (if not (quiet ()) then [ "-p" ] else []) @ > > - [ "-n"; "-f"; "qcow2"; "-O"; t.target_format ] @ > > + (* XXX When using NBD we must use raw format, not the > target_format > > + * which is the disk format. commpressed format will also not > work. *) > > + [ "-n"; "-f"; "qcow2"; "-O"; "raw" ] @ > > This is going to break all the other output modes. > > You probably want to define a new method output#override_output_format > (see v2v.ml:get_target_formats and types.mli). >Maybe outpu#tranfer_format? Return output_format by default, rhv_output will override it to return raw?> Rich. > > -- > Richard Jones, Virtualization Group, Red Hat > http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > Fedora Windows cross-compiler. Compile Windows programs, test, and > build Windows installers. Over 100 libraries supported. > http://fedoraproject.org/wiki/MinGW > >
Richard W.M. Jones
2019-Nov-25 14:31 UTC
Re: [Libguestfs] [PATCH] rhv-upload: Support qcow2 disks
On Mon, Nov 25, 2019 at 04:27:11PM +0200, Nir Soffer wrote:> On Mon, Nov 25, 2019, 11:15 Richard W.M. Jones <rjones@redhat.com> wrote: > > > On Wed, Nov 20, 2019 at 03:06:55AM +0200, Nir Soffer wrote: > > > diff --git a/v2v/v2v.ml b/v2v/v2v.ml > > > index 03590c9e..58bb06c3 100644 > > > --- a/v2v/v2v.ml > > > +++ b/v2v/v2v.ml > > > @@ -739,7 +739,9 @@ and copy_targets cmdline targets input output > > > | TargetURI uri -> uri in > > > [ "qemu-img"; "convert" ] @ > > > (if not (quiet ()) then [ "-p" ] else []) @ > > > - [ "-n"; "-f"; "qcow2"; "-O"; t.target_format ] @ > > > + (* XXX When using NBD we must use raw format, not the > > target_format > > > + * which is the disk format. commpressed format will also not > > work. *) > > > + [ "-n"; "-f"; "qcow2"; "-O"; "raw" ] @ > > > > This is going to break all the other output modes. > > > > You probably want to define a new method output#override_output_format > > (see v2v.ml:get_target_formats and types.mli). > > > > Maybe outpu#tranfer_format? > Return output_format by default, rhv_output will override it to return raw?Isn't that essentially what #override_output_format virtual method does already? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On Mon, Nov 25, 2019, 16:37 Richard W.M. Jones <rjones@redhat.com> wrote:> On Mon, Nov 25, 2019 at 04:27:11PM +0200, Nir Soffer wrote: > > On Mon, Nov 25, 2019, 11:15 Richard W.M. Jones <rjones@redhat.com> > wrote: > > > > > On Wed, Nov 20, 2019 at 03:06:55AM +0200, Nir Soffer wrote: > > > > diff --git a/v2v/v2v.ml b/v2v/v2v.ml > > > > index 03590c9e..58bb06c3 100644 > > > > --- a/v2v/v2v.ml > > > > +++ b/v2v/v2v.ml > > > > @@ -739,7 +739,9 @@ and copy_targets cmdline targets input output > > > > | TargetURI uri -> uri in > > > > [ "qemu-img"; "convert" ] @ > > > > (if not (quiet ()) then [ "-p" ] else []) @ > > > > - [ "-n"; "-f"; "qcow2"; "-O"; t.target_format ] @ > > > > + (* XXX When using NBD we must use raw format, not the > > > target_format > > > > + * which is the disk format. commpressed format will also not > > > work. *) > > > > + [ "-n"; "-f"; "qcow2"; "-O"; "raw" ] @ > > > > > > This is going to break all the other output modes. > > > > > > You probably want to define a new method output#override_output_format > > > (see v2v.ml:get_target_formats and types.mli). > > > > > > > Maybe outpu#tranfer_format? > > Return output_format by default, rhv_output will override it to return > raw? > > Isn't that essentially what #override_output_format virtual method > does already? >The name confused me, I will check this then.> Rich. > > -- > Richard Jones, Virtualization Group, Red Hat > http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > virt-top is 'top' for virtual machines. Tiny program with many > powerful monitoring features, net stats, disk stats, logging, etc. > http://people.redhat.com/~rjones/virt-top > >
On Mon, Nov 25, 2019 at 4:37 PM Richard W.M. Jones <rjones@redhat.com> wrote:> > On Mon, Nov 25, 2019 at 04:27:11PM +0200, Nir Soffer wrote: > > On Mon, Nov 25, 2019, 11:15 Richard W.M. Jones <rjones@redhat.com> wrote: > > > > > On Wed, Nov 20, 2019 at 03:06:55AM +0200, Nir Soffer wrote: > > > > diff --git a/v2v/v2v.ml b/v2v/v2v.ml > > > > index 03590c9e..58bb06c3 100644 > > > > --- a/v2v/v2v.ml > > > > +++ b/v2v/v2v.ml > > > > @@ -739,7 +739,9 @@ and copy_targets cmdline targets input output > > > > | TargetURI uri -> uri in > > > > [ "qemu-img"; "convert" ] @ > > > > (if not (quiet ()) then [ "-p" ] else []) @ > > > > - [ "-n"; "-f"; "qcow2"; "-O"; t.target_format ] @ > > > > + (* XXX When using NBD we must use raw format, not the > > > target_format > > > > + * which is the disk format. commpressed format will also not > > > work. *) > > > > + [ "-n"; "-f"; "qcow2"; "-O"; "raw" ] @ > > > > > > This is going to break all the other output modes. > > > > > > You probably want to define a new method output#override_output_format > > > (see v2v.ml:get_target_formats and types.mli). > > > > > > > Maybe outpu#tranfer_format? > > Return output_format by default, rhv_output will override it to return raw? > > Isn't that essentially what #override_output_format virtual method > does already?No, it overrides target format (as I thought). If you implement: (* Force raw output, ignoring -of command line option. *) method override_output_format _ = Some "raw" And you run: vit-v2v -of qcow2 ... It creates the command: qemu-img convert -O raw ... But the rhv-upload-plugin gets these params: using params: {'disk_format': 'raw', ... And then we create a raw disk on oVirt side. What we need is to create qcow2 disk, and use -O raw. If this was written in python, I can think of this interface: class Output: def transfer_format(self): return self.target_format Outputs that want to always use raw format would implement: class OutputRHVUpload: def transfer_format(self): return "raw" So the v2v command line will be: ... [ "-n"; "-f"; "qcow2"; "-O"; t.transfer_format ] @ ... Nir
Maybe Matching Threads
- Re: [PATCH] rhv-upload: Support qcow2 disks
- [PATCH] rhv-upload: Support qcow2 disks
- Re: [PATCH] rhv-upload: Support qcow2 disks
- [PATCH] v2v: Allow output modes to rewrite disk copying
- [v2v PATCH 1/2] Add back guestcaps as parameter of output#prepare_targets