@@ -308,63 +308,51 @@ static void virtio_snd_read_pcm_set_params(struct virtq_desc *vq_desc,
308
308
info -> rate = (1 << VIRTIO_SND_PCM_RATE_44100 );
309
309
info -> padding = 0 ;
310
310
#endif
311
- fprintf (stderr , "virtio_snd_read_pcm_set_params" );
311
+ fprintf (stderr , "virtio_snd_read_pcm_set_params\n " );
312
312
}
313
313
314
314
static void virtio_snd_read_pcm_prepare (struct virtq_desc * vq_desc ,
315
315
const virtio_snd_query_info_t * query )
316
316
{
317
- virtio_snd_pcm_hdr_t * hdr =
318
- (virtio_snd_pcm_hdr_t * ) ((uintptr_t ) vq_desc [2 ].addr );
319
-
320
317
/* TODO: let application to set stream_id at will */
321
- hdr -> hdr .code = VIRTIO_SND_R_PCM_PREPARE ;
322
- hdr -> stream_id = 0 ;
323
318
324
319
/* Control the callback to prepare the buffer */
325
320
/* TODO: add lock to avoid race condition */
326
321
guest_playing = false;
322
+
323
+ fprintf (stderr , "virtio_snd_read_pcm_prepare\n" );
327
324
}
328
325
329
326
static void virtio_snd_read_pcm_start (struct virtq_desc * vq_desc ,
330
327
const virtio_snd_query_info_t * query )
331
328
{
332
- virtio_snd_pcm_hdr_t * hdr =
333
- (virtio_snd_pcm_hdr_t * ) ((uintptr_t ) vq_desc [2 ].addr );
334
-
335
329
/* TODO: let application to set stream_id at will */
336
- hdr -> hdr .code = VIRTIO_SND_R_PCM_START ;
337
- hdr -> stream_id = 0 ;
338
330
339
331
/* Control the callback to start playing */
340
332
/* TODO: add lock to avoid race condition */
341
333
guest_playing = true;
334
+
335
+ fprintf (stderr , "virtio_snd_read_pcm_start\n" );
342
336
}
343
337
344
338
static void virtio_snd_read_pcm_stop (struct virtq_desc * vq_desc ,
345
339
const virtio_snd_query_info_t * query )
346
340
{
347
- virtio_snd_pcm_hdr_t * hdr =
348
- (virtio_snd_pcm_hdr_t * ) ((uintptr_t ) vq_desc [2 ].addr );
349
-
350
341
/* TODO: let application to set stream_id at will */
351
- hdr -> hdr .code = VIRTIO_SND_R_PCM_STOP ;
352
- hdr -> stream_id = 0 ;
353
342
354
343
/* Control the callback to stop playing */
355
344
/* TODO: add lock to avoid race condition */
356
345
guest_playing = false;
346
+
347
+ fprintf (stderr , "virtio_snd_read_pcm_stop\n" );
357
348
}
358
349
359
350
static void virtio_snd_read_pcm_release (struct virtq_desc * vq_desc ,
360
351
const virtio_snd_query_info_t * query )
361
352
{
362
- virtio_snd_pcm_hdr_t * hdr =
363
- (virtio_snd_pcm_hdr_t * ) ((uintptr_t ) vq_desc [2 ].addr );
364
-
365
353
/* TODO: let application to set stream_id at will */
366
- hdr -> hdr . code = VIRTIO_SND_R_PCM_RELEASE ;
367
- hdr -> stream_id = 0 ;
354
+
355
+ fprintf ( stderr , "virtio_snd_read_pcm_release\n" ) ;
368
356
}
369
357
370
358
static void virtio_snd_cb (struct CNFADriver * dev ,
@@ -466,7 +454,7 @@ static int virtio_snd_desc_handler(virtio_snd_state_t *vsnd,
466
454
virtio_snd_read_pcm_stop (vq_desc , query );
467
455
break ;
468
456
default :
469
- fprintf (stderr , "unsupported virtio-snd operation!\n" );
457
+ fprintf (stderr , "%d: unsupported virtio-snd operation!\n" , type );
470
458
response -> code = VIRTIO_SND_S_NOT_SUPP ;
471
459
* plen = 0 ;
472
460
return -1 ;
0 commit comments