Commit Graph

3483 Commits

Author SHA1 Message Date
Chris Lalancette
0d77396605 Update the documentation for virDomainMigrateToURI
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-28 16:27:04 +01:00
Paolo Bonzini
936565c701 Add support for an external TFTP boot server
This patch adds an optional attribute to the <bootp> tag, that
allows to specify a TFTP server address other than the address of
the DHCP server itself.

This can be used to forward the BOOTP settings of the host down to the
guest.  This is something that configurations such as Xen's default
network achieve naturally, but must be done manually for NAT.

* docs/formatnetwork.html.in: Document new attribute.
* docs/schemas/network.rng: Add it to schema.
* src/conf/network_conf.h: Add it to struct.
* src/conf/network_conf.c: Add it to parser and pretty printer.
* src/network/bridge_driver.c: Put it in the dnsmasq command line.
* tests/networkxml2xmlin/netboot-proxy-network.xml
  tests/networkxml2xmlout/netboot-proxy-network.xml
  tests/networkxml2xmltest.c: add new tests
2009-10-28 15:57:49 +01:00
Cole Robinson
16c1c0833b test: Support virNodeDeviceCreate and virNodeDeviceDestroy 2009-10-27 10:03:51 -04:00
Dan Kenigsberg
0b74bc622c Fix some typos in comments 2009-10-27 00:02:46 +01:00
Matthias Bolte
74c81b5d93 Fix problems in the Xen inotify driver.
In xenInotifyXendDomainsDirLookup() the wrong UUID variable is used
to search in the config info list.

In xenInotifyEvent() the event is dispatched if it's NULL.

Both were introduced in bc898df2c7.
2009-10-26 23:30:19 +01:00
Matthias Bolte
dfdfc601ac Fix error message in qemudLoadDriverConfig()
* src/qemu/qemu_conf.c: change the error message to refer to
  'cgroup_controllers' instead of 'cgroup_device_acl'
2009-10-26 23:30:19 +01:00
Chris Lalancette
d27098c054 Add a new syntax-check rule for gethostname.
We should always be using virGetHostname in place of
gethostname; thus add in a new syntax-check rule to make
sure no new uses creep in.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:34:27 +01:00
Chris Lalancette
4c893ef9be Various syntax-check fixes.
Make a pass over the syntax-check files, tightening up regex's,
un-ignoring certain files, and cleaning things up.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:34:05 +01:00
Chris Lalancette
03b5dc14de Tighten up nonreentrant syntax-check.
We can slightly tighten up the regex's used to detect the use of
nonreentrant functions.  We can also check src/util/virterror.c
by modifying a comment; I think it's worth it to get the additional
coverage.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:33:42 +01:00
Chris Lalancette
b2af10cd49 Replace a gethostname by virGetHostname in libvirtd.c
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:33:20 +01:00
Chris Lalancette
982682b8fd Replace two strcmp() by STREQ() in qemu_driver.c
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:32:52 +01:00
Chris Lalancette
5bd53990c5 Replace gethostname by virGetHostname in xend_internal.c 2009-10-26 10:32:19 +01:00
Chris Lalancette
6940109b9a Remove a completely bogus reference increment in the Xen driver.
xenUnifiedDomainEventRegister() calls out to
virDomainEventCallbackListAdd(), which increments the reference
count on the connection.  That is fine, but then
xenUnifiedDomainEventRegister() increments the usage count again,
leading to a usage count leak.  Remove the increment in the xen
register, and the UnrefConnect in the xen unregister.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:31:42 +01:00
Chris Lalancette
43a9249c95 Add a default log_level to qemudSetLogging to remove a build warning.
(original patch from Charles Duffy)

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:31:16 +01:00
Chris Lalancette
2ff5cffe6e Better error message when libvirtd fails to start.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-26 10:30:49 +01:00
Matthias Bolte
4ed2c3773e Fix potential false-positive OOM error reporting.
If no matching device was found (cap == NULL) then no strdup() call
was made and *wwnn and *wwpn are untouched. Checking them for NULL
in this situation may result in reporting an false-positive OOM error
because *wwnn and *wwpn may be initialized to NULL by the caller.

Only check *wwnn and *wwpn for NULL if a matching device was found
(cap != NULL) and thus strdup() was called.

* src/conf/node_device_conf.c: only report an OOM error if there
  really is one
2009-10-22 15:25:45 +02:00
Daniel Veillard
2f4682a9f8 Consolidate virXPathNodeSet()
virXPathNodeSet() could return -1 when doing an evaluation failure
due to xmlXPathEval() from libxml2 behaviour.
* src/util/xml.c: make sure we always return 0 unless the returned
  XPath type is of the wrong type (meaning the query passed didn't
  evaluate to a node set and code must be fixed)
2009-10-22 10:33:52 +02:00
Richard Jones
08bed02515 Support QEMU watchdog device.
This adds simple support for configuring a guest with a QEMU/KVM
virtual hardware watchdog device.
2009-10-21 16:37:44 +01:00
Dan Kenigsberg
b03fe2d0ae Do not log rotate very small logs
Without this, after few weeks without use, each defined domain grows a
tail of empty gzipped logs, instead of keeping just the last log of
interest.

* daemon/libvirtd.logrotate.in: only rotate when the log is over 100 KBytes
2009-10-21 13:56:04 +02:00
Daniel Veillard
09c64d0072 528575 avoid libvirtd crash on LCX domain autostart
https://bugzilla.redhat.com/show_bug.cgi?id=528575
virsh -c lxc:/// autostart vm1
was crashing the daemon

* src/lxc/lxc_conf.h src/lxc/lxc_conf.c: initialize the driver
  autostartDir to avoid a NULL reference and implement autostart for LXC
2009-10-21 13:32:20 +02:00
Jim Fehlig
949dd07b19 Fix virsh.c compilation warning
* tools/virsh.c: call to vshError() containing 'doexit' parameter
  sneaked in after said parameter was removed
2009-10-21 12:59:43 +02:00
Jim Fehlig
309acaa023 Fix SELinux linking issues
* src/Makefile.am: add selinux CFLAGS and linker flags to security driver
2009-10-21 12:11:13 +02:00
Ryota Ozaki
e8fc4cbb64 LXC implement missing macaddr assignment feature
Currently MAC address configuration of container veth is just ignored.
This patch implements the missing feature.

* src/lxc/veth.c, src/lxc/veth.h: add setMacAddr
* src/lxc/lxc_driver.c: set macaddr of container veth if specified
2009-10-21 12:04:02 +02:00
Daniel Veillard
89f0c6d089 Fix a make dist error due to wrong EXTRA_DIST paths
* tests/Makefile.am: networkpoolxml2xmlout and networkpoolxml2xmlin are
  really networkxml2xmlout and networkxml2xmlin
2009-10-21 11:16:21 +02:00
Cole Robinson
9e2fe24518 node device: Break out get_wwns and get_parent_node helpers
These will be used by the test driver, so move them to a shareable space.
2009-10-20 14:17:35 -04:00
Cole Robinson
d686056f62 node device: Fix locking issue in virNodeDeviceDestroy
Certain error paths won't unlock the node device object.
2009-10-20 14:17:34 -04:00
Cole Robinson
9710856b33 tests: Centralize VIR_TEST_DEBUG lookup, and document it
Provide a simple interface for other tests to lookup the testDebug variable.
Also remove a redundant error message in interface tests.

If anyone feels inclined to change this env variable to match the existing
LIBVIRT_* format, it should now be easier to do so.
2009-10-20 14:17:34 -04:00
Cole Robinson
f5ee422c58 tests: Initialize virRandom in for test suite.
Otherwise any virRandom calls will result in a segfault.
2009-10-20 14:17:34 -04:00
Daniel P. Berrange
cf577653dc Remove bogus const annotations to hash iterator
Most of the hash iterators need to modify either payload of
data args. The const annotation prevents this.

* src/util/hash.h, src/util/hash.c: Remove const-ness from
  virHashForEach/Iterator
* src/xen/xm_internal.c: Remove bogus casts
2009-10-19 16:24:12 +01:00
Dan Kenigsberg
de2b252df5 fix virDomainMigrateToURI doc
* src/libvirt.c: remove reverences to non existent dconn parameter
  when using that entry point.
2009-10-19 14:53:29 +02:00
Ryota Ozaki
41fa653f32 LXC fix virCgroupGetValueStr problem with \n
A cgroup file returns integer value terminated with '\n' and remaining
it has sometimes harmful effects, for example it leads virStrToLong_ull
to fail.
* src/util/cgroup.c: strip out terminating \n when reading a value
2009-10-19 14:29:42 +02:00
Matthias Bolte
4f4a1deccb Remove bashisms from schema tests.
Introduced in commit 39a7be470c.

* tests/*schematest: replace 'source' with '.'
* tests/schematestutils.sh: remove 'function' keyword and add '()'
2009-10-17 01:16:25 +02:00
Cole Robinson
caf8e91588 tests: Add storage volume XML 2 XML tests. 2009-10-16 10:52:27 -04:00
Cole Robinson
6d8331fd58 tests: Add network XML to XML tests. 2009-10-16 10:52:26 -04:00
Cole Robinson
4027461865 schema: Update network schema.
Make things a bit more readable, and properly handle forward mode 'route'.
2009-10-16 10:52:10 -04:00
Cole Robinson
e1ea1b2af7 tests: Add XML 2 XML tests for storage pools.
Move existing schema data to an input directory. Add extra files for more
thorough XML testing.
2009-10-16 10:21:47 -04:00
Cole Robinson
39a7be470c tests: Break out duplicate schema verification functionality.
All schema tests have identical functionality, so avoid the duplication.
2009-10-16 10:21:46 -04:00
Cole Robinson
16a3a4a30a tests: Fix text output for interface XML 2 XML 2009-10-16 10:20:21 -04:00
Mark McLoughlin
2210f8a3a8 Don't copy old machines from a domain which has none
If the the qemu and kvm binaries are the same, we don't include machine
types in the kvm domain info.

However, the code which refreshes the machine types info from the
previous capabilities structure first looks at the kvm domain's info,
finds it matches and then copies the empty machine types list over
for the top-level qemu domain.

That doesn't make sense, we shouldn't copy an empty machin types list.

* src/qemu/qemu_conf.c: qemudGetOldMachinesFromInfo(): don't copy an
  empty machine types list.
2009-10-15 13:27:57 +01:00
Laine Stump
04e0686262 Avoid crash in virBufferEscapeString
* src/util/buf.c: if virBufferEscapeString was called on a buffer that
  had 0 bytes of space, a size of -1 will be passed to snprintf, resulting
  in a segmentation fault, this preallocate some space.
2009-10-15 14:19:11 +02:00
Jim Fehlig
e391595890 Add ocfs2 to list of fs pool types
* src/conf/storage_conf.c src/conf/storage_conf.h: extend the enums
  and values
* docs/schemas/storagepool.rng: add to the list of storage pool type
  formats
2009-10-14 17:03:22 +02:00
Ryota Ozaki
c396fb36fa LXC complement PATH environment variable
* src/lxc/lxc_driver.c: without PATH, the controller will definitely
  fail to call ip command
2009-10-14 16:54:29 +02:00
Chris Lalancette
2d8d9b100b Finer grained migration control
Normally, when you migrate a domain from host A to host B,
the domain on host A remains defined but shutoff and the domain
on host B remains running but is a "transient".  Add a new
flag to virDomainMigrate() to allow the original domain to be
undefined on source host A, and a new flag to virDomainMigrate() to
allow the new domain to be persisted on the destination host B.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-14 11:35:51 +02:00
Daniel Veillard
a56ec4515b Release of 0.7.2 2009-10-14 11:16:13 +02:00
Daniel Veillard
4348a4a85a Fixing ca.po 2009-10-14 10:32:53 +02:00
Daniel Veillard
d66fab6eea Updated and regenerated localizations
* de.po ja.po it.po hi.po gu.po or.po mr.po ml.po kn.po ru.po pl.po
  pa.po te.po ta.po: many updates
2009-10-14 10:30:25 +02:00
Cole Robinson
3b13aa3db3 network: Fix printing XML 'delay' attribute
When specifying bridge delay via network XML define, we were looking for
the 'delay' attribute, but would dump the value as 'forwardDelay'. Have
the output match the expected input (and schema).
2009-10-13 11:31:27 -04:00
Daniel P. Berrange
11a36d956c Fix virFileReadLimFD/virFileReadAll to handle EINTR
The fread_file_lim() function uses fread() but never handles
EINTR results, causing unexpected failures when reading QEMU
help arg info. It was unneccessarily using FILE * instead
of plain UNIX file handles, which prevented use of saferead()

* src/util/util.c: Switch fread_file_lim over to use saferead
  instead of fread, remove FILE * use, and rename
2009-10-13 16:28:49 +01:00
Cole Robinson
826cbac459 storage: Fix generating iscsi 'auth' xml
We were missing a closing tag, so the XML wasn't proper.
2009-10-13 10:56:43 -04:00
Cole Robinson
be2cd079af schema: Update storage pool schema.
- mpath pools weren't listed
- scsi pools were missing an adapter section
- iscsi pools were missing an auth section
- Logical pools do not require a source name to be specified
2009-10-13 10:56:43 -04:00