Commit Graph

28 Commits

Author SHA1 Message Date
John Ferlan
b97b30480d nodeinfo: Add sysfs_prefix to nodeCapsInitNUMA
Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_CPU_PATH which is a
derivative of SYSFS_SYSTEM_PATH

Use cpupath for nodeCapsInitNUMAFake and remove SYSFS_CPU_PATH
2015-07-13 15:59:32 -04:00
John Ferlan
29e4f2243f nodeinfo: Add sysfs_prefix to nodeGetInfo
Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.
2015-07-13 15:59:32 -04:00
John Ferlan
f1c6179f0d nodeinfo: Add sysfs_prefix to nodeGetCPUMap
Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.
2015-07-13 15:59:32 -04:00
John Ferlan
f1a43a0f91 nodeinfo: Add sysfs_prefix to nodeGetCPUCount
Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.
2015-07-13 15:59:32 -04:00
Dmitry Guryanov
f6d908a2f3 vz: fix cleanup of nets of bridged type
We create a virtual network of special type, which
has the same name as bridge name to create bridged
network adapter in vz. So when we delete such an
adapter we have to remove corresponding virtual
network.

So let's rename prlsdkDelNet to prlsdkCleanupBridgedNet
and don't check for return value.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
2015-07-10 16:37:57 +03:00
Maxim Nestratov
7d73ca06ce vz: use PRL_USE_VNET_NAME_FOR_BRIDGE_NAME
It is better not to assume that newly created network should be
connected to a bridge with same name, but specify it explicitly
by PRL_USE_VNET_NAME_FOR_BRIDGE_NAME flag.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
2015-07-08 17:21:11 +03:00
Peter Krempa
9777419c81 vz: Use virBitmapToDataBuf instead of virBitmapToData in vzDomainGetVcpus 2015-07-08 11:01:33 +02:00
Peter Krempa
cba7f34504 vz: Remove dead code from vzDomainGetVcpus
'maxcpu' and 'vcpus' are set but not used after that
2015-07-08 11:01:33 +02:00
Mikhail Feoktistov
beddef3967 vz: assign static IPs and default gateways for network adapter
We support only one IPv4 and one IPv6 default gateway.
If static IPs are not present in instance config,
then we switch on DHCP for this adapter.
PrlVmDevNet_SetAutoApply to makes necessary settings within guest OS
In linux case it creates network startup scripts
/etc/sysconfig/network-scripts/ifcfg-ethN and fills it with necessary
parameters.
2015-07-07 17:53:44 +03:00
Dmitry Guryanov
651426e93e vz: fix building capabilities
There should be at least one domain for each guest
in cababilities. And in current code we don't add
domain for this guest for example.

    if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
                                         VIR_ARCH_X86_64,
                                         "vz",
                                         NULL, 0, NULL)) == NULL)

Anyway, with two virt types it looks a litte messy, so let's
move adding guest and domain to a separate function.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
2015-07-06 15:51:37 +03:00
Nikolay Shirokovskiy
2854079496 vz: fix SDK event dispatching
Current version of SDK event dispatcing is incorrect. For most VM events (add,
delete etc) issuer type is PIE_DISPATCHER. Actually analyzing issuer type
doesn't have any benifints so this patch get rid of it. All dispatching is done
only on event type.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-07-02 18:57:45 +03:00
Martin Kletzander
f7d8aa44b0 Revert "Change livbirt version to 1.3.0 for the next release"
This reverts commit 9a8d916e89.

Also some changes that were introduced after that commit are fixed to
use 1.2.17 instead of 1.3.0
2015-06-28 11:34:30 +08:00
Peter Krempa
d637017f9b vz: Fix build after recent commit
Function prlsdkGetStatsParam was missing a prototype or the static
keyword. I went with static since it built successfully.

Pushed as a build breaker fix.
2015-06-26 16:00:15 +02:00
Nikolay Shirokovskiy
bb7d275d15 vz: add memory statistics
Implemented counters:
 VIR_DOMAIN_MEMORY_STAT_SWAP_IN
 VIR_DOMAIN_MEMORY_STAT_SWAP_OUT
 VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT
 VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT
 VIR_DOMAIN_MEMORY_STAT_AVAILABLE
 VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON
 VIR_DOMAIN_MEMORY_STAT_UNUSED

Comments.

1. Use vzDomObjFromDomainRef/virDomainObjEndAPI pair to get domain
object as we use prlsdkGetStatsParam. See previous statistics
comments.

2. Balloon statistics is not applicable to containers. Fault
statistics for containers not provided in PCS6 yet.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-06-26 16:39:28 +03:00
Nikolay Shirokovskiy
b2f73ee22e vz: add vcpu statistics
Comments.

Replace vzDomObjFromDomain/virObjectUnlock pair
to vzDomObjFromDomainRef/virDomainObjEndAPI as we
use prlsdkGetStatsParam. See previous statistics
comments.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-06-26 16:39:28 +03:00
Nikolay Shirokovskiy
b6c11c3910 vz: cleanup, make in par net device lookup functions
Make net device lookup by mac return sdk handle
instead of quite ephemeral enumeration index. After
this change there is no need anymore in special
function of removing device by enumeration index.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-06-26 16:39:28 +03:00
Nikolay Shirokovskiy
b249069d53 vz: add net dev statistiscs
Populate counters SDK currenly supports:
 rx_bytes
 rx_packets
 tx_bytes
 tx_packets

Comments.

Use vzDomObjFromDomainRef/virDomainObjEndAPI pair to get domain
object as we use prlsdkGetStatsParam that can release domain
object lock and thus we need a reference in case domain
is deleated meanwhile.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2015-06-26 16:39:28 +03:00
Michal Privoznik
c3c16e694c vz_utils: Reformat
Honour our formatting style. Adjust indentation so it matches the
rest of our code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-06-26 09:28:28 +02:00
Michal Privoznik
2bdcbb4ecc vz_storage: Reformat
Honour our formatting style. Adjust indentation so it matches the
rest of our code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-06-26 09:28:28 +02:00
Michal Privoznik
dc1b034527 vz_sdk: Reformat
Honour our formatting style. Adjust indentation so it matches the
rest of our code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-06-26 09:28:28 +02:00
Michal Privoznik
a35d2ce0c0 vz_network: Reformat
Honour our formatting style. Adjust indentation so it matches the
rest of our code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-06-26 09:28:28 +02:00
Michal Privoznik
ed025db700 vz_driver: Reformat
Honour our formatting style. Adjust indentation so it matches the
rest of our code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-06-26 09:28:28 +02:00
Michal Privoznik
84d0286ef0 vz: Adapt to driver rename
In the e6d180f07f commit the parallels driver was renamed to vz.
However, there was a commit merged later, which was sent to the list
before the rename. The other commit is 6de12b026b. Fix all the
missing renames.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-06-25 09:36:41 +02:00
Dmitry Guryanov
39618d4088 vz: fix syntax-check errors
Remove braces around single-statement blocks in vz_sdk.c
2015-06-24 22:36:19 +03:00
Mikhail Feoktistov
6de12b026b vz: implementation of attach/detach network devices
In this patch we add VIR_DOMAIN_DEVICE_NET handlers implementation
for domainAttachDevice and domainDetachDevice callbacks.

As soon as we don't support this operation for hypervisor type domains,
we implement this functionality for containers only.

In detach procedure we find network device by MAC address.
Because PrlVmDevNet_GetMacAddress() returns MAC as a UTF-8 encoded
null-terminated string, we use memcmp() to compare it.
Also we remove corresponding virtual network by prlsdkDelNetAdapter call.
2015-06-24 18:39:01 +03:00
Mikhail Feoktistov
0c151004bc parallels: Fix false error messages in libvirt log
There was many errors in libvirt.log caused by prlsdkDelNet function because
job variable was always initialized as PRL_INVALID_HANDLE
In this patch job variable gets return value of PrlSrv_DeleteVirtualNetwork function()
2015-06-18 14:08:55 +03:00
Mikhail Feoktistov
fad9b77e0d parallels: Fix initialization of buflen variable in each loop iteration
We need to initialize buflen every time when we get network adapter's
friendly name because we call PrlVmDev_GetFriendlyName in a loop
2015-06-18 14:08:48 +03:00
Maxim Nestratov
e6d180f07f parallels: rename all parallels files and driver directory to vz
This patch moves all src/parallels/parallels* files to vz/vz*
and fixes build accordingly.
No functional changes.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
2015-06-17 15:07:55 +03:00