convert: avoid duplicate sd targets for Windows guests on q35*#122
convert: avoid duplicate sd targets for Windows guests on q35*#122ssahani wants to merge 1 commit intolibguestfs:masterfrom
Conversation
Windows guests commonly include IDE CD-ROM devices. When converting such guests to q35 (required for UEFI), virt-v2v maps legacy IDE devices to SATA, causing both SATA and SCSI devices to share the sd* naming namespace. virt-v2v previously generated target device names using per-bus slot indices, which could result in duplicate <target dev='sda'> entries (e.g. main disk on SCSI and CD-ROM on SATA). Libvirt rejects such domains with a duplicate target device error. Fix this by allocating target device names from a shared per-prefix namespace (sd, vd, hd, fd) so that all devices using the same guest-visible naming scheme receive unique target names, matching virt-install behavior and libvirt expectations. Signed-off-by: Susant Sahani <ssahani@redhat.com>
|
Unfortunately I don't think this approach can work, since it will end up moving disks between slots, which will end up breaking Unfortunately # 2, the actual fix for this is going to be extremely difficult (there's a reason why this bug has sat on the backlog for a long time). It involves changing how we do device renaming so that we never use names like |
|
Hmm why does this re-order disks from guest perspective? IIRC libvirt qemu target dev= names do not affect how disks are exposed to the guest, only explicit This is my understanding but I haven't dug super into libvirt code. But for example, there is no (direct) touching of 'disk->dst' in libvirt qemu_domain_address.c I think nowadays for qemu driver, target dev= is just a unique identifier for the device in the XML and nothing more. (unless libguestfs uses target dev name to adjust device ordering or |
|
Because it could possibly insert the CD-ROM into the list of The real issue however is that we need to stop using |
Windows guests commonly include IDE CD-ROM devices. When converting such guests to q35 (required for UEFI), virt-v2v maps legacy IDE devices to SATA, causing both SATA and SCSI devices to share the sd* naming namespace.
virt-v2v previously generated target device names using per-bus slot indices, which could result in duplicate entries (e.g. main disk on SCSI and CD-ROM on SATA). Libvirt rejects such domains with a duplicate target device error.
Fix this by allocating target device names from a shared per-prefix namespace (sd, vd, hd, fd) so that all devices using the same guest-visible naming scheme receive unique target names, matching virt-install behavior and libvirt expectations.