[PATCH 0/1] Fix OVA import with libvirt backend
I've sent a patch to libvirt that should fix our problem with 'raw' driver that is mentioned in [1]. The libvirt patch is here [2]. However, to realy fix things, there is at least one thing we have to change on our side. We have to be explicit about the driver in the JSON we generate. Note that the libvirt patch has not yet been reviewed nor merged, so this may not be the only thing that we'll have to change. [1] https://www.redhat.com/archives/libguestfs/2017-February/msg00101.html [2] https://www.redhat.com/archives/libvir-list/2017-February/msg00575.html Tomáš Golembiovský (1): v2v: ova: fix generated JSON for libvirt support v2v/input_ova.ml | 1 + v2v/test-v2v-i-ova-subfolders.expected2 | 2 +- v2v/test-v2v-i-ova-tar.expected2 | 2 +- v2v/test-v2v-i-ova-two-disks.expected2 | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) -- 2.11.1
We have to be explicit about the drivers in backing file JSON in order for libvirt to work. Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> --- v2v/input_ova.ml | 1 + v2v/test-v2v-i-ova-subfolders.expected2 | 2 +- v2v/test-v2v-i-ova-tar.expected2 | 2 +- v2v/test-v2v-i-ova-two-disks.expected2 | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index 411e90118..d5e3e64c4 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -374,6 +374,7 @@ object "offset", JSON.Int64 offset; "size", JSON.Int64 size; "file", JSON.Dict [ + "driver", JSON.String "file"; "filename", JSON.String ova] ] ] in diff --git a/v2v/test-v2v-i-ova-subfolders.expected2 b/v2v/test-v2v-i-ova-subfolders.expected2 index ef2993ed6..5029760c9 100644 --- a/v2v/test-v2v-i-ova-subfolders.expected2 +++ b/v2v/test-v2v-i-ova-subfolders.expected2 @@ -10,7 +10,7 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs: diff --git a/v2v/test-v2v-i-ova-tar.expected2 b/v2v/test-v2v-i-ova-tar.expected2 index 200e32a70..a97a7149c 100644 --- a/v2v/test-v2v-i-ova-tar.expected2 +++ b/v2v/test-v2v-i-ova-tar.expected2 @@ -10,7 +10,7 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test-tar.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test-tar.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs: diff --git a/v2v/test-v2v-i-ova-two-disks.expected2 b/v2v/test-v2v-i-ova-two-disks.expected2 index cf4cea50b..621ace84b 100644 --- a/v2v/test-v2v-i-ova-two-disks.expected2 +++ b/v2v/test-v2v-i-ova-two-disks.expected2 @@ -10,8 +10,8 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test.ova" } } } (vmdk) [scsi] - json:{ "file": { "driver": "raw", "offset": x, "size": 102400, "file": { "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 102400, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs: -- 2.11.1
On Tue, Feb 14, 2017 at 01:26:40AM +0100, Tomáš Golembiovský wrote:
We have to be explicit about the drivers in backing file JSON in order for libvirt to work.
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> --- v2v/input_ova.ml | 1 + v2v/test-v2v-i-ova-subfolders.expected2 | 2 +- v2v/test-v2v-i-ova-tar.expected2 | 2 +- v2v/test-v2v-i-ova-two-disks.expected2 | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index 411e90118..d5e3e64c4 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -374,6 +374,7 @@ object "offset", JSON.Int64 offset; "size", JSON.Int64 size; "file", JSON.Dict [ + "driver", JSON.String "file"; "filename", JSON.String ova] ] ] in diff --git a/v2v/test-v2v-i-ova-subfolders.expected2 b/v2v/test-v2v-i-ova-subfolders.expected2 index ef2993ed6..5029760c9 100644 --- a/v2v/test-v2v-i-ova-subfolders.expected2 +++ b/v2v/test-v2v-i-ova-subfolders.expected2 @@ -10,7 +10,7 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs: diff --git a/v2v/test-v2v-i-ova-tar.expected2 b/v2v/test-v2v-i-ova-tar.expected2 index 200e32a70..a97a7149c 100644 --- a/v2v/test-v2v-i-ova-tar.expected2 +++ b/v2v/test-v2v-i-ova-tar.expected2 @@ -10,7 +10,7 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test-tar.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test-tar.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs: diff --git a/v2v/test-v2v-i-ova-two-disks.expected2 b/v2v/test-v2v-i-ova-two-disks.expected2 index cf4cea50b..621ace84b 100644 --- a/v2v/test-v2v-i-ova-two-disks.expected2 +++ b/v2v/test-v2v-i-ova-two-disks.expected2 @@ -10,8 +10,8 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test.ova" } } } (vmdk) [scsi] - json:{ "file": { "driver": "raw", "offset": x, "size": 102400, "file": { "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 102400, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs:
Seems reasonable. I guess we need to revert commit f73ac1fc9c21d70e33824e61cf091533afb57273 too? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
On Tue, 14 Feb 2017 16:00:41 +0000 "Richard W.M. Jones" <rjones@redhat.com> wrote:
On Tue, Feb 14, 2017 at 01:26:40AM +0100, Tomáš Golembiovský wrote:
We have to be explicit about the drivers in backing file JSON in order for libvirt to work.
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> --- v2v/input_ova.ml | 1 + v2v/test-v2v-i-ova-subfolders.expected2 | 2 +- v2v/test-v2v-i-ova-tar.expected2 | 2 +- v2v/test-v2v-i-ova-two-disks.expected2 | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index 411e90118..d5e3e64c4 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -374,6 +374,7 @@ object "offset", JSON.Int64 offset; "size", JSON.Int64 size; "file", JSON.Dict [ + "driver", JSON.String "file"; "filename", JSON.String ova] ] ] in diff --git a/v2v/test-v2v-i-ova-subfolders.expected2 b/v2v/test-v2v-i-ova-subfolders.expected2 index ef2993ed6..5029760c9 100644 --- a/v2v/test-v2v-i-ova-subfolders.expected2 +++ b/v2v/test-v2v-i-ova-subfolders.expected2 @@ -10,7 +10,7 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs: diff --git a/v2v/test-v2v-i-ova-tar.expected2 b/v2v/test-v2v-i-ova-tar.expected2 index 200e32a70..a97a7149c 100644 --- a/v2v/test-v2v-i-ova-tar.expected2 +++ b/v2v/test-v2v-i-ova-tar.expected2 @@ -10,7 +10,7 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test-tar.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test-tar.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs: diff --git a/v2v/test-v2v-i-ova-two-disks.expected2 b/v2v/test-v2v-i-ova-two-disks.expected2 index cf4cea50b..621ace84b 100644 --- a/v2v/test-v2v-i-ova-two-disks.expected2 +++ b/v2v/test-v2v-i-ova-two-disks.expected2 @@ -10,8 +10,8 @@ hypervisor type: vmware video: sound: disks: - json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "filename": "test.ova" } } } (vmdk) [scsi] - json:{ "file": { "driver": "raw", "offset": x, "size": 102400, "file": { "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 10240, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] + json:{ "file": { "driver": "raw", "offset": x, "size": 102400, "file": { "driver": "file", "filename": "test.ova" } } } (vmdk) [scsi] removable media: CD-ROM [ide] in slot 0 NICs:
Seems reasonable. I guess we need to revert commit f73ac1fc9c21d70e33824e61cf091533afb57273 too?
Well, I don't know. It might make sense to wait with the revert at least until we actually push the fix into libvirt. But that decision is really up to you. Tomas
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
-- Tomáš Golembiovský <tgolembi@redhat.com>
participants (2)
-
Richard W.M. Jones -
Tomáš Golembiovský