File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -1622,10 +1622,20 @@ void audio_cleanup(void)
16221622 }
16231623}
16241624
1625+ static bool vmstate_audio_needed (void * opaque )
1626+ {
1627+ /*
1628+ * Never needed, this vmstate only exists in case
1629+ * an old qemu sends it to us.
1630+ */
1631+ return false;
1632+ }
1633+
16251634static const VMStateDescription vmstate_audio = {
16261635 .name = "audio" ,
16271636 .version_id = 1 ,
16281637 .minimum_version_id = 1 ,
1638+ .needed = vmstate_audio_needed ,
16291639 .fields = (VMStateField []) {
16301640 VMSTATE_END_OF_LIST ()
16311641 }
Original file line number Diff line number Diff line change @@ -1646,16 +1646,14 @@ static void gd_vc_send_chars(VirtualConsole *vc)
16461646
16471647 len = qemu_chr_be_can_write (vc -> vte .chr );
16481648 avail = fifo8_num_used (& vc -> vte .out_fifo );
1649- if (len > avail ) {
1650- len = avail ;
1651- }
1652- while (len > 0 ) {
1649+ while (len > 0 && avail > 0 ) {
16531650 const uint8_t * buf ;
16541651 uint32_t size ;
16551652
1656- buf = fifo8_pop_buf (& vc -> vte .out_fifo , len , & size );
1653+ buf = fifo8_pop_buf (& vc -> vte .out_fifo , MIN ( len , avail ) , & size );
16571654 qemu_chr_be_write (vc -> vte .chr , (uint8_t * )buf , size );
1658- len -= size ;
1655+ len = qemu_chr_be_can_write (vc -> vte .chr );
1656+ avail -= size ;
16591657 }
16601658}
16611659
Original file line number Diff line number Diff line change @@ -817,7 +817,10 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
817817 * This is a bit hackish but saves us from bigger problem.
818818 * Maybe it's a good idea to fix this in SDL instead.
819819 */
820- g_setenv ("SDL_VIDEODRIVER" , "x11" , 0 );
820+ if (!g_setenv ("SDL_VIDEODRIVER" , "x11" , 0 )) {
821+ fprintf (stderr , "Could not set SDL_VIDEODRIVER environment variable\n" );
822+ exit (1 );
823+ }
821824#endif
822825
823826 if (SDL_Init (SDL_INIT_VIDEO )) {
You can’t perform that action at this time.
0 commit comments