Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vz7 u7 #1

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e350ab0
Apply dns ips from global network section #PSBM-68559
Mar 6, 2018
0ca318a
Merge pull request #1572 in OVZ/prl-disp-service from ~YUR/prl-disp-s…
Mar 6, 2018
4d1118a
CT shared template is not unregister on HOME removal #PSBM-82206
Mar 7, 2018
c2f0c7e
Merge pull request #1575 in OVZ/prl-disp-service from ~IGOR/prl-disp-…
Mar 7, 2018
dc66eee
AUTO Version bump to 7.0.821
Mar 7, 2018
726e9cd
fork u7 version
Mar 7, 2018
7aff18b
AUTO Version bump to 7.0.820.1
Mar 7, 2018
af2dcc7
AUTO Version bump to 7.0.820.2
Mar 7, 2018
01808a8
Load CT config for shared template with extra parameter #PSBM-82278
Mar 13, 2018
f7b4c91
Merge pull request #1576 in OVZ/prl-disp-service from ~IGOR/prl-disp-…
Mar 13, 2018
6d23c13
Unable to create CT with name of destroyed shared template #PSBM-82334
Mar 13, 2018
b848967
Merge pull request #1578 in OVZ/prl-disp-service from ~IGOR/prl-disp-…
Mar 13, 2018
ac53df5
AUTO Version bump to 7.0.820.3
Mar 13, 2018
bb464dc
Failed to start CT after restore #PSBM-82375
Mar 14, 2018
1aa8380
Merge pull request #1581 in OVZ/prl-disp-service from ~IGOR/prl-disp-…
Mar 14, 2018
691170a
AUTO Version bump to 7.0.820.4
Mar 14, 2018
935ca46
bug #PSBM-82909 aka prl_disp_service killed by SIGSEGV
Mar 26, 2018
a52fc43
Merge pull request #1588 in OVZ/prl-disp-service from ~SHRIKE/prl-dis…
Mar 27, 2018
82c6b00
bug #PSBM-82964 aka QCOW2 cluster size is lost for linked clone
Mar 27, 2018
513432d
Merge pull request #1589 in OVZ/prl-disp-service from ~SHRIKE/prl-dis…
Mar 27, 2018
30aab2f
bug #PSBM-82251 aka Print proper error on simultaneous shared
Mar 27, 2018
836ec87
Merge pull request #1591 in OVZ/prl-disp-service from ~SHRIKE/prl-dis…
Mar 27, 2018
d283a5b
AUTO Version bump to 7.0.820.5
Mar 27, 2018
4b2e236
Revert "bug #PSBM-82964 aka QCOW2 cluster size is lost for linked clone"
Mar 29, 2018
187744b
AUTO Version bump to 7.0.820.6
Mar 29, 2018
5693cbf
arp proxy is configured on wrong interfaces for vms #PSBM-83159
Apr 3, 2018
c02a217
Merge pull request #1595 in OVZ/prl-disp-service from ~IGOR/prl-disp-…
Apr 3, 2018
a6b2299
AUTO Version bump to 7.0.820.7
Apr 3, 2018
4e60425
bug #PSBM-83282 aka dispatcher deadlock in CDspStatCollect
Apr 6, 2018
acbbb73
Merge pull request #1600 in OVZ/prl-disp-service from ~SHRIKE/prl-dis…
Apr 6, 2018
476a21e
AUTO Version bump to 7.0.820.8
Apr 6, 2018
8a1f649
define the 'ssbd' CPUID feature bit (CVE-2018-3639) #PSBM-84889
May 23, 2018
3077139
Merge pull request #1617 in OVZ/prl-disp-service from ~IGOR/prl-disp-…
May 23, 2018
740607a
AUTO Version bump to 7.0.820.9
May 23, 2018
8e3be2c
VNC server restarted on edit CT #PSBM-85959
Jun 19, 2018
ff1179b
Merge pull request #1629 in OVZ/prl-disp-service from ~IGOR/prl-disp-…
Jun 19, 2018
672d59f
AUTO Version bump to 7.0.820.10
Jun 19, 2018
e8999f1
Task_VzStateMonitor::processConfigChangedEvt(): do invalidate config …
Jul 12, 2018
7bf1ea3
Merge pull request #1650 in OVZ/prl-disp-service from ~IGOR/prl-disp-…
Jul 12, 2018
5bff7ee
AUTO Version bump to 7.0.820.11
Jul 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dispatcher/Dispatcher/CDspTemplateFacade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,16 @@ PRL_RESULT Folder::remove(const QString& uid_)
if (e == m)
return PRL_ERR_FILE_NOT_FOUND;

PRL_VM_TYPE type = PVT_VM;
getDirectoryManager().getVmTypeByUuid(uid_, type);
if (type == PVT_CT)
{
WRITE_TRACE(DBG_FATAL, "Unregister CT %s", qPrintable(uid_));
return getDirectoryHelper().deleteVmDirectoryItem(
CDspVmDirHelper::getVmDirUuidByVmUuid(uid_, m_user),
uid_);
}

Prl::Expected<SmartPtr<CVmConfiguration>, PRL_RESULT> c = m->getConfig();
if (c.isFailed())
return c.error();
Expand Down
9 changes: 8 additions & 1 deletion Dispatcher/Dispatcher/CDspTemplateStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
///////////////////////////////////////////////////////////////////////////////

#include <mntent.h>
#include <sys/file.h>
#include "CDspService.h"
#include "CDspVzHelper.h"
#include "CDspInstrument.h"
Expand Down Expand Up @@ -122,7 +123,13 @@ PRL_RESULT Unit::enter()
if (m_file.isOpen())
return PRL_ERR_DOUBLE_INIT;
if (m_file.open(m_mode))
return PRL_ERR_SUCCESS;
{
int m = m_mode & QIODevice::WriteOnly ? LOCK_EX : LOCK_SH;
if (0 == TEMP_FAILURE_RETRY(::flock(m_file.handle(), m | LOCK_NB)))
return PRL_ERR_SUCCESS;

m_file.close();
}

return PRL_ERR_OPEN_FAILED;
}
Expand Down
9 changes: 6 additions & 3 deletions Dispatcher/Dispatcher/CDspVmBackupInfrastructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,10 @@ Prl::Expected<SmartPtr<CVmConfiguration>, PRL_RESULT>
if (m.isFailed())
return m.error();

int l = 0;
Ct::Config::LoadOps l;

l.setRelative();

PRL_RESULT e = PRL_ERR_SUCCESS;
SmartPtr<CVmConfiguration> output;
switch (m.value().getVmType())
Expand All @@ -1833,12 +1836,12 @@ Prl::Expected<SmartPtr<CVmConfiguration>, PRL_RESULT>
#ifdef _CT_
case PVBT_CT_PLOOP:
// NB. there is no break here intentionally.
l = VZCTL_LAYOUT_5;
l.setLayout(VZCTL_LAYOUT_5);
case PVBT_CT_VZFS:
{
int x = 0;
QString file(m_fs.getItem(sequence_, number_).filePath(VZ_CT_CONFIG_FILE));
output = CVzHelper::get_env_config_from_file(file, x, l, true);
output = CVzHelper::get_env_config_from_file(file, x, l);
if (!output.isValid())
{
WRITE_TRACE(DBG_FATAL, "Failed to load config file '%s'", QSTR2UTF8(file));
Expand Down
12 changes: 9 additions & 3 deletions Dispatcher/Dispatcher/CDspVmNetworkHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ QStringList Device::calculate(const general_type& general_, const Config::Dao& d
{
device_type* o = devices_.find(a->getSystemName(), a->getIndex());
if (isEqual(o, a) && m_general->isAutoApplyIpOnly() == general_.isAutoApplyIpOnly() &&
m_general->getDnsIPAddresses() == general_.getDnsIPAddresses() &&
!(a->getEmulatedType() == PNA_ROUTED && g))
continue;

Expand All @@ -563,12 +564,17 @@ QStringList Device::calculate(const general_type& general_, const Config::Dao& d
else
output << Address(*a)(Bridge(m));

// merge per adaper and global dns lists
// "remove" should be completed only if comes from both
QStringList d = a->getDnsIPAddresses() + m_general->getDnsIPAddresses();
d.removeDuplicates();
if (d.contains("remove") && d.size() > 1)
d.removeAll("remove");
// ipOnly autoApply skips all except ip/route/gw args
// currently this is just dns ips args
if (!m_general->isAutoApplyIpOnly() && !a->getDnsIPAddresses().isEmpty())
if (!m_general->isAutoApplyIpOnly() && !d.isEmpty())
{
output << "--dns" << m
<< QStringList(a->getDnsIPAddresses()).join(" ");
output << "--dns" << m << d.join(" ");
}
}
return output;
Expand Down
3 changes: 2 additions & 1 deletion Dispatcher/Dispatcher/CDspVzHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ SmartPtr<CVmConfiguration> CDspVzHelper::getConfig(
{
SmartPtr<CVmConfiguration> x;
return getVzlibHelper().get_env_config_from_file(
QString(sHome + "/ve.conf"), e);
QString(sHome + "/ve.conf"), e,
Ct::Config::LoadOps().setUnregistered());
}

return getVzlibHelper().get_env_config(sUuid);
Expand Down
1 change: 0 additions & 1 deletion Dispatcher/Dispatcher/Stat/CDspStatCollectingThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2252,7 +2252,6 @@ Libvirt::Result GetPerformanceStatisticsCt(const CVmIdent &id, Collector &c)

Libvirt::Result GetPerformanceStatisticsVm(const CVmIdent &id, Collector &c)
{
Libvirt::Instrument::Agent::Vm::Unit u = Libvirt::Kit.vms().at(id.first);
VIRTUAL_MACHINE_STATE s = CDspVm::getVmState(id);

if (VMS_STOPPED == s) {
Expand Down
3 changes: 2 additions & 1 deletion Dispatcher/Dispatcher/Tasks/Task_BackupHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ Prl::Expected<SmartPtr<CVmConfiguration>, PRL_RESULT> Loader::operator()(const C
PRL_RESULT e = PRL_ERR_SUCCESS;
QString s = QString("%1/" VZ_CT_CONFIG_FILE).arg(m_path);
SmartPtr<CVmConfiguration> p = CVzHelper::get_env_config_from_file(
s, e, VZCTL_LAYOUT_5, true);
s, e, ::Ct::Config::LoadOps().
setLayout(VZCTL_LAYOUT_5).setRelative());
if (!p)
return e;
return p;
Expand Down
2 changes: 1 addition & 1 deletion Dispatcher/Dispatcher/Tasks/Task_MigrateCtTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ PRL_RESULT Task_MigrateCtTarget::prepareTask()
#ifdef _LIN_
int z = 0;
QFileInfo x(QDir(m_sCtNewPrivate), VZ_CT_CONFIG_FILE);
SmartPtr<CVmConfiguration> y = CVzHelper::get_env_config_from_file(x.absoluteFilePath(), z);
SmartPtr<CVmConfiguration> y = CVzHelper::get_env_config_from_file(x.absoluteFilePath(), z, ::Ct::Config::LoadOps());
if (y.isValid()) {
bCtExists = m_sSrcCtUuid != y->getVmIdentification()->getVmUuid();
}
Expand Down
9 changes: 5 additions & 4 deletions Dispatcher/Dispatcher/Tasks/Task_VzManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ PRL_RESULT Task_VzManager::delete_env()

// delete temporary registration
CDspService::instance()->getVmDirManager()
.unlockExclusiveVmParameters(m_sVzDirUuid, &vmInfo);
.unlockExclusiveVmParameters(dirUuid, &vmInfo);

return res;
}
Expand Down Expand Up @@ -718,9 +718,10 @@ PRL_RESULT Task_VzManager::changeVNCServerState(SmartPtr<CVmConfiguration> pOldC
}
// VNC config has been changed
else if (newD->getMode() != PRD_DISABLED &&
(oldD->getHostName() != newD->getHostName() ||
oldD->getPortNumber() != newD->getPortNumber() ||
oldD->getPassword() != newD->getPassword())) {
(oldD->getHostName() != newD->getHostName() ||
(newD->getMode() == PRD_MANUAL &&
oldD->getPortNumber() != newD->getPortNumber()) ||
oldD->getPassword() != newD->getPassword())) {
run = CVzHelper::is_env_running(sUuid);
if (boost::logic::indeterminate(run))
return PRL_ERR_OPERATION_FAILED;
Expand Down
20 changes: 11 additions & 9 deletions Dispatcher/Dispatcher/Tasks/Task_VzMigrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,17 +618,19 @@ PRL_RESULT Task_VzMigrate::execVzMigrate(

void Task_VzMigrate::terminateVzMigrate()
{
pid_t p;

QMutexLocker l(&m_terminateVzMigrateMutex);
if (m_pid <= 0) {
m_pfnTermination = &Task_VzMigrate::terminatePidPolicy;
return;
QScopedPointer<CProgressHepler> r(m_progress.take());
QMutexLocker g(&m_terminateVzMigrateMutex);
pid_t p = m_pid;
m_pid = -1;
if (0 < p)
{
terminatePidPolicy(p);
if (!r.isNull())
r->wait();
}
else
m_pfnTermination = &Task_VzMigrate::terminatePidPolicy;

p = m_pid;
m_pid = -1;
terminatePidPolicy(p);
}

void Task_VzMigrate::terminateHandleDispPackageTask()
Expand Down
3 changes: 3 additions & 0 deletions Dispatcher/Dispatcher/Tasks/Task_VzStateMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ void Task_VzStateMonitor::processConfigChangedEvt(const QString &sUuid)
if (!pVmDirItem)
return;

// Invalidate cache
CDspService::instance()->getVzHelper()->getConfigCache().
remove(pVmDirItem->getVmHome());
SmartPtr<CVmConfiguration> pConfig = CDspService::instance()->getVzHelper()->
getCtConfig(CDspClient::makeServiceUser(), sUuid);
if (!pConfig)
Expand Down
1 change: 1 addition & 0 deletions Libraries/CpuFeatures/CCpuHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ struct Visitor : boost::static_visitor<void>
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "spec-ctrl", "stibp", "", "arch-facilities",
"", "ssbd",
NULL
};

Expand Down
15 changes: 13 additions & 2 deletions Libraries/PrlNetworking/PrlNetLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ class CParallelsNetworkConfig;
namespace PrlNet
{

namespace Filter
{

struct Routed
{
QString operator()(const QNetworkInterface& iface) const;
};

} // namespace Filter

/// @class Adapter
/// Describes Ethernet Adapters (both Prl and Ethernet)
struct EthernetAdapter
Expand Down Expand Up @@ -361,8 +371,9 @@ QString getBridgeName(const QString& iface);
bool releaseInterface(const QString& iface);
bool connectInterface(const QString& iface, const QString& bridge);

QStringList makePhysicalAdapterList();
}
QStringList makeAdapterList(const PrlNet::Filter::Routed& filter);

} // namespace PrlNet

#endif // PrlNetLibrary_h__

32 changes: 26 additions & 6 deletions Libraries/PrlNetworking/VMNetworking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,35 @@ PRL_NET_MODE PrlNet::getMode()
return PRL_NET_MODE_VNIC;
}

QStringList PrlNet::makePhysicalAdapterList()
QString PrlNet::Filter::Routed::operator()(const QNetworkInterface& iface) const
{
QStringList names;
if (!QFileInfo(QString("/sys/class/net/%1/device").arg(iface.name())).exists() &&
!QFileInfo(QString("/sys/class/net/%1/bridge").arg(iface.name())).exists())
return QString();

if (iface.addressEntries().isEmpty())
return QString();

QString i = PrlNet::getBridgeName(iface.name());
if (i.isEmpty())
i = iface.name();

return i;
}

QStringList PrlNet::makeAdapterList(const PrlNet::Filter::Routed& filter)
{
QSet<QString> names;
QList<QNetworkInterface> l = QNetworkInterface::allInterfaces();
foreach(const QNetworkInterface& i, l)
{
if ((QNetworkInterface::IsUp & i.flags())
&& QDir(QString("/sys/class/net/%1/device").arg(i.name())).exists())
names << i.name();
if (!(QNetworkInterface::IsUp & i.flags()))
continue;

QString n = filter(i);
if (!n.isEmpty())
names << n;
}
return names;

return names.values();
}
8 changes: 2 additions & 6 deletions Libraries/PrlNetworking/unix/PrlRoutes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,10 @@ bool PrlNet::SetArpToNodeDevices(const QString &ip, const QString &srcMac, bool
}
QTextStream(&f) >> old << 1;

QStringList names = makePhysicalAdapterList();
QStringList names = makeAdapterList(PrlNet::Filter::Routed());

foreach(const QString& name, names)
foreach(const QString& adapter, names)
{
QString adapter = getBridgeName(name);
if (adapter.isEmpty())
adapter = name;

bool rc = SetArpToDevice(ip, adapter, add);

if (!rc) {
Expand Down
18 changes: 9 additions & 9 deletions Libraries/Virtuozzo/CVzHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
#include <prlcommon/PrlCommonUtilsBase/StringUtils.h>


#include <vzctl/libvzctl.h>
#include <vzctl/vzctl_param.h>

#include <boost/bind.hpp>
Expand Down Expand Up @@ -1198,7 +1197,8 @@ QString CVzHelper::getVzPrivateDir()
QString sVzPrivate;
SmartPtr<CVmConfiguration> pConfig;

pConfig = get_env_config_from_file(VZ_GLOBAL_CFG, ret);
pConfig = get_env_config_from_file(VZ_GLOBAL_CFG, ret,
Ct::Config::LoadOps());
if (pConfig) {
sVzPrivate = pConfig->getVmIdentification()->getHomePath();
// remove $VEID
Expand Down Expand Up @@ -1272,7 +1272,7 @@ SmartPtr<CVmConfiguration> CVzHelper::get_env_config(const QString &uuid)

SmartPtr<CVmConfiguration> CVzHelper::get_env_config_from_file(
const QString &sFile, int &err,
int layout, bool use_relative_path)
const Ct::Config::LoadOps &ops)
{
int ret;
SmartPtr<CVmConfiguration> pConfig;
Expand All @@ -1284,18 +1284,18 @@ SmartPtr<CVmConfiguration> CVzHelper::get_env_config_from_file(
return pConfig;
}

int flags = VZCTL_CONF_SKIP_GLOBAL |
use_relative_path ? VZCTL_CONF_USE_RELATIVE_PATH : 0;
VzctlHandleWrap h(vzctl2_env_open_conf(NULL, QSTR2UTF8(sFile), flags, &ret));
VzctlHandleWrap h(vzctl2_env_open_conf(NULL, QSTR2UTF8(sFile),
ops.getFlags(), &ret));
if (h == NULL) {
WRITE_TRACE(DBG_FATAL, "failed vzctl2_env_open_conf %s [%d]",
vzctl2_get_last_error(), ret);
err = PRL_ERR_PARSE_VM_CONFIG;
return pConfig;
}

if (layout) {
if (vzctl2_env_set_layout(vzctl2_get_env_param(h), layout, flags)) {
if (ops.getLayout()) {
if (vzctl2_env_set_layout(vzctl2_get_env_param(h),
ops.getLayout(), ops.getFlags())) {
WRITE_TRACE(DBG_FATAL, "failed vzctl2_env_set_layout: %s",
vzctl2_get_last_error());
err = PRL_ERR_PARSE_VM_CONFIG;
Expand All @@ -1322,7 +1322,7 @@ static QString get_configsample_file_name(const QString &name)
SmartPtr<CVmConfiguration> CVzHelper::get_env_config_sample(const QString &name, int &err)
{
return get_env_config_from_file(
get_configsample_file_name(name.isEmpty() ? QString("vswap.512MB") : name), err);
get_configsample_file_name(name.isEmpty() ? QString("vswap.512MB") : name), err, Ct::Config::LoadOps());
}

static CVmGenericNetworkAdapter *get_venet_device(SmartPtr<CVmConfiguration> &pConfig)
Expand Down
Loading