[PATCH v1 07/10] qemu_hotplug.c: avoid aligning the mem obj in qemuDomainDetachPrepMemory()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The alignment of the mem object in qemuDomainDetachPrepMemory()
allows for the virDomainMemoryFindByDef() call to find the
right memory object for detach.

Turns out that, after recent changes, the alignment of the mem
object is already granted at this point. This function is used by
qemuDomainDetachDeviceLive(), which in turn is used in two
places with a memory device:

- qemuDomainDetachDeviceLiveAndConfig(), after a virDomainDeviceDefParse()
calll that will align the mem object via PostParse callbacks;

- qemuDomainDetachDeviceAliasLiveAndConfig(), after a call to
virDomainDefFindDevice() that will get the already aligned mem object
from the domain definition.

This means that the qemuDomainMemoryDeviceAlignSize() call at the
start of this function is now obsolete and can be removed.

Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
---
 src/qemu/qemu_hotplug.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c1461ac621..e0495ef59e 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -5682,9 +5682,9 @@ qemuDomainDetachPrepMemory(virDomainObjPtr vm,
 {
     int idx;
 
-    if (qemuDomainMemoryDeviceAlignSize(vm->def, match) < 0)
-        return -1;
-
+    /* 'match' is granted to be aligned at this point, either
+     * by PostParse callbacks when parsing it or by fetching it
+     * from the domain definition. */
     if ((idx = virDomainMemoryFindByDef(vm->def, match)) < 0) {
         virReportError(VIR_ERR_DEVICE_MISSING,
                        _("model '%s' memory device not present "
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux