On 4/9/24 11:19 AM, Boris Fiuczynski wrote:
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(a)redhat.com>
> ---
> 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.
Oops I replied to patch 5 before seeing this one. Let me explore this a
bit.
Thanks,
Cole