goto cleanup;
if (cmdret < 0 || exitstatus != 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not start dbus-daemon. exitstatus: %d"), exitstatus);
+ if (cmdret >= 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not start dbus-daemon. exitstatus: %d"), exitstatus);
+ }
goto cleanup;
}
goto error;
if (cmdret < 0 || exitstatus != 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not start 'passt': %s"), NULLSTR(errbuf));
+ if (cmdret >= 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not start 'passt': %s"), NULLSTR(errbuf));
+ }
goto error;
}
* @cmdret: pointer to int returning result of virCommandRun
*
* Run @cmd with seclabels set on it. If @uid and/or @gid are not
- * -1 then their value is enforced.
+ * -1 then their value is enforced. If @cmdret is negative upon
+ * return, then appropriate error was already reported.
*
* Returns: 0 on success,
- * -1 otherwise.
+ * -1 otherwise (with error reported).
*/
int
qemuSecurityCommandRun(virQEMUDriver *driver,
goto error;
if (cmdret < 0 || exitstatus != 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not start 'slirp'. exitstatus: %d"), exitstatus);
+ if (cmdret >= 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not start 'slirp'. exitstatus: %d"), exitstatus);
+ }
goto error;
}
goto error;
if (cmdret < 0 || exitstatus != 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not start 'vhost-user-gpu'. exitstatus: %d"), exitstatus);
+ if (cmdret >= 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not start 'vhost-user-gpu'. exitstatus: %d"), exitstatus);
+ }
goto cleanup;
}