On 07/03/2026 16.41, Philippe Mathieu-Daudé wrote:
The HostMemoryBackend::use_canonical_path boolean
was only set in the hw_compat_3_1[] array, via the
'x-use-canonical-path-for-ramblock-id=true' property.
We removed all machines using that array, but the
comment added in commit 8db0b20415c ("machine: add
missing doc for memory-backend option") requested to
not remove this property "as long as 4.0 and older
machine types exists". Previous commit removed the
last machines in this range, we can now remove that
property and all the code around it.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
  qapi/qom.json            |  8 +-------
  include/system/hostmem.h |  2 +-
  backends/hostmem.c       | 34 ----------------------------------
  qemu-options.hx          | 10 ----------
  4 files changed, 2 insertions(+), 52 deletions(-)

diff --git a/qapi/qom.json b/qapi/qom.json
index c653248f85d..3e13e3fd25c 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -660,11 +660,6 @@
  #
  # @size: size of the memory region in bytes
  #
-# @x-use-canonical-path-for-ramblock-id: if true, the canonical path
-#     is used for ramblock-id.  Disable this for 4.0 machine types or
-#     older to allow migration with newer QEMU versions.
-#     (default: false generally, but true for machine types <= 4.0)
-#
  # .. note:: prealloc=true and reserve=false cannot be set at the same
  #    time.  With reserve=true, the behavior depends on the operating
  #    system: for example, Linux will not reserve swap space for shared
@@ -683,8 +678,7 @@
              '*prealloc-context': 'str',
              '*share': 'bool',
              '*reserve': 'bool',
-            'size': 'size',
-            '*x-use-canonical-path-for-ramblock-id': 'bool' } }
+            'size': 'size' } }
##
  # @MemoryBackendFileProperties:
diff --git a/include/system/hostmem.h b/include/system/hostmem.h
index 88fa791ac78..cafcf9c9c74 100644
--- a/include/system/hostmem.h
+++ b/include/system/hostmem.h
@@ -74,7 +74,7 @@ struct HostMemoryBackend {
/* protected */
      uint64_t size;
-    bool merge, dump, use_canonical_path;
+    bool merge, dump;
      bool prealloc, is_mapped, share, reserve;
      bool guest_memfd, aligned;
      uint32_t prealloc_threads;
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 15d4365b697..7da7cd54e05 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -40,10 +40,6 @@ QEMU_BUILD_BUG_ON(HOST_MEM_POLICY_INTERLEAVE != 
MPOL_INTERLEAVE);
  char *
  host_memory_backend_get_name(HostMemoryBackend *backend)
  {
-    if (!backend->use_canonical_path) {
-        return g_strdup(object_get_canonical_path_component(OBJECT(backend)));
-    }

I'm a little bit confused by this one here. If I've got that right, the flag was set to "true" for the old QEMU machines <= 3.1, and it is set to false by default for new machines? If so, shouldn't we rather always use the above return and remove the one below instead?

      return object_get_canonical_path(OBJECT(backend));
  }
@@ -484,23 +480,6 @@ static void host_memory_backend_set_reserve(Object *o, bool value, Error **errp)
  }
  #endif /* CONFIG_LINUX */
-static bool
-host_memory_backend_get_use_canonical_path(Object *obj, Error **errp)
-{
-    HostMemoryBackend *backend = MEMORY_BACKEND(obj);
-
-    return backend->use_canonical_path;
-}
-
-static void
-host_memory_backend_set_use_canonical_path(Object *obj, bool value,
-                                           Error **errp)
-{
-    HostMemoryBackend *backend = MEMORY_BACKEND(obj);
-
-    backend->use_canonical_path = value;
-}
-
  static void
  host_memory_backend_class_init(ObjectClass *oc, const void *data)
  {
@@ -563,19 +542,6 @@ host_memory_backend_class_init(ObjectClass *oc, const void 
*data)
      object_class_property_set_description(oc, "reserve",
          "Reserve swap space (or huge pages) if applicable");
  #endif /* CONFIG_LINUX */
-    /*
-     * Do not delete/rename option. This option must be considered stable
-     * (as if it didn't have the 'x-' prefix including deprecation period) as
-     * long as 4.0 and older machine types exists.
By the way, this option seems to be used by libvirt - we should maybe make sure that its removal does not break libvirt by accident...?

 Thomas


Reply via email to