mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemuMonitorJSONQueryRxFilter: Allow @filter to be NULL
Sometimes it may be handy to just issue the query-rx-filter monitor command without actually parsing the output. Adapt qemuMonitorJSONQueryRxFilter() to this behavior. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
cab49d394f
commit
d6169ad739
@ -2536,6 +2536,18 @@ qemuMonitorRemoveNetdev(qemuMonitor *mon,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuMonitorQueryRxFilter:
|
||||
* @mon: monitor object
|
||||
* @alias: alias of the network interface
|
||||
* @filter: where to store the result (can be NULL)
|
||||
*
|
||||
* Issues query-rx-filter command for given device (@alias) and stores parsed
|
||||
* output at @filter (if not NULL). If @filter is NULL, the command is executed
|
||||
* but nothing is parsed.
|
||||
*
|
||||
* Returns 0 on success, -1 otherwise.
|
||||
*/
|
||||
int
|
||||
qemuMonitorQueryRxFilter(qemuMonitor *mon, const char *alias,
|
||||
virNetDevRxFilter **filter)
|
||||
|
@ -3753,7 +3753,8 @@ qemuMonitorJSONQueryRxFilter(qemuMonitor *mon, const char *alias,
|
||||
if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorJSONQueryRxFilterParse(reply, filter) < 0)
|
||||
if (filter &&
|
||||
qemuMonitorJSONQueryRxFilterParse(reply, filter) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user