- 19 7月, 2016 4 次提交
-
-
由 Nikolay Shirokovskiy 提交于
9c14a9ab introduced vzNewDomain function to enlist libvirt domain object before actually creating vz sdk domain. Fix should fix race on same vz sdk domain added event where libvirt domain object is enlisted too. But later eb5e9c1e added locked checks for adding livirtd domain object to list on vz sdk domain added event. Thus now approach of 9c14a9ab is unnecessary complicated. See we have otherwise unuseful prlsdkGetDomainIds function only to create minimal domain definition to create libvirt domain object. Also vzNewDomain is difficult to use as it creates partially constructed domain object. Let's move back to original approach where prlsdkLoadDomain do all the necessary job. Another benefit is that we can now take driver lock for bare minimum and in single place. Reducing locking time have small disadvatage of double parsing on race conditions which is typical if domain is added thru vz driver. Well we have this double parse inevitably with current vz sdk api on any domain updates so i would not take it here seriously. Performance events subscribtion is done before locked check and therefore could be done twice on races but this is not the problem. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Olga Krishtal 提交于
Vz containers are able to use ploop volumes from storage pools to work upon. To use filesystem type volume, pool name and volume name should be specifaed in <source> : <filesystem type='volume' accessmode='passthrough'> <driver type='ploop' format='ploop'/> <source pool='guest_images' volume='TEST_POOL_CT'/> <target dir='/'/> </filesystem> The information about pool and volume is stored in ct dom configuration: <StorageURL>libvirt://localhost/pool_name/vol_name</StorageURL> and can be easily obtained via PrlVmDevHd_GetStorageURL sdk call. The only shorcoming: if storage pool is moved somewhere the ct should be redefined in order to refresh the information aboot path to root.hdd Signed-off-by: NOlga Krishtal <okrishtal@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Adding domain to domain list on preparation step is not correct. First domain is not fully constructed - domain definition is missing. Second we can't use VIR_MIGRATE_PARAM_DEST_XML parameter to parse definition as vz sdk can patch it by itself. Let's add/remove domain on finish step. This is for synchronization purpose only so domain is present/absent on destination after migration completion. Actually domain object will probably be created right after actual vz sdk migration start by vz sdk domain defined event. We can not and should not sync domain cache on error path in finish step of migration. We can not as we really don't know what is the reason of cancelling and we should not as user should not make assumptions on state on error path. What we should do is cleaning up temporary migration state that is induced on prepare step but we don't have one. Thus cancellation should be noop. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 26 6月, 2016 2 次提交
-
-
由 Nikolay Shirokovskiy 提交于
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Attach/detach functions for disk/net are quite trivial and typically call a few functions in begin/end edit frame. Having in mind update function too adding configuring for another device (like graphics) will introduce 3 trivial functions more. Let's replace current approach by attach/detach functions for device. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 11 6月, 2016 2 次提交
-
-
由 Mikhail Feoktistov 提交于
-
由 Nikolay Shirokovskiy 提交于
The approach of subscribing on first stat API call and then waiting for receiving of performance event from sdk to process the call originates in times when every vz libvirt connections spawns its own sdk connection. Thus without this waiting virsh stat call would return empty stats. Now with single sdk connection this scheme is unnecessary complicated. This patch subscribes to performance events on first domain appearence and unsubscribe on its removing. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 19 5月, 2016 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
The newest version of migration protocol - version 3 with parameters is implemented. Supported flags is VIR_MIGRATE_PAUSED only. Supported parameters are VIR_MIGRATE_PARAM_URI and VIR_MIGRATE_PARAM_DEST_NAME. VIR_MIGRATE_PARAM_DEST_XML is in VZ_MIGRATION_PARAMETERS for technical onyl reasons. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 18 5月, 2016 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
This solution does not keep snapshots cache because vz sdk lacks good support for snapshot related events. Libvirt and vz sdk has different approach to snapshot ids. vz sdk always auto generate them while libvirt has ability to specify id by user. Thus I have no other choice rather than simply ignore ids set by user or generated by libvirt. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 13 4月, 2016 1 次提交
-
-
由 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>
-
- 12 4月, 2016 1 次提交
-
-
由 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>
-
- 17 3月, 2016 2 次提交
-
-
由 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.
-
- 12 2月, 2016 1 次提交
-
-
由 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().
-
- 24 12月, 2015 1 次提交
-
-
由 Maxim Nestratov 提交于
Implement VIR_DOMAIN_UNDEFINE_MANAGED_SAVE and VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA flags support. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
- 19 11月, 2015 1 次提交
-
-
由 Mikhail Feoktistov 提交于
Diff from v1. 1. Add virCheckFlags() call in vzDomainReboot
-
- 26 6月, 2015 3 次提交
-
-
由 Nikolay Shirokovskiy 提交于
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: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Comments. Replace vzDomObjFromDomain/virObjectUnlock pair to vzDomObjFromDomainRef/virDomainObjEndAPI as we use prlsdkGetStatsParam. See previous statistics comments. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
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: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
- 25 6月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
In the e6d180f0 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 6de12b02. Fix all the missing renames. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 24 6月, 2015 1 次提交
-
-
由 Mikhail Feoktistov 提交于
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.
-
- 17 6月, 2015 2 次提交
-
-
由 Maxim Nestratov 提交于
This patch moves all src/parallels/parallels* files to vz/vz* and fixes build accordingly. No functional changes. Signed-off-by: NMaxim Nestratov <mnestratov@parallels.com>
-
由 Maxim Nestratov 提交于
This patch changes all parallels/vz driver structure and function prefixes from parallels to vz. No functional changes. Signed-off-by: NMaxim Nestratov <mnestratov@parallels.com>
-
- 09 6月, 2015 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
Statistics provided through PCS SDK. As we have only async interface in SDK we need to be subscribed to statistics in order to get it. Trivial solution on every stat request to subscribe, wait event and then unsubscribe will lead to significant delays in case of a number of successive requests, as the event will be delivered on next PCS server notify cycle. On the other hand we don't want to keep unnesessary subscribtion. So we take an hibrid solution to subcsribe on first request and then keep a subscription while requests are active. We populate cache of statistics on subscribtion events and use this cache to serve libvirts requests. * Cache details. Cache is just handle to last arrived event, we call this cache as if this handle is valid it is used to serve synchronous statistics requests. We use number of successive events count to detect that user lost interest to statistics. We reset this count to 0 on every request. If more than PARALLELS_STATISTICS_DROP_COUNT successive events arrive we unsubscribe. Special value of -1 of this counter is used to differentiate between subscribed/unsubscribed state to protect from delayed events. Values of PARALLELS_STATISTICS_DROP_COUNT and PARALLELS_STATISTICS_TIMEOUT are just drop-ins, choosen without special consideration. * Thread safety issues Use parallelsDomObjFromDomainRef in parallelsDomainBlockStats as we could wait on domain lock down on stack in prlsdkGetStatsParam and if we won't keep reference we could get dangling pointer on return from wait. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@parallels.com>
-
- 13 5月, 2015 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
We have a lot of passing arguments code just to pass connection object cause it holds jobTimeout. Taking into account that right now this value is defined at compile time let's just get rid of it and make arguments list more clear in many places. In case we later need some runtime configurable timeout value we can provide this value through arguments function already operate such as a parallels domain object etc as this timeouts are operation( and thus object) specific in practice. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@parallels.com>
-
- 29 4月, 2015 1 次提交
-
-
由 Maxim Nestratov 提交于
New functions utilize previosly added prlsdkDelDisk and prlsdkGetDiskIndex Signed-off-by: NMaxim Nestratov <mnestratov@parallels.com>
-
- 13 4月, 2015 1 次提交
-
-
由 Alexander Burluka 提交于
Parallels Cloud Server supports block devices and virtual NIC live attachment. I implemented that function for block devices so OpenStack volume attachment is now works. Signed-off-by: NAlexander Burluka <aburluka@parallels.com>
-
- 10 4月, 2015 3 次提交
-
-
由 Dmitry Guryanov 提交于
Implement virDomainManagedSave api function. In PCS this feature called "suspend". You can suspend VM or CT while it is in running or paused state. And after resuming (or starting) it will have the same state, as before suspend. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Split function prlsdkDomainChangeState into prlsdkDomainChangeStateLocked and prlsdkDomainChangeState. So it can be used from places, where virDomainObj already found and locked. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Return value of functions prlsdkStart/Kill/Stop e.t.c. is PRL_RESULT in parallels_sdk.c and int in parallels_sdk.h. PRL_RESULT is int, so compiler didn't report errors. Let's fix the difference. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
- 10 12月, 2014 8 次提交
-
-
由 Dmitry Guryanov 提交于
If we want to perform some operation and domain state is not suitable for that operation, we should report error VIR_ERR_OPERATION_INVALID. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
First, we don't need to call prlsdkApplyConfig after creating new VM or containers, because it's done in functions prlsdkCreateVm and prlsdkCreateCt. No need to check, if domain exists in the list after prlsdkAddDomain. Also organize code, so that we can call virObjectUnlock in one place. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
This patch replaces code, which creates domains by running prlctl command. prlsdkCreateVm/Ct will do prlsdkApplyConfig, because we send request to the server only once in this case. But prlsdkApplyConfig will be called also from parallelsDomainDefineXML function. There is no problem with it, parallelsDomainDefineXML will be refactored later. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Rewrite code, which applies domain configuration given to virDomainDefineXML function to the VM of container registered in PCS. This code first check if there are unsupported parameters in domain XML and if yes - reports error. Some of such parameters are not supported by PCS, for some - it's not obvious, how to convert them into PCS's corresponding params, so let's put off it, and implement only basic params in this patch. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Dmitry Guryanov 提交于
Change domain state using parallels SDK functions instead of prlctl command. We don't need to send events from these functions now, becase events handler will send them. But we still need to update virDomainObj in privconn->domains. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Alexander Burluka 提交于
Subscribe to events from parallels server. It's needed for 2 things: to update cached domains list and to send corresponding libvirt events. Parallels server sends a lot of different events, in this patch we handle only some of them. In the future we can handle for example, changes in a host network configuration or devices states. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
由 Alexander Burluka 提交于
Obtain information about domains using parallels sdk instead of prlctl. prlsdkLoadDomains functions behaves as former parallelsLoadDomains with NULL as second parameter (name) - it fills parallelsConn.domains list. prlsdkLoadDomain is now able to update specified domain by given virDomainObjPtr. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-
- 25 9月, 2014 1 次提交
-
-
由 Dmitry Guryanov 提交于
Add files parallels_sdk.c and parallels_sdk.h for code which works with SDK, so libvirt's code will not mix with dealing with parallels SDK. To use Parallels SDK you must first call PrlApi_InitEx function, and then you will be able to connect to a server with PrlSrv_LoginLocalEx function. When you've done you must call PrlApi_Deinit. So let's call PrlApi_InitEx on first .connectOpen, count number of connections and deinitialize, when this counter becomes zero. Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
-