virDomainNetDef: Change type of 'tune.sndbuf'

Use 'unsigned long long' instead of 'unsigned long' and fix the parser
and formatter.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-10-05 15:52:59 +02:00
parent 3bd5ceb68a
commit cf479bcbb6
2 changed files with 3 additions and 3 deletions

View File

@ -9376,7 +9376,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
if (virDomainNetTeamingInfoParseXML(ctxt, &def->teaming) < 0)
return NULL;
rv = virXPathULong("string(./tune/sndbuf)", ctxt, &def->tune.sndbuf);
rv = virXPathULongLong("string(./tune/sndbuf)", ctxt, &def->tune.sndbuf);
if (rv >= 0) {
def->tune.sndbuf_specified = true;
} else if (rv == -2) {
@ -23585,7 +23585,7 @@ virDomainNetDefFormat(virBuffer *buf,
if (def->tune.sndbuf_specified) {
virBufferAddLit(buf, "<tune>\n");
virBufferAdjustIndent(buf, 2);
virBufferAsprintf(buf, "<sndbuf>%lu</sndbuf>\n", def->tune.sndbuf);
virBufferAsprintf(buf, "<sndbuf>%llu</sndbuf>\n", def->tune.sndbuf);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</tune>\n");
}

View File

@ -1146,7 +1146,7 @@ struct _virDomainNetDef {
virNetDevVPortProfile *virtPortProfile;
struct {
bool sndbuf_specified;
unsigned long sndbuf;
unsigned long long sndbuf;
} tune;
char *script;
char *downscript;