File tree 3 files changed +18
-7
lines changed
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)
1622
1622
}
1623
1623
}
1624
1624
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
+
1625
1634
static const VMStateDescription vmstate_audio = {
1626
1635
.name = "audio" ,
1627
1636
.version_id = 1 ,
1628
1637
.minimum_version_id = 1 ,
1638
+ .needed = vmstate_audio_needed ,
1629
1639
.fields = (VMStateField []) {
1630
1640
VMSTATE_END_OF_LIST ()
1631
1641
}
Original file line number Diff line number Diff line change @@ -1646,16 +1646,14 @@ static void gd_vc_send_chars(VirtualConsole *vc)
1646
1646
1647
1647
len = qemu_chr_be_can_write (vc -> vte .chr );
1648
1648
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 ) {
1653
1650
const uint8_t * buf ;
1654
1651
uint32_t size ;
1655
1652
1656
- buf = fifo8_pop_buf (& vc -> vte .out_fifo , len , & size );
1653
+ buf = fifo8_pop_buf (& vc -> vte .out_fifo , MIN ( len , avail ) , & size );
1657
1654
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 ;
1659
1657
}
1660
1658
}
1661
1659
Original file line number Diff line number Diff line change @@ -817,7 +817,10 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
817
817
* This is a bit hackish but saves us from bigger problem.
818
818
* Maybe it's a good idea to fix this in SDL instead.
819
819
*/
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
+ }
821
824
#endif
822
825
823
826
if (SDL_Init (SDL_INIT_VIDEO )) {
You can’t perform that action at this time.
0 commit comments