@samitouri / QOSamiQemu / commits / dcd5915410

audio/sndio: replace custom logging with error_report

Replace the custom audio logging infrastructure (dolog macro) with standard QEMU error reporting (error_report). Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Marc-André Lureau committed Jan 20, 2026 at 20:14 UTC dcd591541090dbdb7d85f81071d3f099776c61d7
1 file changed +10 -10
audio/sndioaudio.c
+10 -10
@@ -18,12 +18,12 @@
18 #include <poll.h>
19 #include <sndio.h>
20 #include "qemu/main-loop.h"
21 +#include "qemu/error-report.h"
22 #include "qemu/audio.h"
22 -#include "trace.h"
23 #include "qom/object.h"
24
25 -#define AUDIO_CAP "sndio"
25 #include "audio_int.h"
26 +#include "trace.h"
27
28 #define TYPE_AUDIO_SNDIO "audio-sndio"
29 OBJECT_DECLARE_SIMPLE_TYPE(AudioSndio, AUDIO_SNDIO)
@@ -348,7 +348,7 @@ static int sndio_init(SndioVoice *self,
348 /* open the device in non-blocking mode */
349 self->hdl = sio_open(dev_name, mode, 1);
350 if (self->hdl == NULL) {
351 - dolog("failed to open device\n");
351 + error_report("sndio: failed to open device");
352 return -1;
353 }
354
@@ -382,7 +382,7 @@ static int sndio_init(SndioVoice *self,
382 req.sig = 0;
383 break;
384 default:
385 - dolog("unknown audio sample format\n");
385 + error_report("sndio: unknown audio sample format");
386 return -1;
387 }
388
@@ -401,12 +401,12 @@ static int sndio_init(SndioVoice *self,
401 req.appbufsz = req.rate * latency / 1000000;
402
403 if (!sio_setpar(self->hdl, &req)) {
404 - dolog("failed set audio params\n");
404 + error_report("sndio: failed to set audio params");
405 goto fail;
406 }
407
408 if (!sio_getpar(self->hdl, &self->par)) {
409 - dolog("failed get audio params\n");
409 + error_report("sndio: failed to get audio params");
410 goto fail;
411 }
412
@@ -419,7 +419,7 @@ static int sndio_init(SndioVoice *self,
419 if (self->par.bits != req.bits || self->par.bps != req.bits / 8 ||
420 self->par.sig != req.sig || (req.bits > 8 && self->par.le != req.le) ||
421 self->par.rate != as->freq || nch != as->nchannels) {
422 - dolog("unsupported audio params\n");
422 + error_report("sndio: unsupported audio params");
423 goto fail;
424 }
425
@@ -431,7 +431,7 @@ static int sndio_init(SndioVoice *self,
431
432 self->buf = g_malloc(self->buf_size);
433 if (self->buf == NULL) {
434 - dolog("failed to allocate audio buffer\n");
434 + error_report("sndio: failed to allocate audio buffer");
435 goto fail;
436 }
437
@@ -439,13 +439,13 @@ static int sndio_init(SndioVoice *self,
439
440 self->pfds = g_malloc_n(nfds, sizeof(struct pollfd));
441 if (self->pfds == NULL) {
442 - dolog("failed to allocate pollfd structures\n");
442 + error_report("sndio: failed to allocate pollfd structures");
443 goto fail;
444 }
445
446 self->pindexes = g_malloc_n(nfds, sizeof(struct pollindex));
447 if (self->pindexes == NULL) {
448 - dolog("failed to allocate pollindex structures\n");
448 + error_report("sndio: failed to allocate pollindex structures");
449 goto fail;
450 }
451