Commit Graph

1542 Commits

Author SHA1 Message Date
Eric Blake
dd0dda2e4a schema: fix idmap validation
When idmap was added to LXC, we forgot to cover it in the testsuite.
The schema was missing an <element> layer, and as a result,
virt-xml-validate was failing on valid dumpxml output.

Reported by Eduard - Gabriel Munteanu on IRC.

* docs/schemas/domaincommon.rng (idmap): Include <idmap> element,
and support interleaves.
* tests/lxcxml2xmldata/lxc-idmap.xml: New file.
* tests/lxcxml2xmltest.c (mymain): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-01-10 10:54:14 -07:00
Chen Hanxiao
8560093394 docs: add LXC multi console command docs and a example
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-01-08 11:16:10 +01:00
Eric Blake
db3dd0824f maint: improve VIR_ERR_INVALID_CONN usage
The datatype.c object checks could result in a message like:

error: invalid connection pointer in no connection

This consolidates all clients of this message to have uniform contents:

error: invalid connection pointer in someFunc

Note that virCheckConnectReturn raises an error immediately; in
datatypes.c, where we don't need to raise the error (but instead
just leave it in the thread-local setting), we use
virCheckConnectGoto and the cleanup label instead.  Then, for
consistency in that file, all subsequent error messages are
touched to also use the cleanup error label.

* src/datatypes.h (virCheckConnectReturn)
(virCheckConnectGoto): New macros.
* src/datatypes.c: Use new macro.
* src/libvirt-qemu.c (virDomainQemuAttach): Likewise.
(virLibConnError): Delete unused macro.
* src/libvirt-lxc.c (virLibConnError): Likewise.
* src/libvirt.c: Use new macro throughout.
* docs/api_extension.html.in: Modernize documentation.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-01-06 21:41:02 -07:00
Pranavkumar Sawargaonkar
27e32e0f3d AArch64: Porting of armv7l conditons to run qemu for aarch64.
AArch64 qemu has similar behavior as armv7l, like use of mmio etc.
This patch adds similar bypass checks what we have for armv7l to aarch64.
E.g. we are enabling mmio transport for Nicdev.
Making addDefaultUSB and addDefaultMemballoon to false etc.

V3:
- Adding missing domain rng schema for aarcg64 and test case in
  testutilsqemu.c which was causing test suite failure
  while running make check.

V2:
- Added testcase to qemuxml2argvtest as suggested
  during review comments of V1.

V1:
- Initial patch.

Signed-off-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
2014-01-06 11:02:24 -05:00
Peter Krempa
32487c86c6 snapshot: schema: Split out snapshot disk driver definition
Extract the definition to a new type to allow avoiding of duplication.
2013-12-19 10:20:56 +01:00
Martin Kletzander
316e4d93eb docs: fix address type for disks
Disks have type='drive', not type='disk'.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2013-12-17 11:00:12 +01:00
Hu Tao
4313feade4 conf: add support for panic device
panic device is a device that enables libvirt to receive notification
of guest panic event.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-12-12 21:17:26 -07:00
Hu Tao
f1a039ef57 conf: introduce generic ISA address
For example:
<address type='isa' iobase='0x505' irq='0x1'/>

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-12-12 21:11:21 -07:00
Eric Blake
a5a8bd54b7 docs: fix recent typo
Introduced in commit 24fbbb82.

* docs/formatdomain.html.in: s/tunning/tuning/

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-12-10 07:04:58 -07:00
Jiri Denemark
24fbbb8263 docs: Enhance memoryBacking/locked documentation
Mention the need to set memtune/hard_limit.

https://bugzilla.redhat.com/show_bug.cgi?id=1035954
2013-12-09 15:43:47 +01:00
Peter Krempa
be904e4eeb conf: Fix XML formatting of RNG device info
https://bugzilla.redhat.com/show_bug.cgi?id=1035118

When outputting the XML for the RNG device, the code didn't format the
PCI address info. Additionally the schema wasn't expecting the info
although it was being parsed and used internally. Fix those mistakes and
add test for the PCI info section.
2013-12-06 11:03:56 +01:00
Eric Blake
00b019b5ad docs: fix some typos
* docs/auditlog.html.in: Spelling fixes.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-12-02 11:59:18 -07:00
Daniel Veillard
4e41a2a370 Release of libvirt-1.2.0
* configure.ac docs/news.html.in libvirt.spec.in: update for release
* po/*.po*: update and merge localizations from transifex
2013-12-02 12:17:51 +08:00
Daniel P. Berrange
484b60409c Link libvirt-sandbox from apps page
Add a link to the http://sandbox.libvirt.org sub-site from the
list of libraries related to libvirt. Also fix formatting for
the ruby libvirt binding.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-12-02 10:46:40 +08:00
Daniel P. Berrange
84fe15c332 Add docs about audit subsystem logging
Adds a new page to the website "Deployment" section describing
what data is sent to the audit logs and how to configure libvirtd
audit settings.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-12-02 10:43:44 +08:00
Nehal J Wani
968a46923a Fix typos in various docs
Fix 8 minor spelling errors in docs/*.html.in
2013-12-02 10:21:26 +08:00
Gao feng
6616582cf6 LXC: add securetty related note in Device nodes
Tell user how to resolve the problem that fail to log in
the container.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
2013-11-26 16:50:05 +00:00
Yuri Chornoivan
73a03e3063 Fix three minor typos 2013-11-26 18:37:09 +08:00
Eric Blake
ecd881b7a7 storage: add network-dir as new storage volume type
In the 'directory' and 'netfs' storage pools, a user can see
both 'file' and 'dir' storage volume types, to know when they
can descend into a subdirectory.  But in a network-based storage
pool, such as the upcoming 'gluster' pool, we use 'network'
instead of 'file', and did not have any counterpart for a
directory until this patch.  Adding a new volume type
'network-dir' is better than reusing 'dir', because it makes
it clear that the only way to access 'network' volumes within
that container is through the network mounting (leaving 'dir'
for something accessible in the local file system).

* include/libvirt/libvirt.h.in (virStorageVolType): Expand enum.
* docs/formatstorage.html.in: Document it.
* docs/schemasa/storagevol.rng (vol): Allow new value.
* src/conf/storage_conf.c (virStorageVol): Use new value.
* src/qemu/qemu_command.c (qemuBuildVolumeString): Fix client.
* src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Likewise.
* tools/virsh-volume.c (vshVolumeTypeToString): Likewise.
* src/storage/storage_backend_fs.c
(virStorageBackendFileSystemVolDelete): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-25 12:29:49 -07:00
Eric Blake
ed5fa7f393 storage: document gluster pool
Add support for a new <pool type='gluster'>, similar to
RBD and Sheepdog.  Terminology wise, a gluster volume
forms a libvirt storage pool, within the gluster volume,
individual files are treated as libvirt storage volumes.

* docs/schemas/storagepool.rng (poolgluster): New pool type.
* docs/formatstorage.html.in: Document gluster.
* docs/storage.html.in: Likewise, and contrast it with netfs.
* tests/storagepoolxml2xmlin/pool-gluster.xml: New test.
* tests/storagepoolxml2xmlout/pool-gluster.xml: Likewise.
* tests/storagepoolxml2xmltest.c (mymain): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-25 11:03:19 -07:00
Eric Blake
1b5c8d4cbc storage: expose volume meta-type in XML
I got annoyed at having to use both 'virsh vol-list $pool --details'
AND 'virsh vol-dumpxml $vol $pool' to learn if I had populated
the volume correctly.  Since two-thirds of the data present in
virStorageVolGetInfo() already appears in virStorageVolGetXMLDesc(),
this just adds the remaining piece of information, as:

<volume type='...'>
  ...
</volume>

* docs/formatstorage.html.in: Document new <volume type=...>.
* docs/schemas/storagevol.rng (vol): Add it to RelaxNG.
* src/conf/storage_conf.h (virStorageVolTypeToString): Declare.
* src/conf/storage_conf.c (virStorageVolTargetDefFormat): Output
the metatype.
(virStorageVolDefParseXML): Parse it, for unit tests.
* tests/storagevolxml2xmlout/vol-*.xml: Update tests to match.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-25 10:55:19 -07:00
Eric Blake
f5580bd6d6 storage: allow interleave in volume XML
The RNG grammar did not allow arbitrary interleaving, which makes
it harder than necessary to create a new volume from handwritten XML.
(Compare also to commit caf516db for pools).

* docs/schemas/storagevol.rng: Support interleaving.
* tests/storagevolxml2xmlin/vol-file-backing.xml: Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-25 07:51:14 -07:00
Martin Kletzander
d96b08bb24 build: Don't fail on '&lt;' or '&gt;' with old xmllint
Older xmllint version don't allow such characters in datatype anyURI.
In order not to change too much, I'm suggesting making a choice of
anyURI or 'absPathName' which should be fine (checked with upstream
and that old xmllint, both work fine).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2013-11-22 05:31:15 +01:00
Eric Blake
6cc4d6a3fe storage: use valid XML for awkward volume names
$ touch /var/lib/libvirt/images/'a<b>c'
$ virsh pool-refresh default
$ virsh vol-dumpxml 'a<b>c' default | head -n2
<volume>
  <name>a<b>c</name>

Oops.  That's not valid XML.  And when we fix the XML
generation, it fails RelaxNG validation.

I'm also tired of seeing <key>(null)</key> in the example
output for volume xml; while we used NULLSTR() to avoid
a NULL deref rather than relying on glibc's printf
extension behavior, it's even better if we avoid the issue
in the first place.  But this requires being careful that
we don't invalidate any storage backends that were relying
on key being unassigned during virStoragVolCreateXML[From].

I would have split this into two patches (one for escaping,
one for avoiding <key>(null)</key>), but since they both
end up touching a lot of the same test files, I ended up
merging it into one.

Note that this patch allows pretty much any volume name
that can appear in a directory (excluding . and .. because
those are special), but does nothing to change the current
(unenforced) RelaxNG claim that pool names will consist
only of letters, numbers, _, -, and +.  Tightening the C
code to match RelaxNG patterns and/or relaxing the grammar
to match the C code for pool names is a task for another
day (but remember, we DID recently tighten C code for
domain names to exclude a leading '.').

* src/conf/storage_conf.c (virStoragePoolSourceFormat)
(virStoragePoolDefFormat, virStorageVolTargetDefFormat)
(virStorageVolDefFormat): Escape user-controlled strings.
(virStorageVolDefParseXML): Parse key, for use in unit tests.
* src/storage/storage_driver.c (storageVolCreateXML)
(storageVolCreateXMLFrom): Ensure parsed key doesn't confuse
volume creation.
* docs/schemas/basictypes.rng (volName): Relax definition.
* tests/storagepoolxml2xmltest.c (mymain): Test it.
* tests/storagevolxml2xmltest.c (mymain): Likewise.
* tests/storagepoolxml2xmlin/pool-dir-naming.xml: New file.
* tests/storagepoolxml2xmlout/pool-dir-naming.xml: Likewise.
* tests/storagevolxml2xmlin/vol-file-naming.xml: Likewise.
* tests/storagevolxml2xmlout/vol-file-naming.xml: Likewise.
* tests/storagevolxml2xmlout/vol-*.xml: Fix fallout.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-21 17:29:47 -07:00
Eric Blake
78b139b0bd maint: enforce comma style usage
Enforce and document the style set up by the previous patches.

* build-aux/bracket-spacing.pl: Add comma checks.
* docs/hacking.html.in: Document the rules.
* HACKING: Regenerate.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-20 09:24:18 -07:00
Chen Hanxiao
18037b5f1c docs: fix a typo in formatnwfilter.html.in
s/insallations/installations/

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-11-15 06:00:49 -07:00
Eric Blake
887dd3625b storage: fix RNG validation of gluster via netfs
While trying to compare netfs against my new gluster pool, I
discovered two things:

virt-xml-validate chokes on valid xml produced by 'virsh pool-dumpxml'
[yet another reason that ALL patches that add new xml should be adding
corresponding tests]

When using glusterfs FUSE mounts, you cannot access a subdirectory
of a gluster volume.  The recommended workaround in the gluster
community is to mount the volume to an intermediate location, then
bind-mount the desired subdirectory to the final location.  Maybe
we should teach libvirt to do bind-mounting, but for now I chose to
just document the limitation.

* docs/storage.html.in: Improve documentation.
* docs/schemas/storagepool.rng (sourcefmtnetfs): Allow all
formats, and drop redundant info-vendor.
* tests/storagepoolxml2xmltest.c (mymain): New test.
* tests/storagepoolxml2xmlin/pool-netfs-gluster.xml: New file.
* tests/storagepoolxml2xmlout/pool-netfs-gluster.xml: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-13 12:10:00 -07:00
Daniel P. Berrange
7f2b173feb Improve cgroups docs to cover systemd integration
As of libvirt 1.1.1 and systemd 205, the cgroups layout used by
libvirt has some changes. Update the 'cgroups.html' file from
the website to describe how it works in a systemd world.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-12 11:23:00 +00:00
Peter Krempa
e0dc851164 qemu: Add support for paravirtual spinlocks in the guest
The linux kernel recently added support for paravirtual spinlock
handling to avoid performance regressions on overcomitted hosts. This
feature needs to be turned in the hypervisor so that the guest OS is
notified about the possible support.

This patch adds a new feature "paravirt-spinlock" to the XML and
supporting code to enable the "kvm_pv_unhalt" pseudo CPU feature in
qemu.

https://bugzilla.redhat.com/show_bug.cgi?id=1008989
2013-11-08 09:44:42 +01:00
Ján Tomko
eab51940bd Allow root directory in filesystem source dir schema
Use absDirPath instead of absFilePath.

https://bugzilla.redhat.com/show_bug.cgi?id=1028107
2013-11-07 18:43:15 +01:00
Jonathan Lebon
3897975eea add SystemTap to apps using libvirt
Starting from v2.4 (released today!), SystemTap can use libvirt to
execute scripts inside virtual machines.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-06 15:26:35 -07:00
Chen Hanxiao
1502029100 docs: fix a typo in formatnwfilter
s/fragement/fragment

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-11-06 16:45:18 +01:00
Daniel Veillard
a4a7c7e9c4 Release of libvirt-1.1.4
* configure.ac docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: update localizations from transifex and regenerate
2013-11-04 12:30:41 +08:00
Claudio Bley
5eb3dff5b6 docs: generate links from plain text documentation
There are two forms used throughout libvirt code comments, which
are both supported by this patch.

* plain links like e.g. http://www.libvirt.org/
* links enclosed in <> characters, e.g. <http://www.libvirt.org/>

Signed-off-by: Claudio Bley <cbley@av-test.de>
2013-10-30 17:30:12 +01:00
Claudio Bley
3a77ecac2a docs: define style of code blocks inside descriptions 2013-10-30 17:30:12 +01:00
Claudio Bley
d2ee3bbfa0 docs: add class "description" to div's containing descriptions 2013-10-30 17:30:11 +01:00
Claudio Bley
8213f6c38e docs: process code blocks similar to Markdown
Wrap pre-formatted example code in <code> elements. This works
similar to Markdown[1] code blocks[2]:

Every line indented with at least 2 spaces is considered a code
block and gets wrapped in <pre> and <code> tags.

Look at the documentation for e.g. virStreamSend for before-and-after
effects.

[1] http://daringfireball.net/projects/markdown/
[2] http://daringfireball.net/projects/markdown/syntax#precode
2013-10-30 17:30:11 +01:00
Chen Hanxiao
d70840f68d docs: fix typos in formatnwfilter
s/initated/initiated

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-10-30 08:55:06 +01:00
Giuseppe Scrivano
b51038a4cd capabilities: add baselabel per sec driver/virt type to secmodel
Expand the "secmodel" XML fragment of "host" with a sequence of
baselabel's which describe the default security context used by
libvirt with a specific security model and virtualization type:

<secmodel>
  <model>selinux</model>
  <doi>0</doi>
  <baselabel type='kvm'>system_u:system_r:svirt_t:s0</baselabel>
  <baselabel type='qemu'>system_u:system_r:svirt_tcg_t:s0</baselabel>
</secmodel>
<secmodel>
  <model>dac</model>
  <doi>0</doi>
  <baselabel type='kvm'>107:107</baselabel>
  <baselabel type='qemu'>107:107</baselabel>
</secmodel>

"baselabel" is driver-specific information, e.g. in the DAC security
model, it indicates USER_ID:GROUP_ID.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-29 07:06:04 -06:00
Chen Hanxiao
b695aeebd5 doc: fix a typo in formatdomain
s/no/not

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-10-25 09:11:12 +01:00
Chen Hanxiao
dc33207dbe docs: fix some typos about 'informations'
s/informations/information

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-10-22 09:47:19 +01:00
Chen Hanxiao
8d35f9dbad docs: fix a typo in formatdomain
s/effect/affect

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-10-21 10:25:29 +02:00
Jiri Denemark
34adf622a3 docs: Expand description of host-model CPU mode
host-model is a nice idea but it's current implementation make it
useless on some hosts so it should be used with care.
2013-10-18 16:35:57 +02:00
Eric Blake
caf516db51 storage: allow interleave in pool XML
The RNG grammar did not allow arbitrary interleaving, which makes
it harder than necessary to create a new pool from handwritten XML.

* docs/schemas/storagepool.rng: Allow interleaving.
* tests/storagepoolxml2xmlin/pool-sheepdog.xml: Test interleave.
* tests/storagepoolxml2xmlin/pool-iscsi-auth.xml: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-16 10:15:44 -06:00
Eric Blake
59dce8d278 storage: document existing pools
We forgot to document several pool types.

* docs/formatstorage.html.in: Add docs for scsi, mpath, rbd, and
sheepdog.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-16 09:57:31 -06:00
Pranavkumar Sawargaonkar
9f53ffcb81 AArch64: Add qemu capabilities schemeta for test.
Add qemu AArch64 capabilities schemeta in caps-qemu-kvm.xml.

Signed-off-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>

(crobinso: add aarch64 to schema arch list)
2013-10-15 17:02:17 -04:00
Peter Krempa
c4caa012c2 schema: Rename option 'hypervtristate' to 'featurestate'
Change the RelaxNG schema option name so that it can be reused for
non-hyperv feature flags.
2013-10-15 16:42:45 +02:00
Chen Hanxiao
b8b22d1969 docs: change the minimum weight description for blkio
Since 2.6.39, kernel changed the minimum weight of device blkio.
Update related docs.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2013-10-15 12:17:40 +01:00
Daniel P. Berrange
8f35fd21cc Add some notes about secure usage of libvirt
Start a page describing some of the things that applications
using libvirt need to bear in mind to ensure security of their
systems.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-10-15 11:33:01 +01:00
Peter Krempa
f094aaac48 qemu: Prefer VFIO for PCI device passthrough
Prefer using VFIO (if available) to the legacy KVM device passthrough.

With this patch a PCI passthrough device without the driver configured
will be started with VFIO if it's available on the host. If not legacy
KVM passthrough is checked and error is reported if it's not available.
2013-10-10 12:00:56 +02:00