[PATCH 0/1] vmx: Fix <genid/> mapping

Michal Privoznik mprivozn at redhat.com
Wed Sep 29 08:01:55 UTC 2021


Apparently, parsing vmx.genid is not as easy as I thought. Anyway, it
was brought up in a private thread that libvirt doesn't report correct
UUIDs. For instance for the following input:

  vm.genid = "-8536691797830587195"
  vm.genidX = "-1723453263670062919"

Libvirt would report:

  <genid>8987940a-0951-2cc5-e815-10634ff550b9</genid>

while virt-v2v would report:

  <genid>09512cc5-940a-8987-b950-f54f631015e8</genid>

Another example:

  vm.genid = "-6284418052148993891"
  vm.genidX = "-649955058627554545"

Libvirt:

  <genid>a8c94313-ed9b-609d-f6fa-e5515a89530f</genid>

virt-v2v:

  <genid>ed9b609d-4313-a8c9-0f53-895a51e5faf6</genid>


To test my patch I modified tests/vmx2xmldata/esx-in-the-wild-10.vmx
(because it already contains vmx.genid, but any file can be modified
really), and then ran:

  libvirt.git/_build/tests $ VIR_TEST_DEBUG=1 VIR_TEST_RANGE=58 ./vmx2xmltest

Mind you, the fix is almost direct rewrite of virt-v2v's algorithm,
except it's optimized for C and not OCaml :-) You can find various
attempts/versions of that on my gitlab:

  https://gitlab.com/MichalPrivoznik/libvirt/-/commits/vmx_genid/

I'm sending only the last one because that looks the best IMO.

Michal Prívozník (1):
  vmx: Fix <genid/> mapping

 src/vmx/vmx.c                            | 16 ++++++++++++----
 tests/vmx2xmldata/esx-in-the-wild-10.xml |  2 +-
 2 files changed, 13 insertions(+), 5 deletions(-)

-- 
2.32.0




More information about the libvir-list mailing list