qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compatibility between -device sga and -machine graphics=off


From: Daniel P . Berrangé
Subject: Compatibility between -device sga and -machine graphics=off
Date: Wed, 8 Sep 2021 17:08:08 +0100
User-agent: Mutt/2.0.7 (2021-05-04)

Given the libvirt XML snippet

  <os>
    ...
    <bios useserial="yes"/>
    ...
  </os>

libvirt QEMU driver will always format

  -device sga

Libguestfs uses this syntax, so we need to make sure it still works
in future even if 'sga' is disabled or removed in a QEMU build in
favour of SeaBIOS' built-in support.


There are the following combinations that matter

 1. Graphical display only, no serial port, BIOS to graphical display

     <video>
       <model type='vga'/>
     </video>

   QEMU cli

     -device VGA


 2. Serial port only, no graphics, BIOS to nowhere

     <serial type='pty'/>

   QEMU cli

     -serial pty


 3. Serial port only, no graphics, BIOS to serial

     <os>
       <bios useserial='yes'/>
     </os>
     <serial type='pty'/>

   QEMU cli

     -serial pty -device sga
     -serial pty -M graphics=off


 4. Graphical display, serial port, BIOS only to graphical display

     <video>
       <model type='vga'/>
     </video>
     <serial type='pty'/>

   QEMU cli

     -device VGA -serial pty


 5. Graphical display, serial port, BIOS to graphical display + serial

     <os>
       <bios useserial='yes'/>
     </os>
     <video>
       <model type='vga'/>
     </video>
     <serial type='pty'/>

   QEMU cli

     -device VGA -serial pty -device sga
     -device VGA -serial pty -M graphics=off



The cases 3 and 5 appear to have the same effect on output with x86
for SGA and graphics=off, which is good.

If I do 'info mtree' though, I do see a different memory layout
when changing from SGA to graphics=off


@@ -18,7 +18,7 @@
     00000000000c0000-00000000000c3fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c0000-00000000000c3fff
     00000000000c4000-00000000000c7fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c4000-00000000000c7fff
     00000000000c8000-00000000000cbfff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c8000-00000000000cbfff
-    00000000000cb000-00000000000cdfff (prio 1000, ram): alias kvmvapic-rom 
@pc.ram 00000000000cb000-00000000000cdfff
+    00000000000ca000-00000000000ccfff (prio 1000, ram): alias kvmvapic-rom 
@pc.ram 00000000000ca000-00000000000ccfff
     00000000000cc000-00000000000cffff (prio 1, ram): alias pam-rom @pc.ram 
00000000000cc000-00000000000cffff
     00000000000d0000-00000000000d3fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000d0000-00000000000d3fff
     00000000000d4000-00000000000d7fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000d4000-00000000000d7fff
@@ -109,7 +109,7 @@
     00000000000c0000-00000000000c3fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c0000-00000000000c3fff
     00000000000c4000-00000000000c7fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c4000-00000000000c7fff
     00000000000c8000-00000000000cbfff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c8000-00000000000cbfff
-    00000000000cb000-00000000000cdfff (prio 1000, ram): alias kvmvapic-rom 
@pc.ram 00000000000cb000-00000000000cdfff
+    00000000000ca000-00000000000ccfff (prio 1000, ram): alias kvmvapic-rom 
@pc.ram 00000000000ca000-00000000000ccfff
     00000000000cc000-00000000000cffff (prio 1, ram): alias pam-rom @pc.ram 
00000000000cc000-00000000000cffff
     00000000000d0000-00000000000d3fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000d0000-00000000000d3fff
     00000000000d4000-00000000000d7fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000d4000-00000000000d7fff
@@ -185,7 +185,7 @@
     00000000000c0000-00000000000c3fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c0000-00000000000c3fff
     00000000000c4000-00000000000c7fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c4000-00000000000c7fff
     00000000000c8000-00000000000cbfff (prio 1, ram): alias pam-rom @pc.ram 
00000000000c8000-00000000000cbfff
-    00000000000cb000-00000000000cdfff (prio 1000, ram): alias kvmvapic-rom 
@pc.ram 00000000000cb000-00000000000cdfff
+    00000000000ca000-00000000000ccfff (prio 1000, ram): alias kvmvapic-rom 
@pc.ram 00000000000ca000-00000000000ccfff
     00000000000cc000-00000000000cffff (prio 1, ram): alias pam-rom @pc.ram 
00000000000cc000-00000000000cffff
     00000000000d0000-00000000000d3fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000d0000-00000000000d3fff
     00000000000d4000-00000000000d7fff (prio 1, ram): alias pam-rom @pc.ram 
00000000000d4000-00000000000d7fff


Despite this difference, I was able migrate from a x86 guest using SGA
to a guest using graphics=off without errors being reported. So it
doesn't seem to change the migration data sections sent on the wire
at least.

With this in mind, is the different memory layout harmless from the
POV of migration, or is it none the less going to cause subtle
problems for the guest at some point in future ?


On non-x86 emulators I see graphics=off has semantic effects beyond
just controlling whether the firmware prints to the serial or not
though. IOW it is overloaded to do multiple jobs, while -device sga
only did one specific job. This makes graphics=off somewhat undesirable
to use.  We're possibly lucky in this specific case though, because
the 'sgabios.bin' ROM is x86 asm code, so was never valid to use in
the non-x86 case.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]