[libvirt] specifying cirrus ram size

Hi, In order to migrate a VM from an older system with qemu-kvm to a newer one with qemu, the newer qemu needs to be told to use the same vga ram size as qemu-kvm used, 8M. virsh domxml-from-native suggests that the way to specify a 8mb cirrus vga ram size would be to add <qemu:commandline> <qemu:arg value='-global'/> <qemu:arg value='cirrus-vga.vgamem_mb=8'/> </qemu:commandline> However whenever I edit a .xml to add this, it disappears. I'm adding it right before the ending </domain> Am I doing something silly? thanks, -serge

On 03/18/2014 03:59 PM, Serge Hallyn wrote:
Hi,
In order to migrate a VM from an older system with qemu-kvm to a newer one with qemu, the newer qemu needs to be told to use the same vga ram size as qemu-kvm used, 8M.
virsh domxml-from-native suggests that the way to specify a 8mb cirrus vga ram size would be to add
<qemu:commandline> <qemu:arg value='-global'/> <qemu:arg value='cirrus-vga.vgamem_mb=8'/> </qemu:commandline>
This points out a weakness in our code - <qemu:commandline> is intentionally unsupported, which means our XML needs an actual parameter for this, rather than forcing you back to qemu:commandline. Or maybe we already have the parameter, in which case the bug is in the domxml-from-native code for not recognizing this particular usage of command line arguments. But a quick grep for vgamem_mb doesn't have any hits in current src/qemu/qemu_command.c, so it looks like we don't support it yet.
However whenever I edit a .xml to add this, it disappears.
When outputting <qemu:commandline> in domxml-from-native, you must also output the xmlns directive that enables its use. domxml-from-native is correctly doing it, but doing it at the very first <domain> which is quite some distance away, so you probably missed that key point. See http://libvirt.org/drvqemu.html#qemucommand
Am I doing something silly?
You're forgetting <domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Quoting Eric Blake (eblake@redhat.com):
On 03/18/2014 03:59 PM, Serge Hallyn wrote:
Hi,
In order to migrate a VM from an older system with qemu-kvm to a newer one with qemu, the newer qemu needs to be told to use the same vga ram size as qemu-kvm used, 8M.
virsh domxml-from-native suggests that the way to specify a 8mb cirrus vga ram size would be to add
<qemu:commandline> <qemu:arg value='-global'/> <qemu:arg value='cirrus-vga.vgamem_mb=8'/> </qemu:commandline>
This points out a weakness in our code - <qemu:commandline> is intentionally unsupported, which means our XML needs an actual parameter for this, rather than forcing you back to qemu:commandline. Or maybe we already have the parameter, in which case the bug is in the
tbh I originally expected <model type='cirrus' vram='8192'> to work, but it seemed to be ignored.
domxml-from-native code for not recognizing this particular usage of command line arguments. But a quick grep for vgamem_mb doesn't have any hits in current src/qemu/qemu_command.c, so it looks like we don't support it yet.
However whenever I edit a .xml to add this, it disappears.
When outputting <qemu:commandline> in domxml-from-native, you must also output the xmlns directive that enables its use. domxml-from-native is correctly doing it, but doing it at the very first <domain> which is quite some distance away, so you probably missed that key point. See http://libvirt.org/drvqemu.html#qemucommand
Am I doing something silly?
You're forgetting <domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
Thanks, Eric, that does work. Now unfortunately this turns out to not solve the problem, which is to allow migration through libvirt from a qemu-kvm VM, with 8M vga ram, to a qemu VM with 10M vga ram. We can specify the 8M custom ram size at the destination, but when migrating the original VMs parameters get copied over. And the old qemu-kvm does not support the cirrus-vga.vgamem_mb parameter. As far as I know there is no way to 'seed' a set of new parameters for the destination, so that we could say "migrate this VM to that host and add the following bits to the xml spec - am I by chance wrong on that? thanks, -serge

On Wed, Mar 19, 2014 at 12:49:06AM -0500, Serge Hallyn wrote:
Quoting Eric Blake (eblake@redhat.com):
On 03/18/2014 03:59 PM, Serge Hallyn wrote:
Hi,
In order to migrate a VM from an older system with qemu-kvm to a newer one with qemu, the newer qemu needs to be told to use the same vga ram size as qemu-kvm used, 8M.
virsh domxml-from-native suggests that the way to specify a 8mb cirrus vga ram size would be to add
<qemu:commandline> <qemu:arg value='-global'/> <qemu:arg value='cirrus-vga.vgamem_mb=8'/> </qemu:commandline>
This points out a weakness in our code - <qemu:commandline> is intentionally unsupported, which means our XML needs an actual parameter for this, rather than forcing you back to qemu:commandline. Or maybe we already have the parameter, in which case the bug is in the
tbh I originally expected <model type='cirrus' vram='8192'> to work, but it seemed to be ignored.
Yes, that ought to work but it is possible we only ever plumbed it in for QXL, since historically you couldn't change ram for other drivers. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Mi, 2014-03-19 at 10:22 +0000, Daniel P. Berrange wrote:
On Wed, Mar 19, 2014 at 12:49:06AM -0500, Serge Hallyn wrote:
Quoting Eric Blake (eblake@redhat.com):
On 03/18/2014 03:59 PM, Serge Hallyn wrote:
Hi,
In order to migrate a VM from an older system with qemu-kvm to a newer one with qemu, the newer qemu needs to be told to use the same vga ram size as qemu-kvm used, 8M.
virsh domxml-from-native suggests that the way to specify a 8mb cirrus vga ram size would be to add
In theory this should not be needed, -M pc-$version and compat properties should take care. In practice there probably is a hickup due to upstream qemu using 8M by default and qemu-kvm using 16M by default.
tbh I originally expected <model type='cirrus' vram='8192'> to work, but it seemed to be ignored.
Yes, that ought to work but it is possible we only ever plumbed it in for QXL, since historically you couldn't change ram for other drivers.
For cirrus this is pretty pointless. We emulate old, existing hardware here and increasing the memory size buys you nothing as real cirrus hardware isn't able to address more memory. Even the 16M we have today are more than cirrus is able to handle and it being there is more or less a historic accident: qemu-kvm bumped video memory from 8 to 16 MB for both stdvga and cirrus without checking how useful that is. For stdvga I have a rfe bug open ;) cheers, Gerd
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Gerd Hoffmann
-
Serge Hallyn