Richard W.M. Jones
2021-Sep-27 08:30 UTC
[Libguestfs] [virt-v2v PATCH 2/4] test-v2v-cdrom: update the CD-ROM's bus to SATA in the converted domain
On Mon, Sep 27, 2021 at 08:34:56AM +0200, Laszlo Ersek wrote:> Per commit ac39fa292c31 ("v2v: Set machine type explicitly for outputs > which support it (RHBZ#1581428).", 2020-12-04), Windows 7 guests (which > are "more modern" than Windows XP guests) are converted to Q35, not I440FX > boards. > > Per related commit d0267122e348 ("v2v: -o libvirt: Map IDE disks to > bus="sata" on Q35.", 2020-12-04), when a Windows 7 guest with an IDE > CD-ROM -- hence, an I440FX board -- is converted, the CD-ROM in the > converted domain will be on the SATA bus (Q35 does not have an IDE > controller, only a SATA controller). > > Because the Windows guest used in "test-v2v-cdrom" is "Windows 7 Phony > Edition", it triggers the above cascade, and currently fails with: > > > --- ./test-v2v-cdrom.expected 2021-09-03 22:51:31.026185527 +0200 > > +++ test-v2v-cdrom.d/disks 2021-09-19 13:01:47.471745622 +0200 > > @@ -4,5 +4,5 @@ > > </disk> > > <disk device='cdrom' type='file'> > > <driver name='qemu' type='raw'/> > > - <target dev='hdc' bus='ide'/> > > + <target dev='sdc' bus='sata'/> > > </disk> > > ./test-v2v-cdrom.sh: unexpected disk assignments > > The conversion seems correct, but the test expectation is stale. Most > probably, commit d0267122e348 missed updating the test data. Do it now.Actually the conversion is wrong - we need to update configuration inside the guest. Which is why I didn't fix this test - to remind myself that there's still a bug to be fixed. https://bugzilla.redhat.com/show_bug.cgi?id=1637857 Rich.> Fixes: d0267122e348202f6fac4d833f7448409e7129c9 > Signed-off-by: Laszlo Ersek <lersek at redhat.com> > --- > tests/test-v2v-cdrom.expected | 2 +- > tests/test-v2v-cdrom.xml.in | 4 +++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tests/test-v2v-cdrom.expected b/tests/test-v2v-cdrom.expected > index 34d2bf5961b0..17bd152d8e64 100644 > --- a/tests/test-v2v-cdrom.expected > +++ b/tests/test-v2v-cdrom.expected > @@ -4,5 +4,5 @@ > </disk> > <disk device='cdrom' type='file'> > <driver name='qemu' type='raw'/> > - <target dev='hdc' bus='ide'/> > + <target dev='sdc' bus='sata'/> > </disk> > diff --git a/tests/test-v2v-cdrom.xml.in b/tests/test-v2v-cdrom.xml.in > index 6bad5eab1cd4..a6e1e3f514d5 100644 > --- a/tests/test-v2v-cdrom.xml.in > +++ b/tests/test-v2v-cdrom.xml.in > @@ -35,7 +35,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > <disk type='file' device='cdrom'> > <driver name='qemu' type='raw'/> > <source file='@abs_top_builddir@/test-data/phony-guests/blank-disk.img'/> > - <!-- virt-v2v should preserve the device name and bus --> > + <!-- virt-v2v should change the bus to sata, due to Windows 7 > + triggering a machine type change from i440fx to q35. Beyond that, > + virt-v2v should preserve the on-bus index. --> > <target dev='hdc' bus='ide'/> > </disk> > </devices> > -- > 2.19.1.3.g30247aa5d201 > > > _______________________________________________ > Libguestfs mailing list > Libguestfs at redhat.com > https://listman.redhat.com/mailman/listinfo/libguestfs-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Laszlo Ersek
2021-Sep-29 19:07 UTC
[Libguestfs] [virt-v2v PATCH 2/4] test-v2v-cdrom: update the CD-ROM's bus to SATA in the converted domain
On 09/27/21 10:30, Richard W.M. Jones wrote:> On Mon, Sep 27, 2021 at 08:34:56AM +0200, Laszlo Ersek wrote: >> Per commit ac39fa292c31 ("v2v: Set machine type explicitly for outputs >> which support it (RHBZ#1581428).", 2020-12-04), Windows 7 guests (which >> are "more modern" than Windows XP guests) are converted to Q35, not I440FX >> boards. >> >> Per related commit d0267122e348 ("v2v: -o libvirt: Map IDE disks to >> bus="sata" on Q35.", 2020-12-04), when a Windows 7 guest with an IDE >> CD-ROM -- hence, an I440FX board -- is converted, the CD-ROM in the >> converted domain will be on the SATA bus (Q35 does not have an IDE >> controller, only a SATA controller). >> >> Because the Windows guest used in "test-v2v-cdrom" is "Windows 7 Phony >> Edition", it triggers the above cascade, and currently fails with: >> >>> --- ./test-v2v-cdrom.expected 2021-09-03 22:51:31.026185527 +0200 >>> +++ test-v2v-cdrom.d/disks 2021-09-19 13:01:47.471745622 +0200 >>> @@ -4,5 +4,5 @@ >>> </disk> >>> <disk device='cdrom' type='file'> >>> <driver name='qemu' type='raw'/> >>> - <target dev='hdc' bus='ide'/> >>> + <target dev='sdc' bus='sata'/> >>> </disk> >>> ./test-v2v-cdrom.sh: unexpected disk assignments >> >> The conversion seems correct, but the test expectation is stale. Most >> probably, commit d0267122e348 missed updating the test data. Do it now. > > Actually the conversion is wrong - we need to update configuration > inside the guest. Which is why I didn't fix this test - to remind > myself that there's still a bug to be fixed.Hmm, good point; now I remember that the i440fx->q35 machine type change is basically a motherboard replacement for Windows. So do we have to update some "windows device paths" (leading to the CD-ROM) in the registry? Thanks, Laszlo> > https://bugzilla.redhat.com/show_bug.cgi?id=1637857 > > Rich. > >> Fixes: d0267122e348202f6fac4d833f7448409e7129c9 >> Signed-off-by: Laszlo Ersek <lersek at redhat.com> >> --- >> tests/test-v2v-cdrom.expected | 2 +- >> tests/test-v2v-cdrom.xml.in | 4 +++- >> 2 files changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/tests/test-v2v-cdrom.expected b/tests/test-v2v-cdrom.expected >> index 34d2bf5961b0..17bd152d8e64 100644 >> --- a/tests/test-v2v-cdrom.expected >> +++ b/tests/test-v2v-cdrom.expected >> @@ -4,5 +4,5 @@ >> </disk> >> <disk device='cdrom' type='file'> >> <driver name='qemu' type='raw'/> >> - <target dev='hdc' bus='ide'/> >> + <target dev='sdc' bus='sata'/> >> </disk> >> diff --git a/tests/test-v2v-cdrom.xml.in b/tests/test-v2v-cdrom.xml.in >> index 6bad5eab1cd4..a6e1e3f514d5 100644 >> --- a/tests/test-v2v-cdrom.xml.in >> +++ b/tests/test-v2v-cdrom.xml.in >> @@ -35,7 +35,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >> <disk type='file' device='cdrom'> >> <driver name='qemu' type='raw'/> >> <source file='@abs_top_builddir@/test-data/phony-guests/blank-disk.img'/> >> - <!-- virt-v2v should preserve the device name and bus --> >> + <!-- virt-v2v should change the bus to sata, due to Windows 7 >> + triggering a machine type change from i440fx to q35. Beyond that, >> + virt-v2v should preserve the on-bus index. --> >> <target dev='hdc' bus='ide'/> >> </disk> >> </devices> >> -- >> 2.19.1.3.g30247aa5d201 >> >> >> _______________________________________________ >> Libguestfs mailing list >> Libguestfs at redhat.com >> https://listman.redhat.com/mailman/listinfo/libguestfs >