Commit Graph

8716 Commits

Author SHA1 Message Date
Michal Privoznik
2d0fc93fdd virsh: Don't traverse childless nodes in vshNodeIsSuperset
If both nodes do not have any children, we pass zero to
virBitmapAlloc which returns NULL. In turn we report OOM error
and return false (meaning nodes are different). This is not true.
2011-11-28 18:17:14 +01:00
Christian Franke
d360795d60 virnetsocket: pass XAUTORITY for ssh connection
When spawning an ssh connection, the environment variables
DISPLAY, SSH_ASKPASS, ... are passed. However XAUTHORITY,
which is necessary if the .Xauthority is in a non default
place, was not passed.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
2011-11-28 09:30:49 -07:00
Lorin Hochstein
8078a90a24 conf: make virt-xml-validate work with vbox domains
virt-xml-validate fails when run on a domain XML file of type 'vbox'.

For failing test case, see https://bugzilla.redhat.com/show_bug.cgi?id=757097

This patch updates the XML schema to accept all valid hypervisor
types, as well as dropping hypervisor types that are not in use
by the current code base.

Signed-off-by: Eric Blake <eblake@redhat.com>
2011-11-28 09:16:07 -07:00
Michal Privoznik
a6916977bb conf: Improve incorrect root element error messages
When user pass wrong root element, it is not 'internal error' and
we can give him hint what we are expecting.
2011-11-28 15:12:37 +01:00
Daniel P. Berrange
508aef9b0e Refactor initial LXC mem tune / device ACL code
To make lxcSetContainerResources smaller, pull the mem tune
and device ACL setup code out into separate methods

* src/lxc/lxc_controller.c: Introduce lxcSetContainerMemTune
  and lxcSetContainerDeviceACL
2011-11-28 12:06:51 +00:00
Daniel P. Berrange
a04699fc12 Add support for blkio tuning of LXC containers
* src/lxc/lxc_controller.c: Refactor setting of initial blkio
  tuning parameters
* src/lxc/lxc_driver.c: Enable live change of blkio tuning
2011-11-28 12:06:51 +00:00
Daniel P. Berrange
d9724a81b3 Add support for CPU quota/period to LXC driver
* src/lxc/lxc_driver.c: Support changing quota/period for LXC
  containers
* src/lxc/lxc_controller.c: Set initial quota/period at startup
2011-11-28 12:06:29 +00:00
Daniel P. Berrange
9175347828 Support CPU placement in LXC driver
While LXC does not have the concept of VCPUS, so we can't do
per-VCPU pCPU placement, we can support the VM level CPU
placement. Todo this simply set the CPU affinity of the LXC
controller at startup. All child processes will inherit this
affinity.

* src/lxc/lxc_controller.c: Set process affinity
2011-11-28 12:06:27 +00:00
Daniel P. Berrange
3e1b6d7575 Support NUMA memory placement for LXC containers
Use numactl to set NUMA memory placement for LXC containers

* src/lxc/lxc_controller.c: Support NUMA memory placement
2011-11-28 12:05:33 +00:00
Michal Privoznik
3ba949e8f4 storage: Refetch file status after open
This partly reverts my previous patch f88de3eb. We need to
get file status after open, as given path could have been symlink,
so fstat() will operate on different file than lstat().
2011-11-25 13:45:36 +01:00
Paolo Bonzini
a1b62f983b util: fix thinko in runIO
When aligning you need to clear the bits in the mask and leave the
others aside.  Likely this code has never run, and will never run.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-11-25 05:37:39 -07:00
Michal Privoznik
f88de3eb51 storage: Skip socket and fifo on pool-start
If pool directory contains special files like FIFO or sockets
we want to skip those on pool-start or pool-refresh otherwise
open() will get an error.
2011-11-25 08:07:43 +01:00
Michal Privoznik
c3a6a1e149 conf: Don't drop console definition on domain restart
One of my latest patches 2e37bf42d2
copy serial console definition. On domain shutdown we save this
info into state XML. However, later on the daemon start we simply
drop this info and since we are not re-reading qemu log,
vm->def->consoles[0] does not get populated with copy. Therefore
we need to avoid dropping console definition if it is just alias
for serial console.
2011-11-25 08:06:16 +01:00
Jiri Denemark
2c4cdb736c Fix version numbers for isAlive and setKeepAlive driver APIs 2011-11-24 14:44:59 +01:00
Jiri Denemark
04a469338d build: Properly generate and check virkeepaliveprotocol-structs
This fixes make dist broken by recent keepalive series
2011-11-24 14:44:04 +01:00
Jiri Denemark
8455705959 examples: Use virConnectOpenAuth in events-c 2011-11-24 13:43:44 +01:00
Jiri Denemark
3a6a262428 qemu: Cancel p2p migration when connection breaks
If a connection to destination host is lost during peer-to-peer
migration (because keepalive protocol timed out), we won't be able to
finish the migration and it doesn't make sense to wait for qemu to
transmit all data. This patch automatically cancels such migration
without waiting for virDomainAbortJob to be called.
2011-11-24 12:00:10 +01:00
Jiri Denemark
1e62643719 qemu: Add support for keepalive messages during p2p migration 2011-11-24 12:00:10 +01:00
Jiri Denemark
6e945da567 Add keepalive support into domain-events examples 2011-11-24 12:00:10 +01:00
Jiri Denemark
e401b0cd02 Implement virConnectIsAlive in all drivers 2011-11-24 12:00:10 +01:00
Jiri Denemark
afdf014f4f Introduce virConnectIsAlive API
This API can be used to check if the socket associated with
virConnectPtr is still open or it was closed (probably because keepalive
protocol timed out). If there the connection is local (i.e., no socket
is associated with the connection, it is trivially always alive.
2011-11-24 12:00:10 +01:00
Jiri Denemark
2fb1362883 Implement keepalive protocol in remote driver 2011-11-24 12:00:09 +01:00
Jiri Denemark
673adba594 Add support for async close of client RPC socket 2011-11-24 12:00:00 +01:00
Jiri Denemark
f4324e3292 Implement keepalive protocol in libvirt daemon 2011-11-24 11:44:08 +01:00
Jiri Denemark
fd7e85ac6a virsh: Always run event loop
Since virsh already implements event loop, it has to also run it. So far
the event loop was only running during virsh console command.
2011-11-24 11:44:08 +01:00
Jiri Denemark
8d6e3edd0e Introduce virConnectSetKeepAlive
virConnectSetKeepAlive public API can be used by a client connecting to
remote server to start using keepalive protocol. The API is handled
directly by remote driver and not transmitted over the wire to the
server.
2011-11-24 11:44:08 +01:00
Jiri Denemark
71b779a1ad Implement common keepalive handling
These APIs are used by both client and server RPC layer to handle
processing of keepalive messages.
2011-11-24 11:44:08 +01:00
Jiri Denemark
4acd358a76 Define keepalive protocol
The keepalive program has two procedures: PING, and PONG.
Both are used only in asynchronous messages and the sender doesn't wait
for any reply. However, the party which receives PING messages is
supposed to react by sending PONG message the other party, but no
explicit binding between PING and PONG messages is made. For backward
compatibility neither server nor client are allowed to send keepalive
messages before checking that remote party supports them.
2011-11-24 11:44:08 +01:00
Jiri Denemark
2afc5a7bbf rpc: Add some debug messages to virNetClient 2011-11-24 11:44:08 +01:00
Jiri Denemark
78965a33e8 rpc: Fix handling of non-blocking calls that could not be sent
When virNetClientIOEventLoop is called for a non-blocking call and not
even a single byte can be sent from this call without blocking, we
properly reported that to the caller which properly frees the call. But
we never removed the call from a call queue.
2011-11-24 11:44:07 +01:00
Jiri Denemark
3e1b2fab0c rpc: Fix a typo in virNetClientSendNonBlock documentation 2011-11-24 11:44:07 +01:00
Jiri Denemark
ebee52f52b rpc: Pass the buck only to the first available thread 2011-11-24 11:44:07 +01:00
Stefan Berger
dc62c22532 nwfilter: remove virConnectPtr from internal API calls
Remove the virConnectPtr from the nwfilter's internal API calls as
far as possible.
2011-11-23 14:13:03 -05:00
Peter Krempa
c4b32641f1 qemu: Avoid dereference of NULL pointer
If something fails while initializing qemu job object in
qemuDomainObjPrivateAlloc(), memory to the private pointer is freed, but
after that, the pointer is still dereferenced, which may result in a
segfault.

* qemuDomainObjPrivateAlloc() - Don't dereference NULL pointer.
2011-11-23 16:19:48 +01:00
Eric Blake
db2f680775 qemu: fix a const-correctness issue
Generally, functions which return malloc'd strings should be typed
as 'char *', not 'const char *', to make it obvious that the caller
is responsible to free things.  free(const char *) fails to compile,
and although we have a cast embedded in VIR_FREE to work around poor
code that frees const char *, it's better to not rely on that hack.

* src/qemu/qemu_driver.c (qemuDiskPathToAlias): Change return type.
(qemuDomainBlockJobImpl): Update caller.
2011-11-23 07:29:45 -07:00
Eric Blake
3ac26e2645 API: prefer 'disk' over 'block' or 'path'
Given that we can now handle the target's disk shorthand, in addition
to an absolute path to the file or block device used on the host,
the term 'disk' fits a bit better as the parameter name than 'path'.

* include/libvirt/libvirt.h.in: Update some parameter names.
* src/libvirt.c (virDomainBlockStats, virDomainBlockStatsFlags)
(virDomainBlockPeek, virDomainGetBlockInfo, virDomainBlockJobAbort)
(virDomainGetBlockJobInfo, virDomainBlockJobSetSpeed)
(virDomainBlockPull): Likewise.
2011-11-23 06:10:30 -07:00
Eric Blake
c725e2dc5a blockstats: support lookup by path in blockstats
Commit 89b6284f made it possible to pass either a source name or
the target device to most API demanding a disk designation, but
forgot to update the documentation.  It also failed to update
virDomainBlockStats to take both forms. This patch fixes both the
documentation and the remaining function.

Xen continues to use just device shorthand (that is, I did not
implement path lookup there, since xen does not track a domain_conf
to quickly tie a path back to the device shorthand).

* src/libvirt.c (virDomainBlockStats, virDomainBlockStatsFlags)
(virDomainGetBlockInfo, virDomainBlockPeek)
(virDomainBlockJobAbort, virDomainGetBlockJobInfo)
(virDomainBlockJobSetSpeed, virDomainBlockPull): Document
acceptable disk naming conventions.
* src/qemu/qemu_driver.c (qemuDomainBlockStats)
(qemuDomainBlockStatsFlags): Allow lookup by source name.
* src/test/test_driver.c (testDomainBlockStats): Likewise.
2011-11-23 06:10:30 -07:00
Michal Privoznik
489e14f258 nwfilter: Initialize virNWFilterAddIpAddrForIfname return variable
Latest nwfilter patch ad6c67cf introduced uninitialized return
value. This was spotted by 4.6.2 gcc.
2011-11-23 07:43:36 -05:00
Daniel P. Berrange
aad764e107 Fix disabling of virtual port profile code on old hosts
The WITH_VIRTUALPORT macro is defined to 0 when disabled, not
left undefined. So #if must be used instead of #ifdef

* src/util/virnetdevvportprofile.c: s/#ifdef/#if/
2011-11-23 12:29:37 +00:00
Daniel P. Berrange
3fb94eeeb2 Fix uninitialized variable in NWfilter IP learning code
* src/nwfilter/nwfilter_learnipaddr.c: Initialize ret variable
2011-11-23 12:16:01 +00:00
Michal Prívozník
ea7182c29f virsh: Increase device-detach intelligence
Up to now users have to give a full XML description on input when
device-detaching. If they omitted something it lead to unclear
error messages (like generated MAC wasn't found, etc.).
With this patch users can specify only those information which
specify one device sufficiently precise. Remaining information is
completed from domain.
2011-11-23 10:24:43 +01:00
Stefan Berger
ad6c67cf85 Enable detection of multiple IP addresses
In preparation of DHCP Snooping and the detection of multiple IP
addresses per interface:

The hash table that is used to collect the detected IP address of an
interface can so far only handle one IP address per interface. With
this patch we extend this to allow it to handle a list of IP addresses.

Above changes the returned variable type of virNWFilterGetIpAddrForIfname()
from char * to virNWFilterVarValuePtr; adapt all existing functions calling
this function.
2011-11-22 19:05:45 -05:00
Eli Qiao
5c5e07b84c fix error message when using wrong URI alias
Signed-off-by: Eli Qiao <taget@linux.vnet.ibm.com>

When configuring a URI alias like this in 'libvirt.conf':

uri_aliases = [
  "jj#j=qemu+ssh://root@127.0.0.1/system",
  "sleet=qemu+ssh://root@sleet.cloud.example.com/system",
]
virsh -c jj#j

It will show this error message:
'no connection driver available for No connection for URI jj#j'
Actually,we expect this message below:
Malformed 'uri_aliases' config entry 'jj#j=qemu+ssh://root@127.0.0.1/system', aliases may only contain 'a-Z, 0-9, _, -'

Give this patch to fix this error.
2011-11-22 15:23:28 -07:00
Stefan Berger
7ca82ecbea Pass additional parameter into applyDHCPOnly function
In preparation for the DHCP Snooping code:
Pass an additional parameter into the applyDHCPOnly function
of the 'techdriver'.
2011-11-22 15:59:26 -05:00
Stefan Berger
aa1cb7e706 nwfilter: use shell variable to invoke 'ip(6)tables' command
Introduce a shell variable 'IBT' to invoke the ip(6)tables command.

Tested with libvirt-tck.
2011-11-22 15:12:04 -05:00
Stefan Berger
970b417abb nwfilter: use shell variable to invoke 'ebtables' command
Introduce a shell variable 'EBT' to invoke the ebtables command.
Hard-code the used ebtables table to '-t nat'.

Tested with libvirt-tck.
2011-11-22 15:12:04 -05:00
Stefan Berger
fa69eb5f52 Improve error reporting of failures to apply filtering rules
Display the executed command and failure message if a command failed to
execute.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2011-11-22 15:12:04 -05:00
Stefan Berger
d64208888d Add documentation for STP filtering support
Add documentation for the STP filtering support. Describe the XML attributes
that are supported.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2011-11-22 15:12:03 -05:00
Stefan Berger
1d5654b266 Add test cases for STP traffic filtering
This patch adds a few test cases for the XML parsing of STP filtering nodes.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2011-11-22 15:12:03 -05:00
Stefan Berger
ba3bf00acf Add support for STP filtering
This patch adds support for filtering of STP (spanning tree protocol) traffic
to the parser and makes us of the ebtables support for STP filtering. This code
now enables the filtering of traffic in chains with prefix 'stp'.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2011-11-22 15:12:03 -05:00