[PATCH v2 04/27] domain_conf: Check NVDIMM UUID in ABI stability

Michal Privoznik posted 27 patches 5 years, 2 months ago
[PATCH v2 04/27] domain_conf: Check NVDIMM UUID in ABI stability
Posted by Michal Privoznik 5 years, 2 months ago
The UUID is guest visible and thus shouldn't change if we want to
not break guest ABI.

Fixes: 08ed673901bb5b4f419b37bcce9b11d31ce370e6
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/conf/domain_conf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 425e3c3710..d8df18b542 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -24204,6 +24204,12 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src,
                              "source NVDIMM readonly flag"));
             return false;
         }
+
+        if (memcmp(src->uuid, dst->uuid, VIR_UUID_BUFLEN) != 0) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("Target NVDIMM UUID doesn't match source NVDIMM"));
+            return false;
+        }
     }
 
     return virDomainDeviceInfoCheckABIStability(&src->info, &dst->info);
-- 
2.26.2

Re: [PATCH v2 04/27] domain_conf: Check NVDIMM UUID in ABI stability
Posted by Peter Krempa 5 years, 2 months ago
On Thu, Dec 03, 2020 at 13:36:07 +0100, Michal Privoznik wrote:
> The UUID is guest visible and thus shouldn't change if we want to
> not break guest ABI.
> 
> Fixes: 08ed673901bb5b4f419b37bcce9b11d31ce370e6
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/conf/domain_conf.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Neither the libvirt commit nor the qemu commit mention this fact
clearly. Libvirt doesn't store it under <target> either, which doesn't
entirely substantiate the claim, but it makes sense that it's the same
since it's an uuid and also it's formatted as part of the frontend
definiton on the command line.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>