- 29 4月, 2016 1 次提交
-
-
由 Mikhail Feoktistov 提交于
If we want to delete all disks for container or vm we should make a loop from 0 to NumberOfDisks and always use zero index in PrlVmCfg_GetHardDisk to get disk handle. When we delete first disk after that numbers of other disks will be changed, start from 0 to NumberOfDisks-1. That's why we should always use zero index.
-
- 20 4月, 2016 6 次提交
-
-
由 Nikolay Shirokovskiy 提交于
We don't have input devices in SDK thus for define/dumpxml operations to be consistent we need to: 1. on dumpxml: infer input devices from other parts of config. It is already done in prlsdkLoadDomain. 2. on define: check that input devices are the same that will be infer back on dumpxml operation. The second part should be fixed. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Mikhail Feoktistov 提交于
libvirt handles empty source as NULL, while vz sdk as "" thus we need a bit of conversion. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
-
由 Nikolay Shirokovskiy 提交于
Current implementation does not detect all incompatible configurations. For example if we have in vzsdk bootorder "cdrom1, cdrom0" (that is "hdb, hda" in case of ide cdroms) and cdroms do not have disk images inserted. In this case boot order check code fails to distiguish them at all as for both PrlVmDev_GetFriendlyName gives "". Well the consequences are only missing warnings but as we just have introduced all the necessary tools to face the problem - let's fix it. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Actually using disk PrlVmDev_GetFriendlyName as id on detaching volumes is not a problem. We can only detach hard disks and these can not have empty friendly names. But upcoming update device functionality for cdroms can not use disk source as id at all as update operation typically change this same source value. Thus we will need to use cdrom bus and cdrom target name as cdrom id. So in attempt to use same id scheme for all purpuses lets fix hard disk detach function to use new id. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Our intention is to use disk bus and disk target name pair as disk id instead of name returned by PrlVmDev_GetFriendlyName. We already have the code that extracts this pair from vzsdk data. Let's factor it out into a function. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
- 14 4月, 2016 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
SDK does not allocate memory when getting strings thus we need to call every function that returns string twice. First to obtain string length, second to obtain string itself. It is tedious so let's create helper functions for cases when we know length of the result beforehand and we are not. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
- 13 4月, 2016 4 次提交
-
-
由 Maxim Nestratov 提交于
Lock driver when a new domain is created in prlsdkNewDomainByHandle and try to find it in the list under lock again because it can race with vzDomainDefineXMLFlags when a domain with the same uuid is added via vz dispatcher directly and libvirt define. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
由 Maxim Nestratov 提交于
This patch introduces a new 'vzDriver' lockable object and provides helper functions to allocate/destroy it and we pass it to prlsdkXxx functions instead of virConnectPtr. Now we store domain related objects such as domain list, capabitilies etc. within a single vz_driver vzDriver structure, which is shared by all driver connections. It is allocated during daemon initialization or in a lazy manner when a new connection to 'vz' driver is established. When a connection to vz daemon drops, vzDestroyConnection is called, which in turn relays disconnect event to all connection to 'vz' driver. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
由 Pavel Hrdina 提交于
GCC in RHEL-6 complains about listen: ../../src/conf/domain_conf.c:23718: error: declaration of 'listen' shadows a global declaration [-Wshadow] /usr/include/sys/socket.h:204: error: shadowed declaration is here [-Wshadow] This renames all the listen to gListen. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
There is no point the use two different getters on the same listen structure few lines apart. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 12 4月, 2016 2 次提交
-
-
由 Nikolay Shirokovskiy 提交于
we don't need to allocate macstr at all as it is an array and already has the the space it needs. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Quite straigthforward as vz sdk memory setting function makes just what we want to that is set "amount of physical memory allocated to a domain". 'useflags' is introduced for non flag function implementation. We can't just use combination of flags like "live | config" or we fail for inactive domains. Other combinations have drawbacks too. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
- 07 4月, 2016 3 次提交
-
-
由 Nikolay Shirokovskiy 提交于
As usual we try to deal correctly with vz domains that were created by other means and thus can have all range of SDK domain parameters. If vz domain boot order can't be represented in libvirt os boot section let's give warning and make os boot section represent SDK to some extent. 1. Os boot section supports up to 4 boot devices. Here we just cut SDK boot order up to this limit. Not too bad. 2. If there is a floppy in boot order let's just skip it. Anyway we don't show it in the xml. Not too bad too. 3. SDK boot order with unsupported disks order. Say we have "hdb, hda" in SDK. We can not present this thru os boot order. Well let's just give warning but leave double <boot dev='hd'/> in xml. It's kind of misleading but we warn you! SDK boot order have an extra parameters 'inUse' and 'sequenceIndex' which makes our task more complicated. In realitly however 'inUse' is always on and 'sequenceIndex' is not less than 'boot position index' which simplifies out task back again! To be on a safe side let's explicitly check for this conditions! We have another exercise here. We want to check for unrepresentable condition 3 (see above). The tricky part is that in contrast to domains defined thru this driver 3-rd party defined domains can have device ordering different from default. Thus we need some id to check that N-th boot disk of os boot section is same as N-th boot disk of SDK boot. This is what prlsdkBootOrderCheck for. It uses disks sources paths as id for disks and iface names for network devices. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
We want to report boot order in dumpxml for vz domains. Thus we want disks devices to be sorted in output compatible with boot ordering specification. So let's just use virDomainDiskInsert which makes appropriate sorting. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
The patch makes some refactoring of the existing code. Current boot order spec code makes very simple thing in somewhat obscure way. In case of VMs it sets the first hdd as the only bootable device. In case of CTs it doesn't touch the boot order at all if one of the filesystems is mounted to root. Otherwise like in case of VMs it sets the first hdd as the only bootable device and additionally sets this device mount point to root. Refactored code makes all this explicit. The actual boot order support is simple. Common libvirt domain xml parsing code makes the exact ordering of disks devices as described in docs for boot ordering (disks are sorted by bus order first, device target second. Bus order is the order of disk buses appearence in original xml. Device targets order is alphabetical). We add devices in the same order and SDK designates device indexes sequentially for each device type. Thus device index is equal to its boot index. For example N-th cdrom in boot specification refers to sdk cdrom with it's device index N. If there is no boot spec in xml the parsing code will add <boot dev='hdd'> for HVMs automatically and we backward compatibly set fist hdd as bootable. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 21 3月, 2016 1 次提交
-
-
由 Cole Robinson 提交于
It's just a combination of AddImplicitControllers, and AddConsoleCompat. Every caller that wants ImplicitControllers also wants the ConsoleCompat AFAICT, so lump them together. We also need it for future patches.
-
- 17 3月, 2016 5 次提交
-
-
由 Mikhail Feoktistov 提交于
In prlsdkAddNet() Attach/DetachNet() functions privconn should be the first argument
-
由 Mikhail Feoktistov 提交于
Each version of virtuozzo supports only one type of SCSI controller So if we add disk on SCSI bus, we should set SCSI controller model. We can take it from vzCapabilities structure.
-
由 Mikhail Feoktistov 提交于
We should report correct disk format depending on vz version and domain type. Since we support only one disk format for each domain type, we can take it from vzCapabilities structure.
-
由 Maxim Nestratov 提交于
As long as we have another function checking disk parameters correctness, let's have them in one place. Here we change prefix of the moved function and start to call it from vzCheckUnsupportedDisks rather than add disk. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
由 Mikhail Feoktistov 提交于
Now we check disk parameters correctness in DomainPostParse. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 14 3月, 2016 1 次提交
-
-
由 Maxim Nestratov 提交于
Since commit 9c14a9ab we have broken active domain listing because reworked prlsdkLoadDomain doesn't set dom->def->id propely. It just looses it when a new def structure is set. Now we make prlsdkConvertDomainState function return void and move calling it after an old dom->def is replaces with a new one within prlsdkLoadDomain function. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 01 3月, 2016 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
- 12 2月, 2016 4 次提交
-
-
由 Mikhail Feoktistov 提交于
Race condition: User calls defineXML to create new instance. The main thread from vzDomainDefineXMLFlags() creates new instance by prlsdkCreateVm. Then this thread calls prlsdkAddDomain to add new domain to domains list. The second thread receives notification from hypervisor that new VM was created. It calls prlsdkHandleVmAddedEvent() and also tries to add new domain to domains list. These two threads call virDomainObjListFindByUUID() from prlsdkAddDomain() and don't find new domain. So they add two domains with the same uuid to domains list. This fix splits logic of prlsdkAddDomain() into two functions. 1. vzNewDomain() creates new empty domain in domains list with the specific uuid. 2. prlsdkLoadDomain() add data from VM to domain object. New algorithm for creating an instance: In vzDomainDefineXMLFlags() we add new domain to domain list by calling vzNewDomain() and only after that we call CreateVm() to create VM. It means that we "reserve" domain object with the specific uuid. After creation of new VM we add info from this VM to reserved domain object by calling prlsdkLoadDomain(). Before this patch prlsdkLoadDomain() worked in 2 different cases: 1. It creates and initializes new domain. Then updates it from sdk handle. 2. It updates existed domain from sdk handle. In this patch we remove code which creates new domain from LoadDomain() and move it to vzNewDomain(). Now prlsdkLoadDomain() only updates domain from skd handle. In notification handler prlsdkHandleVmAddedEvent() we check the existence of a domain and if it doesn't exist we add new domain by calling vzNewDomain() and load info from sdk handle via prlsdkLoadDomain().
-
由 Mikhail Feoktistov 提交于
Bug cause: Update the domain that is subscribed to hypervisor notification. LoadDomain() rewrites notifications fields in vzDomObj structure and makes domain as "unsubscribed". Fix: Initialize notification fields in vzDomObj only if we create a new domain. And do not reinitialize these fields if we update domain (by calling LoadDomain with olddom argument)
-
由 Mikhail Feoktistov 提交于
In commit 7039bb3c we have removed code that saves uuid to vzDomObj.uuid So this field is no longer needed.
-
由 Mikhail Feoktistov 提交于
prlsdkGetDomainIds() returns name and uuid for specified instance. Now output arguments can be NULL. It allows to get only necessary info(name or uuid).
-
- 08 2月, 2016 2 次提交
-
-
由 Peter Krempa 提交于
Now with the new struct the data can be stored in a much saner place.
-
由 Peter Krempa 提交于
This step can be omitted, so that drivers can decide what to do when the user requests to use default vcpu pinning.
-
- 26 1月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
The array doesn't necessarily have the same cardinality as the count of vCPUs for a domain. Iterating it can cause access beyond the end of the array.
-
- 24 12月, 2015 3 次提交
-
-
由 Maxim Nestratov 提交于
Implement VIR_DOMAIN_UNDEFINE_MANAGED_SAVE and VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA flags support. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
由 Maxim Nestratov 提交于
prlsdkCleanupBridgedNet call should be made strongly after any actual domain deletion accurs. By doing this we avoid any potential problems connected with second undefine call when it is made after first one fails by some reason, and we detect that network is already deleted. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
由 Maxim Nestratov 提交于
Currently vz driver unregisters domains when undefine is called, which is wrong because it contradicts with expected behavior. All vz domains are persistent, which means that when one is defined a new bundle directory containing meta data is created. Undefining domains in a way we do now leaves those directories undeleted, which prevents subsequent define call for the same domain xml. I.e. the following sequence define->undefine->define doesn't work now. The patch fixes the problem by calling PrlVm_Delete instead of PrlVm_Unreg detaching all disks prior actually doing this to prevent images deletion. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 09 12月, 2015 4 次提交
-
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
The new helper will simplify checking whether the domain config contains inactive vCPUs.
-
由 Peter Krempa 提交于
To support further refactors replace all write access to def->maxvcpus with a accessor function.
-
- 27 11月, 2015 1 次提交
-
-
由 Marc-André Lureau 提交于
Following the domain XML naming Signed-off-by: NMarc-André Lureau <marcandre.lureau@gmail.com>
-