Commit Graph

16 Commits

Author SHA1 Message Date
Lin Ma
40f70d4fe5 virt-install: add param cache.mode and cache.level for option '--cpu'
libvirt supports guest CPU cache by commit df13c0b, So add this feature
to virt-install to configure cpu L3 cache mode.

Currently, The valid values are 'passthrough', 'emulate' or 'disable'.
say:
  --cpu host-passthrough,cache.mode=passthrough
or
  --cpu $CPU,cache.mode=emulate,cache.level=3
or
  --cpu $CPU,cache.mode=disable

Signed-off-by: Lin Ma <lma@suse.com>
2017-09-14 18:54:01 -04:00
Pavel Hrdina
07eecfdcc7 virtinst.cpu: don't validate "cpus" for NUMA cells
This attribute doesn't set pinning to host CPUs, it configures which
guest vCPUs should belong to that guest NUMA node.  If a guest has
more vCPUs than host you wouldn't be able to configure all guest
vCPUs to the NUMA nodes for guest.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-04 19:09:27 +02:00
Cole Robinson
a3508f2269 cpu: clear config first if user requests host-model-only
Clears the existing CPU config if user picks 'Application Default'
in the virt-manager UI, since otherwise we might leave a stale vendor
or flags defined.
2017-03-05 14:04:42 -05:00
Cole Robinson
19b4cf026e cli: Support --cpu cellX.id (and cpus, and memory)
This allows configuring <cpu><numa><cell> bits via the command line.
This uses the optional numbering scheme described in the previous
commit.
2016-06-14 19:07:55 -04:00
Cole Robinson
acfb988945 xmlbuilder: Make _add_child and _remove_child public
We have a lot of functions that are just wrappers around these, so
make it public for future use.
2015-09-04 15:47:43 -04:00
Pavel Hrdina
a9b303fb14 virtinst.cpu: fix copy host cpu definition
Commit cac4ac14 updated cpu features to use XMLBuilder and this change
removes the 'Features' class.  There is no longer any '.names()'
method to return names, so just cycle through all features and use a
name attribute instead.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1240938

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-07-14 11:53:02 -04:00
Cole Robinson
dc1737e623 cpu: Drop vendor and features if setting host-model (bz 1190851)
Otherwise via virt-manager we can try to set a <cpu> with a <vendor>
but no <model>, and libvirt complains.
2015-03-26 17:08:15 -04:00
Cole Robinson
eb7612356e virtinst: Switch to relative imports, fix cyclic import warnings 2014-09-12 16:28:38 -04:00
Cole Robinson
f5c32063e4 wip 2014-02-05 14:09:05 -05:00
Cole Robinson
427400d3f3 virtinst: cpu: Reorder feature bits to match libvirt XML order 2014-01-31 13:44:50 -05:00
Giuseppe Scrivano
2a040ccd17 mass update: remove double spaces from comments
Updated by this script:

find -name '*.py' -exec sed -i "s|^\(#.*[^.?\!]\)  \(.*[^#]\)$|\1 \2|g" \{\} \;

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:31 +01:00
Giuseppe Scrivano
0df75c7603 headers: update "Red Hat, Inc." copyright for the year 2013
Ensure that any file touched by a @redhat.com author in 2013 has an
updated copyright header.

The files were updated using the build-aux/update-copyright gnulib
script and manually added where the copyright line wasn't present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:26 +01:00
Cole Robinson
99a50de53e Simplify XMLProperty declarations 2013-09-19 13:31:33 -04:00
Cole Robinson
0be727e6bb xmlbuilder: Track singleton child properties explicitly
Things like Guest.Seclabel, VirtualDevice.VirtualAlias, etc.

Now we don't need to track a full xpath with each class, just its root
name and we build its hierarchy depending on its parent.
2013-09-19 13:31:33 -04:00
Cole Robinson
eb4068cc47 xmlbuilder: Add infrastructure for parsing into subclasses
We already had this open coded in several classes with varying methods.
Now all someone has to do is

features = XMLChildProperty(CPUFeature)

The xmlbuilder code will pull the relevant xpath from the CPUFeature class,
handling parsing into instances of that class directly. The only
thing that needs to be manually added is the add_* remove_* functions.
2013-09-10 21:34:45 -04:00
Cole Robinson
952708f509 virtinst: Rename most files to be more sensible
- Lower case everything
- Virtual... -> device...
- A few other similar bits
2013-08-09 08:54:39 -04:00