1. 01 3月, 2016 1 次提交
  2. 12 2月, 2016 1 次提交
    • M
      vz: fix race condition when adding domain to domains list · 9c14a9ab
      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().
      9c14a9ab
  3. 04 2月, 2016 1 次提交
  4. 11 1月, 2016 1 次提交
  5. 24 12月, 2015 2 次提交
  6. 09 12月, 2015 2 次提交
  7. 24 11月, 2015 1 次提交
  8. 19 11月, 2015 1 次提交
  9. 10 11月, 2015 1 次提交
  10. 21 10月, 2015 1 次提交
  11. 20 10月, 2015 3 次提交
  12. 08 10月, 2015 1 次提交
  13. 06 10月, 2015 2 次提交
  14. 22 9月, 2015 1 次提交
  15. 14 7月, 2015 3 次提交
  16. 08 7月, 2015 2 次提交
  17. 06 7月, 2015 1 次提交
    • D
      vz: fix building capabilities · 651426e9
      Dmitry Guryanov 提交于
      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: NDmitry Guryanov <dguryanov@parallels.com>
      651426e9
  18. 28 6月, 2015 1 次提交
  19. 26 6月, 2015 4 次提交
  20. 24 6月, 2015 1 次提交
    • M
      vz: implementation of attach/detach network devices · 6de12b02
      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.
      6de12b02
  21. 17 6月, 2015 2 次提交
  22. 16 6月, 2015 1 次提交
  23. 09 6月, 2015 2 次提交
    • D
      parallels: fix formatting errors in parallels driver · ad658a60
      Dmitry Guryanov 提交于
      This patch fixes several formatting errors, which I
      missed before pushing previous patches. Mostly because
      of missing cppi package.
      ad658a60
    • N
      parallels: add block device statistics to driver · 489c81c0
      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>
      489c81c0
  24. 03 6月, 2015 4 次提交