<div dir="ltr"><div dir="ltr">On Wed, Dec 23, 2020 at 11:45 AM Peter Krempa <<a href="mailto:pkrempa@redhat.com">pkrempa@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">For this test,<br>
you'll be better off adding a hack to fill in the uid/gid values (e.g.<br>
by checking that they start with a + to be safe.</blockquote><div><br></div><div>Our interpretation of what you mean here is to add a check in our parse method (specifically in virDomainStorageNetworkParseNFS, which is called by virDomainDIskSourceNetworkParse in domain_conf.c) which looks at the user/group strings in the XML and checks if their first character is a '+'. If so, assume that this string is an integer and not a name, then parse it into the nfs_uid or gid values. This would allow our tests to understand a property like "user='+2'" without having to call the preparseStorageSource methods. This functionality is built into virGetUserID, but because we can't call it we would have to duplicate the code. Is this an acceptable approach?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The formatter omits the values if they are default. According to the QMP<br>
schema they can be missing. The parser thus must cope when the JSON<br>
object doesn't have the values populated.<br></blockquote><div><br></div><div>So will a method like "virJSONValueObjectGetNumberInt" return an error code (i.e. < 0) if the property is missing? If so, we could use this error code as an indicator that the property (e.g. user) should be the default value (e.g. -1).</div><div><br></div><div>We also had some questions in regards to other tests. We won't submit it as an RFC patch because it isn't ready, but if you'd like to see our current code for reference you can view it on <a href="https://gitlab.com/bschoney/libvirt/-/tree/issue-90-rt2">this branch</a>.</div><div><br></div><div>We're failing virschematest for our file disk-network-nfs.xml. The error is:<br>"Extra element devices in interleave</div><div>Element domain failed to validate content"</div><div><br></div><div>This seems like there's a problem with our XML not matching the RNG docs. However, the problem appears to be with our <devices> tag, which was based on the XML in disk-backing-chains.xml. Why does our file report an error for this, but disk-backing-chains.xml does not?</div><div><br></div><div>Also, both xml2argv and xml2xml tests are failing, even with the VIR_REGENERATE_OUTPUT environment variable set to 1. The error is:</div><div>"libvirt: Domain Config error : missing source information for device vda"</div><div>To be completely honest, we don't know what about our XML or schema is causing this error and so we aren't sure what the fix is. We've based our XML mostly on disk-network-vxhs.xml and disk-backing-chains.xml, but don't understand why those pass and ours doesn't.</div></div></div>