virtio-snd: remove TODO comments
Replying with a VIRTIO_SND_S_BAD_MSG error does not warrant a device reset. Instead, a device reset happens when the driver requests it from the transport. Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260220-virtio-snd-series-v1-2-207c4f7200a2@linaro.org>
Manos Pitsidianakis committed
Feb 20, 2026 at 11:40 UTC
34238f078a04f24b91199249b83846ab082b4e05
1 file changed
-21
hw/audio/virtio-snd.c
-21
@@ -168,9 +168,6 @@ static void virtio_snd_handle_pcm_info(VirtIOSound *s,
168
sizeof(virtio_snd_query_info));
169
170
if (msg_sz != sizeof(virtio_snd_query_info)) {
171
- /*
172
- * TODO: do we need to set DEVICE_NEEDS_RESET?
173
- */
171
qemu_log_mask(LOG_GUEST_ERROR,
172
"%s: virtio-snd command size incorrect %zu vs \
173
%zu\n", __func__, msg_sz, sizeof(virtio_snd_query_info));
@@ -184,9 +181,6 @@ static void virtio_snd_handle_pcm_info(VirtIOSound *s,
181
182
if (iov_size(cmd->elem->in_sg, cmd->elem->in_num) <
183
sizeof(virtio_snd_hdr) + size * count) {
187
- /*
188
- * TODO: do we need to set DEVICE_NEEDS_RESET?
189
- */
184
error_report("pcm info: buffer too small, got: %zu, needed: %zu",
185
iov_size(cmd->elem->in_sg, cmd->elem->in_num),
186
sizeof(virtio_snd_pcm_info));
@@ -244,9 +238,6 @@ uint32_t virtio_snd_set_pcm_params(VirtIOSound *s,
238
virtio_snd_pcm_set_params *st_params;
239
240
if (stream_id >= s->snd_conf.streams || s->pcm->pcm_params == NULL) {
247
- /*
248
- * TODO: do we need to set DEVICE_NEEDS_RESET?
249
- */
241
virtio_error(VIRTIO_DEVICE(s), "Streams have not been initialized.\n");
242
return cpu_to_le32(VIRTIO_SND_S_BAD_MSG);
243
}
@@ -297,9 +288,6 @@ static void virtio_snd_handle_pcm_set_params(VirtIOSound *s,
288
sizeof(virtio_snd_pcm_set_params));
289
290
if (msg_sz != sizeof(virtio_snd_pcm_set_params)) {
300
- /*
301
- * TODO: do we need to set DEVICE_NEEDS_RESET?
302
- */
291
qemu_log_mask(LOG_GUEST_ERROR,
292
"%s: virtio-snd command size incorrect %zu vs \
293
%zu\n", __func__, msg_sz, sizeof(virtio_snd_pcm_set_params));
@@ -610,9 +598,6 @@ static void virtio_snd_handle_pcm_release(VirtIOSound *s,
598
sizeof(stream_id));
599
600
if (msg_sz != sizeof(stream_id)) {
613
- /*
614
- * TODO: do we need to set DEVICE_NEEDS_RESET?
615
- */
601
qemu_log_mask(LOG_GUEST_ERROR,
602
"%s: virtio-snd command size incorrect %zu vs \
603
%zu\n", __func__, msg_sz, sizeof(stream_id));
@@ -624,9 +609,6 @@ static void virtio_snd_handle_pcm_release(VirtIOSound *s,
609
trace_virtio_snd_handle_pcm_release(stream_id);
610
stream = virtio_snd_pcm_get_stream(s, stream_id);
611
if (stream == NULL) {
627
- /*
628
- * TODO: do we need to set DEVICE_NEEDS_RESET?
629
- */
612
error_report("already released stream %"PRIu32, stream_id);
613
virtio_error(VIRTIO_DEVICE(s),
614
"already released stream %"PRIu32,
@@ -669,9 +651,6 @@ process_cmd(VirtIOSound *s, virtio_snd_ctrl_command *cmd)
651
sizeof(virtio_snd_hdr));
652
653
if (msg_sz != sizeof(virtio_snd_hdr)) {
672
- /*
673
- * TODO: do we need to set DEVICE_NEEDS_RESET?
674
- */
654
qemu_log_mask(LOG_GUEST_ERROR,
655
"%s: virtio-snd command size incorrect %zu vs \
656
%zu\n", __func__, msg_sz, sizeof(virtio_snd_hdr));