diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 7a1376bf49a20a2437840cea18102a8d24524268..3ce21a8f5345ed86fc53d05d2c4810a9835dad0d 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -580,18 +580,21 @@ virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv) goto error; if (virJSONValueObjectAppendNumberUint(object, "min_workers", + srv->workers == NULL ? 0 : virThreadPoolGetMinWorkers(srv->workers)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Cannot set min_workers data in JSON document")); goto error; } if (virJSONValueObjectAppendNumberUint(object, "max_workers", + srv->workers == NULL ? 0 : virThreadPoolGetMaxWorkers(srv->workers)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Cannot set max_workers data in JSON document")); goto error; } if (virJSONValueObjectAppendNumberUint(object, "priority_workers", + srv->workers == NULL ? 0 : virThreadPoolGetPriorityWorkers(srv->workers)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Cannot set priority_workers data in JSON document"));