Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-18 Thread Alon Levy
Hi Eric,

 I'm having trouble with the RNG approach. I've created a test rng and test xml 
with xmllint that can create the problem I am seeing, specifically:

test.rng:

?xml version=1.0?
grammar xmlns=http://relaxng.org/ns/structure/1.0; 
datatypeLibrary=http://www.w3.org/2001/XMLSchema-datatypes;
  start
ref name=video/
  /start
  define name=video
element name=video
  optional
element name=model
  attribute name=type
choice
  valuevga/value
/choice
  /attribute
  group
attribute name=type
  valueqxl/value
/attribute
optional
  attribute name=ram
  /attribute
/optional
  /group
  optional
attribute name=vram
/attribute
  /optional
/element
  /optional
/element
  /define
/grammar

With test.xml being:
video/

$ xmllint --relaxng test.rng test.xml
test.rng:9: element element: Relax-NG parser error : Attributes conflicts in 
group
Relax-NG schema test.rng failed to compile
?xml version=1.0?
video/

So it seems I cannot have two type instances. I thought maybe you can solve it 
quicker for me then myself :)

- Original Message -
 On 01/17/2013 12:35 PM, Alon Levy wrote:
  Adds a qxl-ram attribute globaly to the video.model element, that
  changes
 
 s/globaly/globally/
 
  the resulting qemu command line only if video.type == qxl.
  
  That attribute gets a default value of 64*1024 only if model.type
  is
  qxl. In effect not changing any xml or argv for non qxl devices.
  
  For qxl devices a new property is set:
  -global qxl-vga.ram_size=ram*1024
  or
  -global qxl.ram_size=ram*1024
 
 This part of the commit message shows the qemu interface; but it
 would
 also be handy to show the intended libvirt XML interface.  As
 written,
 this patch is basically adding qxl_ram into:
 
 video
   model type='qxl' vram='65536' qxl-ram='65536' heads='1'/
 /video
 
  
  For the main and secondary qxl devices respectively.
  
  The default for the qxl ram bar is the same as the default for the
  qxl
  vram bar, 64*1024.
  ---
  I've added a qxl-ram attribute.
 
 Ah, this information is what I was looking for, but because it came
 after ---, it would be missing from git history.
 
  There is no precedent for adding am attribute
  prefixed like this, so I'm open for any other suggestion on how to
  do it.
 
 Why prefix it at all?  What's wrong with just naming it 'ram', which
 is
 visually distinct from 'vram'?
 
  diff --git a/docs/schemas/domaincommon.rng
  b/docs/schemas/domaincommon.rng
  index 67ae864..50fc834 100644
  --- a/docs/schemas/domaincommon.rng
  +++ b/docs/schemas/domaincommon.rng
  @@ -2251,7 +2251,9 @@
 /define
 !--
A video adapter description, allowing configuration of device
  - model, number of virtual heads, and video ram size
  + model, number of virtual heads, and video ram size.
  + The qxl-ram property is used for qxl types only to specify
  the
  + primary bar size, letting vram specify the secondary bar
  size.
 
 Michal already pointed out the missing documentation in
 docs/formatdomain.html.in.  Basically, I would move this comment that
 you added here out of the RNG and into the public html.in
 documentation.
 
 Also, in RNG, it is possible to encode the limitation of using the
 new
 attribute only when tied to type='qxl', as follows (and here, with my
 preferred naming of 'ram' instead of 'qxl-ram'):
 
 element name=model
   choice
 attribute name=type
   choice
 valuevga/value
 valuecirrus/value
 valuevmvga/value
 valuexen/value
 valuevbox/value
   /choice
 /attribute
 group
   attribute name=type
 valueqxl/value
   /attribute
   optional
 attribute name=ram
   ref name=unsignedInt/
 /attribute
   /optional
 /group
   /choice
   optional
 attribute name=vram
   ref name=unsignedInt/
 /attribute
   /optional
 
  +++ b/src/conf/domain_conf.c
  @@ -7391,6 +7391,7 @@ virDomainVideoDefParseXML(const xmlNodePtr
  node,
   char *type = NULL;
   char *heads = NULL;
   char *vram = NULL;
  +char *qxl_ram = NULL;
 
 Again, if we go with naming the new attribute just 'ram', this
 variable
 name can be shorter.
 
  @@ -7431,6 +7433,18 @@ virDomainVideoDefParseXML(const xmlNodePtr
  node,
   }
   }
   
  +if (qxl_ram) {
  +if (virStrToLong_ui(qxl_ram, NULL, 10, def-qxl_ram)  0)
  {
  +virReportError(VIR_ERR_INTERNAL_ERROR,
  +   _(cannot parse video qxl-ram '%s'),
  qxl_ram);
  +goto error;
  +}
  +} else {

Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-18 Thread Gerd Hoffmann
  Hi,

 What is the difference between this new RAM size and what we currently
 set for ram size.  That will influence how we pick a good name, ie
 one with any qxl prefix, which is not something we can use.

It's all a bit more complicated ...

Current upstream has *four* parameters here:

qxl-vga.ram_size_mb=uint32

   Size of PCI Bar 0.  Default: 64.  VGA framebuffer lives there, also
   qxl rendering commands and parameters (image data, clip regions,
   whatever) for the qxl rendering commands.

qxl-vga.vram_size_mb=uint32

  Size of PCI Bar 1.  Default: 64.  Storage for surfaces.  Basically
  image data too, but you can do qxl raster ops on them.  X11 uses
  this for offscreen pixmaps.

qxl-vga.vram64_size_mb=uint32

  There is an (optional) 64bit version of PCI Bar 1 (Bar 5 IIRC),
  which can be mapped above 4G.  Both bars are backed by the same
  memory.

qxl-vga.vgamem_mb=uint32

  VGA framebuffer size.  Default: 16.  Specifies how much of the
  PCI bar 0 memory should be available for the VGA framebuffer.

ram_size/vramsize is there too.  Same as ram_size_mb/vram_size_mb, but
they want bytes instead of megabytes.

And to complete the picture:  The other vga cards (std, cirrus, vmware)
got vgamem_mb parameters too, which simply specify the size of the
card's memory.  For cirrus its pointless as the emulated hardware
constrains the memory size and the only reason this is configurable in
the first place is qemu - qemu-kvm live migration compatibility.  For
the other cards it  makes sense to allow tuning the vgamem_mb parameter
via domain xml.

So, how expose this to the user?

We already have 'vram'.  Adding 'ram' makes sense.  vram64 not so IMHO.
 I think it would be better to have a 64bit bool, then do this:

  if (64bit)
 qxl-vga.vram64_size_mb=${vram},vram_size_mb=1
  else
 qxl-vga.vram_size_mb=${vram}

Dunno what to do best with vgamem_mb for qxl.  One more parameter?  Or
use ram_size/4?

The other vga cards are a bit tricky too.  If you add a cirrus or stdvga
libvirt fills in vram='9216'.  Where does *that* come from btw?  It
isn't the qemu default (used to be 8 MB, now 16 MB).  It's also not the
qemu-kvm default (was 16 MB all the time).  And it isn't valid too (pci
bar size must be a power of two).  So reusing that for vgamem_mb is
probably asking for trouble.  So maybe the best and least confusing
would be to add a vgamem parameter for all vga cards (including qxl,
except cirrus)?

cheers,
  Gerd

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-18 Thread Jiri Denemark
On Fri, Jan 18, 2013 at 05:22:32 -0500, Alon Levy wrote:
 Hi Eric,
 
  I'm having trouble with the RNG approach. I've created a test rng and test 
 xml with xmllint that can create the problem I am seeing, specifically:
 
 test.rng:
 
 ?xml version=1.0?
 grammar xmlns=http://relaxng.org/ns/structure/1.0; 
 datatypeLibrary=http://www.w3.org/2001/XMLSchema-datatypes;
   start
 ref name=video/
   /start
   define name=video
 element name=video
   optional
 element name=model
   attribute name=type
 choice
   valuevga/value
 /choice
   /attribute
   group
 attribute name=type
   valueqxl/value
 /attribute
 optional
   attribute name=ram
   /attribute
 /optional
   /group

The critical part you are missing is that the attribute type=vga and the
group containing attribute type=qxl need to be within a choice element.
That is:

element name=model
  choice !-- this is important --
attribute name=type
  choice
valuevga/value
...
  /choice
/attribute
group
  attribute name=type
valueqxl/value
  /attribute
  optional
attribute name=ram/
  /optional
/group
  /choice
  ...
   optional
 attribute name=vram
 /attribute
   /optional
 /element
   /optional
 /element
   /define
 /grammar

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-18 Thread Alon Levy
 On 01/17/2013 12:35 PM, Alon Levy wrote:
  Adds a qxl-ram attribute globaly to the video.model element, that
  changes
 
 s/globaly/globally/

check.

 
  the resulting qemu command line only if video.type == qxl.
  
  That attribute gets a default value of 64*1024 only if model.type
  is
  qxl. In effect not changing any xml or argv for non qxl devices.
  
  For qxl devices a new property is set:
  -global qxl-vga.ram_size=ram*1024
  or
  -global qxl.ram_size=ram*1024
 
 This part of the commit message shows the qemu interface; but it
 would
 also be handy to show the intended libvirt XML interface.  As
 written,
 this patch is basically adding qxl_ram into:
 
 video
   model type='qxl' vram='65536' qxl-ram='65536' heads='1'/
 /video

check.

 
  
  For the main and secondary qxl devices respectively.
  
  The default for the qxl ram bar is the same as the default for the
  qxl
  vram bar, 64*1024.
  ---
  I've added a qxl-ram attribute.
 
 Ah, this information is what I was looking for, but because it came
 after ---, it would be missing from git history.
 
  There is no precedent for adding am attribute
  prefixed like this, so I'm open for any other suggestion on how to
  do it.
 
 Why prefix it at all?  What's wrong with just naming it 'ram', which
 is
 visually distinct from 'vram'?

dropped the prefix.

 
  diff --git a/docs/schemas/domaincommon.rng
  b/docs/schemas/domaincommon.rng
  index 67ae864..50fc834 100644
  --- a/docs/schemas/domaincommon.rng
  +++ b/docs/schemas/domaincommon.rng
  @@ -2251,7 +2251,9 @@
 /define
 !--
A video adapter description, allowing configuration of device
  - model, number of virtual heads, and video ram size
  + model, number of virtual heads, and video ram size.
  + The qxl-ram property is used for qxl types only to specify
  the
  + primary bar size, letting vram specify the secondary bar
  size.
 
 Michal already pointed out the missing documentation in
 docs/formatdomain.html.in.  Basically, I would move this comment that
 you added here out of the RNG and into the public html.in
 documentation.

fixed.

 
 Also, in RNG, it is possible to encode the limitation of using the
 new
 attribute only when tied to type='qxl', as follows (and here, with my
 preferred naming of 'ram' instead of 'qxl-ram'):
 
 element name=model
   choice
 attribute name=type
   choice
 valuevga/value
 valuecirrus/value
 valuevmvga/value
 valuexen/value
 valuevbox/value
   /choice
 /attribute
 group
   attribute name=type
 valueqxl/value
   /attribute
   optional
 attribute name=ram
   ref name=unsignedInt/
 /attribute
   /optional
 /group
   /choice
   optional
 attribute name=vram
   ref name=unsignedInt/
 /attribute
   /optional
 

After Jiri's help noticed you had the choice element there and I just missed it 
(should have just copy pasted..)

  +++ b/src/conf/domain_conf.c
  @@ -7391,6 +7391,7 @@ virDomainVideoDefParseXML(const xmlNodePtr
  node,
   char *type = NULL;
   char *heads = NULL;
   char *vram = NULL;
  +char *qxl_ram = NULL;
 
 Again, if we go with naming the new attribute just 'ram', this
 variable
 name can be shorter.
 
  @@ -7431,6 +7433,18 @@ virDomainVideoDefParseXML(const xmlNodePtr
  node,
   }
   }
   
  +if (qxl_ram) {
  +if (virStrToLong_ui(qxl_ram, NULL, 10, def-qxl_ram)  0)
  {
  +virReportError(VIR_ERR_INTERNAL_ERROR,
  +   _(cannot parse video qxl-ram '%s'),
  qxl_ram);
  +goto error;
  +}
  +} else {
  +if (def-type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
  +def-qxl_ram = virDomainVideoDefaultRAM(dom,
  def-type);
 
 Did you mean for it to always default to the domain default, even
 when
 vram is present but not the domain default?   Or did you want it to
 fall
 back to the vram value?

Yes, that's what I meant. I'll make sure the documentation is understood that 
way.

 
  +}
  +}
  +
   if (vram) {
 
 Since you documented that '[qxl-]ram' defaults to the value of
 'vram', I
 think you  need to put the new if block after this existing vram
 block.

Oh, now I see. I meant type value, not a copy of the computed vram value. I can 
make points for both options, i.e.
video type=qxl vram=1234/
resulting in vram=1234 and ram=1234
or resulting in vram=1234 and ram=default_vram_value (right now 64*1024)
I meant the later.

 
  @@ -13383,6 +13398,8 @@ virDomainVideoDefFormat(virBufferPtr buf,
   virBufferAddLit(buf, video\n);
   virBufferAsprintf(buf,   model type='%s',
 model);
  +if (def-qxl_ram  def-type == 

Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-17 Thread Michal Privoznik
On 17.01.2013 20:35, Alon Levy wrote:
 Adds a qxl-ram attribute globaly to the video.model element, that changes
 the resulting qemu command line only if video.type == qxl.
 
 That attribute gets a default value of 64*1024 only if model.type is
 qxl. In effect not changing any xml or argv for non qxl devices.
 
 For qxl devices a new property is set:
 -global qxl-vga.ram_size=ram*1024
 or
 -global qxl.ram_size=ram*1024
 
 For the main and secondary qxl devices respectively.
 
 The default for the qxl ram bar is the same as the default for the qxl
 vram bar, 64*1024.
 ---
 I've added a qxl-ram attribute. There is no precedent for adding am attribute
 prefixed like this, so I'm open for any other suggestion on how to do it.
 
  docs/schemas/domaincommon.rng  |  9 +++-
  src/conf/domain_conf.c | 19 ++-
  src/conf/domain_conf.h |  1 +
  src/qemu/qemu_command.c| 58 
 ++
  .../qemuxml2argv-graphics-spice-compression.args   |  2 +-
  .../qemuxml2argv-graphics-spice-compression.xml|  4 +-
  .../qemuxml2argv-graphics-spice-qxl-vga.args   |  2 +-
  .../qemuxml2argv-graphics-spice-qxl-vga.xml|  4 +-
  .../qemuxml2argv-graphics-spice.args   |  2 +-
  .../qemuxml2argv-graphics-spice.xml|  4 +-
  .../qemuxml2argv-video-device-pciaddr-default.args |  6 +--
  11 files changed, 86 insertions(+), 25 deletions(-)

Just one question - what is the difference between ram_size and
vram_size? If the former is successor of the latter, I think we should
be using the ram_size and drop vram_size and not pollute XML at all.
However, if there's any difference we should document that. That is,
every XML snippet being introduced must go hand in hand with extending
docs/format*.html.in.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-17 Thread Eric Blake
On 01/17/2013 12:35 PM, Alon Levy wrote:
 Adds a qxl-ram attribute globaly to the video.model element, that changes

s/globaly/globally/

 the resulting qemu command line only if video.type == qxl.
 
 That attribute gets a default value of 64*1024 only if model.type is
 qxl. In effect not changing any xml or argv for non qxl devices.
 
 For qxl devices a new property is set:
 -global qxl-vga.ram_size=ram*1024
 or
 -global qxl.ram_size=ram*1024

This part of the commit message shows the qemu interface; but it would
also be handy to show the intended libvirt XML interface.  As written,
this patch is basically adding qxl_ram into:

video
  model type='qxl' vram='65536' qxl-ram='65536' heads='1'/
/video

 
 For the main and secondary qxl devices respectively.
 
 The default for the qxl ram bar is the same as the default for the qxl
 vram bar, 64*1024.
 ---
 I've added a qxl-ram attribute.

Ah, this information is what I was looking for, but because it came
after ---, it would be missing from git history.

 There is no precedent for adding am attribute
 prefixed like this, so I'm open for any other suggestion on how to do it.

Why prefix it at all?  What's wrong with just naming it 'ram', which is
visually distinct from 'vram'?

 diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
 index 67ae864..50fc834 100644
 --- a/docs/schemas/domaincommon.rng
 +++ b/docs/schemas/domaincommon.rng
 @@ -2251,7 +2251,9 @@
/define
!--
   A video adapter description, allowing configuration of device
 - model, number of virtual heads, and video ram size
 + model, number of virtual heads, and video ram size.
 + The qxl-ram property is used for qxl types only to specify the
 + primary bar size, letting vram specify the secondary bar size.

Michal already pointed out the missing documentation in
docs/formatdomain.html.in.  Basically, I would move this comment that
you added here out of the RNG and into the public html.in documentation.

Also, in RNG, it is possible to encode the limitation of using the new
attribute only when tied to type='qxl', as follows (and here, with my
preferred naming of 'ram' instead of 'qxl-ram'):

element name=model
  choice
attribute name=type
  choice
valuevga/value
valuecirrus/value
valuevmvga/value
valuexen/value
valuevbox/value
  /choice
/attribute
group
  attribute name=type
valueqxl/value
  /attribute
  optional
attribute name=ram
  ref name=unsignedInt/
/attribute
  /optional
/group
  /choice
  optional
attribute name=vram
  ref name=unsignedInt/
/attribute
  /optional

 +++ b/src/conf/domain_conf.c
 @@ -7391,6 +7391,7 @@ virDomainVideoDefParseXML(const xmlNodePtr node,
  char *type = NULL;
  char *heads = NULL;
  char *vram = NULL;
 +char *qxl_ram = NULL;

Again, if we go with naming the new attribute just 'ram', this variable
name can be shorter.

 @@ -7431,6 +7433,18 @@ virDomainVideoDefParseXML(const xmlNodePtr node,
  }
  }
  
 +if (qxl_ram) {
 +if (virStrToLong_ui(qxl_ram, NULL, 10, def-qxl_ram)  0) {
 +virReportError(VIR_ERR_INTERNAL_ERROR,
 +   _(cannot parse video qxl-ram '%s'), qxl_ram);
 +goto error;
 +}
 +} else {
 +if (def-type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
 +def-qxl_ram = virDomainVideoDefaultRAM(dom, def-type);

Did you mean for it to always default to the domain default, even when
vram is present but not the domain default?   Or did you want it to fall
back to the vram value?

 +}
 +}
 +
  if (vram) {

Since you documented that '[qxl-]ram' defaults to the value of 'vram', I
think you  need to put the new if block after this existing vram block.

 @@ -13383,6 +13398,8 @@ virDomainVideoDefFormat(virBufferPtr buf,
  virBufferAddLit(buf, video\n);
  virBufferAsprintf(buf,   model type='%s',
model);
 +if (def-qxl_ram  def-type == VIR_DOMAIN_VIDEO_TYPE_QXL)
 +virBufferAsprintf(buf,  qxl-ram='%u', def-qxl_ram);

The  def-type == VIR_DOMAIN_VIDEO_TYPE_QXL is not needed here;
def-qxl_ram will be 0 for all other video types, based on the
restrictions you had in the parser.

 +++ b/src/conf/domain_conf.h
 @@ -1157,6 +1157,7 @@ struct _virDomainVideoAccelDef {
  
  struct _virDomainVideoDef {
  int type;
 +unsigned int qxl_ram;
  unsigned int vram;

Might be worth adding a comment here on units (that is, both qxl_ram and
vram use kb).

 +++ b/src/qemu/qemu_command.c
 @@ -3563,6 +3563,15 @@ qemuBuildDeviceVideoStr(virDomainVideoDefPtr video,
 UINT_MAX / 1024);
  goto error;

Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-17 Thread Daniel P. Berrange
On Thu, Jan 17, 2013 at 09:35:22PM +0200, Alon Levy wrote:
 Adds a qxl-ram attribute globaly to the video.model element, that changes
 the resulting qemu command line only if video.type == qxl.
 
 That attribute gets a default value of 64*1024 only if model.type is
 qxl. In effect not changing any xml or argv for non qxl devices.
 
 For qxl devices a new property is set:
 -global qxl-vga.ram_size=ram*1024
 or
 -global qxl.ram_size=ram*1024
 
 For the main and secondary qxl devices respectively.
 
 The default for the qxl ram bar is the same as the default for the qxl
 vram bar, 64*1024.
 ---
 I've added a qxl-ram attribute. There is no precedent for adding am attribute
 prefixed like this, so I'm open for any other suggestion on how to do it.

What is the difference between this new RAM size and what we currently
set for ram size.  That will influence how we pick a good name, ie
one with any qxl prefix, which is not something we can use.

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 :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-17 Thread Alon Levy
 On Thu, Jan 17, 2013 at 09:35:22PM +0200, Alon Levy wrote:
  Adds a qxl-ram attribute globaly to the video.model element, that
  changes
  the resulting qemu command line only if video.type == qxl.
  
  That attribute gets a default value of 64*1024 only if model.type
  is
  qxl. In effect not changing any xml or argv for non qxl devices.
  
  For qxl devices a new property is set:
  -global qxl-vga.ram_size=ram*1024
  or
  -global qxl.ram_size=ram*1024
  
  For the main and secondary qxl devices respectively.
  
  The default for the qxl ram bar is the same as the default for the
  qxl
  vram bar, 64*1024.
  ---
  I've added a qxl-ram attribute. There is no precedent for adding am
  attribute
  prefixed like this, so I'm open for any other suggestion on how to
  do it.
 
 What is the difference between this new RAM size and what we
 currently
 set for ram size.  That will influence how we pick a good name, ie
 one with any qxl prefix, which is not something we can use.

Answering you, Eric and Michal about the difference / name (I'll do a v2 for 
Eric's comments anyway):

vram is the current choice for the across the board attribute, and it is used 
for qxl devices to determine the size of the *second* bar for a qxl device, the 
surfaces bar. But there is no attribute to determine the size of the first bar. 
And it isn't good enough to say use some deterministic connection  between the 
two, like equality, because you may want to have them with different sizes and 
we don't yet know what the policy is going to be, for multiple reasons, one of 
them being that they will effect performance differently, another that seabios 
doesn't allow setting both to the size we want because of some limitations 
(512MB seabios PCI allocation hole for pre q35 and for non 64 bit guests).

So I need to add a new attribute. Eric's RNG shows how to limit the new 
attribute to qxl only by RNG instead of code, which I am glad to know and I'll 
use. The name can be changed, I wanted to make it abundantly clear to any xml 
user that this is qxl only right now, but I can change it to just ram if you 
don't think it is confusing (I do).

 
 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 :|
 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-17 Thread Alon Levy
 On 17.01.2013 20:35, Alon Levy wrote:
  Adds a qxl-ram attribute globaly to the video.model element, that
  changes
  the resulting qemu command line only if video.type == qxl.
  
  That attribute gets a default value of 64*1024 only if model.type
  is
  qxl. In effect not changing any xml or argv for non qxl devices.
  
  For qxl devices a new property is set:
  -global qxl-vga.ram_size=ram*1024
  or
  -global qxl.ram_size=ram*1024
  
  For the main and secondary qxl devices respectively.
  
  The default for the qxl ram bar is the same as the default for the
  qxl
  vram bar, 64*1024.
  ---
  I've added a qxl-ram attribute. There is no precedent for adding am
  attribute
  prefixed like this, so I'm open for any other suggestion on how to
  do it.
  
   docs/schemas/domaincommon.rng  |  9 +++-
   src/conf/domain_conf.c | 19 ++-
   src/conf/domain_conf.h |  1 +
   src/qemu/qemu_command.c| 58
   ++
   .../qemuxml2argv-graphics-spice-compression.args   |  2 +-
   .../qemuxml2argv-graphics-spice-compression.xml|  4 +-
   .../qemuxml2argv-graphics-spice-qxl-vga.args   |  2 +-
   .../qemuxml2argv-graphics-spice-qxl-vga.xml|  4 +-
   .../qemuxml2argv-graphics-spice.args   |  2 +-
   .../qemuxml2argv-graphics-spice.xml|  4 +-
   .../qemuxml2argv-video-device-pciaddr-default.args |  6 +--
   11 files changed, 86 insertions(+), 25 deletions(-)
 
 Just one question - what is the difference between ram_size and
 vram_size? If the former is successor of the latter, I think we
 should
 be using the ram_size and drop vram_size and not pollute XML at all.
 However, if there's any difference we should document that. That is,
 every XML snippet being introduced must go hand in hand with
 extending
 docs/format*.html.in.

I'll add the docs. Just to be clear, ram_size is distinct from vram_size, both 
exist at the same time, so it is not a successor.

 
 Michal
 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] qemu: Support ram bar size for qxl devices

2013-01-17 Thread Alon Levy
 On Thu, Jan 17, 2013 at 09:35:22PM +0200, Alon Levy wrote:
  Adds a qxl-ram attribute globaly to the video.model element, that
  changes
  the resulting qemu command line only if video.type == qxl.
  
  That attribute gets a default value of 64*1024 only if model.type
  is
  qxl. In effect not changing any xml or argv for non qxl devices.
  
  For qxl devices a new property is set:
  -global qxl-vga.ram_size=ram*1024
  or
  -global qxl.ram_size=ram*1024
  
  For the main and secondary qxl devices respectively.
  
  The default for the qxl ram bar is the same as the default for the
  qxl
  vram bar, 64*1024.
  ---
  I've added a qxl-ram attribute. There is no precedent for adding am
  attribute
  prefixed like this, so I'm open for any other suggestion on how to
  do it.
 
 What is the difference between this new RAM size and what we
 currently
 set for ram size.  That will influence how we pick a good name, ie
 one with any qxl prefix, which is not something we can use.

Just to be clear:
 ram_size determines the size of the first bar of the qxl device, until now 
unsettable via libvirt.
  This bar is used for: surface 0 (and VGA emulation), rendering commands, 
monitors config, ram header.
 vram_size determines the size of the second bar of the qxl device. settable 
via the vram attribute.
  This bar is used for: surface  0 allocations (aka off screen surfaces).

 
 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 :|
 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list