Re: [PATCH v3 4/5] test: make nodedevs active by default

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

 



On 4/9/24 16:56, Cole Robinson wrote:
This was the implied default before nodedevs gained a notion of
being inactive, and matches how we handle parsing other objects

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
  src/test/test_driver.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 41828f86b6..9db7a44035 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1269,6 +1269,7 @@ testParseNodedevs(testDriver *privconn,
              return -1;
          }
+ virNodeDeviceObjSetActive(obj, true);

This will actually render the mdev object to be transient which is an active mdev not having a persistent definition. The data using virNodeDeviceDefParseXML is stored in the mdevs defined_config only therefore the data is showing up when you use "virsh nodedev-dumpxml" as it defaults to the "current state" of the nodedev.

For data consistency of the node you should instead do
virNodeDeviceObjSetPersistent(obj, true);

Now the mdev is inactive and persistent and the virsh command should be correct.

I guess this would also resolve the requirement for the next patch unless you have a requirement to mock dumping transient mdevs.

          virNodeDeviceObjSetSkipUpdateCaps(obj, true);
          virNodeDeviceObjEndAPI(&obj);
      }

--
Mit freundlichen Grüßen/Kind regards
   Boris Fiuczynski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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