<div dir="auto"><div><div data-smartmail="gmail_signature"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon 16 May 2022, 10:10 Michal Prívozník, <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 5/14/22 21:23, Darragh Bailey wrote:<br>
> <br>
> On Fri, 13 May 2022 at 00:17, Darragh Bailey <<a href="mailto:daragh.bailey@gmail.com" target="_blank" rel="noreferrer">daragh.bailey@gmail.com</a><br>
> <mailto:<a href="mailto:daragh.bailey@gmail.com" target="_blank" rel="noreferrer">daragh.bailey@gmail.com</a>>> wrote:<br>
><br>
> Unfortunately trying to call this via ruby-libvirt doesn't appear to<br>
> behave as expected. It appears that if I add an nvram element without a<br>
> loader element to the os block, the following code block will execute<br>
> without issue but also without changing the domain XML:<br>
<br>
I think that's kind of expected. If you take a look how libvirt parses<br>
that part of XML:<br>
<br>
<a href="https://gitlab.com/libvirt/libvirt/-/blob/master/src/conf/domain_conf.c#L18257" rel="noreferrer noreferrer" target="_blank">https://gitlab.com/libvirt/libvirt/-/blob/master/src/conf/domain_conf.c#L18257</a><br>
<br>
if no <loader/> is found then the function exits early without looking<br>
at <nvram/> at all. It kind of makes sense - what good does nvram do<br>
without loader?</blockquote></div></div><div dir="auto"><br></div><div dir="auto">I don't know, I realised that there was a bug in our vagrant-libvirt in that it should be checking for both loader and NVRAM config settings to be passed in if the end user was updating the machine config. And subsequently set both elements or neither. </div><div dir="auto"><br></div><div dir="auto">However I was not expecting the silent discarding of the XML element and instead to get an error saying that an nvram XML element without a loader XML element is invalid and for the entire request to be rejected. Basically that the provided XML domain definition was invalid.</div><div dir="auto"><br></div><div dir="auto">Based on the previous explanation of how the define_domain_xml should work along with the response on the example reproducer this seems like a bug.</div><div dir="auto"><br></div><div dir="auto">Does your reply mean this is expected behaviour? Or were you looking for clarification on what I expected to see?</div><div dir="auto">--</div><div dir="auto">Darragh Bailey</div><div dir="auto"></div></div>