1. 23 3月, 2015 2 次提交
  2. 16 3月, 2015 1 次提交
    • P
      conf: Replace access to def->mem.max_balloon with accessor functions · 4f9907cd
      Peter Krempa 提交于
      As there are two possible approaches to define a domain's memory size -
      one used with legacy, non-NUMA VMs configured in the <memory> element
      and per-node based approach on NUMA machines - the user needs to make
      sure that both are specified correctly in the NUMA case.
      
      To avoid this burden on the user I'd like to replace the NUMA case with
      automatic totaling of the memory size. To achieve this I need to replace
      direct access to the virDomainMemtune's 'max_balloon' field with
      two separate getters depending on the desired size.
      
      The two sizes are needed as:
      1) Startup memory size doesn't include memory modules in some
      hypervisors.
      2) After startup these count as the usable memory size.
      
      Note that the comments for the functions are future aware and document
      state that will be present after a few later patches.
      4f9907cd
  3. 13 3月, 2015 1 次提交
  4. 21 2月, 2015 1 次提交
  5. 06 2月, 2015 1 次提交
  6. 27 1月, 2015 1 次提交
    • D
      Removing probing of secondary drivers · 55ea7be7
      Daniel P. Berrange 提交于
      For stateless, client side drivers, it is never correct to
      probe for secondary drivers. It is only ever appropriate to
      use the secondary driver that is associated with the
      hypervisor in question. As a result the ESX & HyperV drivers
      have both been forced to do hacks where they register no-op
      drivers for the ones they don't implement.
      
      For stateful, server side drivers, we always just want to
      use the same built-in shared driver. The exception is
      virtualbox which is really a stateless driver and so wants
      to use its own server side secondary drivers. To deal with
      this virtualbox has to be built as 3 separate loadable
      modules to allow registration to work in the right order.
      
      This can all be simplified by introducing a new struct
      recording the precise set of secondary drivers each
      hypervisor driver wants
      
      struct _virConnectDriver {
          virHypervisorDriverPtr hypervisorDriver;
          virInterfaceDriverPtr interfaceDriver;
          virNetworkDriverPtr networkDriver;
          virNodeDeviceDriverPtr nodeDeviceDriver;
          virNWFilterDriverPtr nwfilterDriver;
          virSecretDriverPtr secretDriver;
          virStorageDriverPtr storageDriver;
      };
      
      Instead of registering the hypervisor driver, we now
      just register a virConnectDriver instead. This allows
      us to remove all probing of secondary drivers. Once we
      have chosen the primary driver, we immediately know the
      correct secondary drivers to use.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      55ea7be7
  7. 16 1月, 2015 1 次提交
  8. 14 1月, 2015 1 次提交
    • D
      Give virDomainDef parser & formatter their own flags · 0ecd6851
      Daniel P. Berrange 提交于
      The virDomainDefParse* and virDomainDefFormat* methods both
      accept the VIR_DOMAIN_XML_* flags defined in the public API,
      along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
      defined in domain_conf.c.
      
      This is seriously confusing & error prone for a number of
      reasons:
      
       - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
         VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
         formatting operation
       - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
         to parse or to format, but not both.
      
      This patch cleanly separates out the flags. There are two
      distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
      flags that are used by the corresponding methods. The
      VIR_DOMAIN_XML_* flags received via public API calls must
      be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
      needed.
      
      The various calls to virDomainDefParse which hardcoded the
      use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
      VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
      0ecd6851
  9. 13 1月, 2015 1 次提交
  10. 06 1月, 2015 2 次提交
  11. 03 12月, 2014 1 次提交
    • J
      Replace virDomainFree with virObjectUnref · 8fb3aee2
      John Ferlan 提交于
      Since virDomainFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      8fb3aee2
  12. 15 11月, 2014 1 次提交
  13. 07 11月, 2014 1 次提交
  14. 29 10月, 2014 5 次提交
    • T
      vbox: Make CreateHardDisk support all vbox versions · 382e655d
      Taowei Luo 提交于
      The CreateHardDiskMedium only support create HardDisk for medium
      type, and it only works when vbox version >= 3.1. This patch make
      the function workable with all vbox versions and rename it as
      CreateHardDisk.
      
      In vbox 2.2 and 3.0 this function will create a IHardDisk object.
      In vbox later than 3.0, this function will create a IMedium object.
      382e655d
    • T
      vbox: Make FindMedium support old vbox versions · 1599319c
      Taowei Luo 提交于
      In old version, function FindMedium in UIVirtualBox doesn't work
      for vbox2.2 and 3.0. We assume it will not be used when vbox in
      these versions.
      
      But when rewriting vboxStorageVolLookupByPath, we found it was
      compatibe to use FindMedium to get a IHardDisk object, even in
      vbox old versions. To achieve this, first make FindMedium call
      FindHardDisk when VBOX_API_VERSION < 4000000.
      Then change the argument type **IMedium to **IHardDisk. (As the
      rules in heriachy, we can't transfer a IHardDisk to match
      IMedium in output)
      
      In vbox 2.2 and 3.0, the caller must be aware that they will get
      a IHardDisk object in return.
      1599319c
    • T
      vbox: move common codes to vbox_common.h · 7d5b9419
      Taowei Luo 提交于
      There are lots of macro declarations in vbox_common.c,
      vbox_network.c, and the coming vbox_storage.c which simply the API
      calling. Since they are totally the same. We shouldn't keep three
      copies of that, so they are moved to vbox_common.h.
      
      Note: The macros are quite different from those in vbox_tmpl.c,
            because they are using different API.
      7d5b9419
    • T
      vbox: Remove VBOX_OBJECT_CHECK macro · a6b1cde3
      Taowei Luo 提交于
      We should follow the rules that CHECK macro only do checking works.
      But this VBOX_OBJECT_CHECK and VBOX_OBJECT_HOST_CHECK declared some
      varibles at the same time, which broke the rule. So the patch
      removed this macros and dispatched it in source code.
      
      The storage driver is still not rewriten at this point. So, I
      remains the VBOX_OBJECT_CHECK macro in vbox_tmpl.c. But this will
      finally be removed in patch 'vbox: Remove unused things in vbox_tmpl.c'
      a6b1cde3
    • T
      vbox: Fix copyright mistake · c5cc26e6
      Taowei Luo 提交于
      I made a mistake on copyright in patch 7f0f415b.
      
      If I copied codes from one file to another, I should copy the
      copyright announcement as well. So this patch makes up the
      copyright which I should have added in the previous patch.
      c5cc26e6
  15. 23 10月, 2014 1 次提交
  16. 15 10月, 2014 1 次提交
  17. 03 10月, 2014 1 次提交
    • T
      vbox: Interfaces for register per parties · fac5d061
      Taowei 提交于
      The patch dbb4cbf5 by Michal has splited the vbox driver into
      three parties. This modification brings a more suitable interface
      to the previous patch.
      
      The new function vboxGetDriver is introduced to get the
      corresponding vbox domain driver directly thought the vbox version.
      
      Functions like vboxGetNetworkDriver and vboxGetStorageDriver
      will be introduced after rewriting it's drivers.
      
      This patch, by the way, fixed the align problem for vbox in
      Makefile.am
      fac5d061
  18. 26 9月, 2014 1 次提交
  19. 25 9月, 2014 1 次提交
  20. 11 9月, 2014 1 次提交
    • J
      vbox: Resolve Coverity UNUSED_VALUE · abddeb84
      John Ferlan 提交于
      Handle a few places where Coverity complains about the value being
      unused. For two of them (Close cases) - the comments above the close
      indicate there is no harm to ignore the error - so added an ignore_value.
      For the other condition, added an rc check like other callers.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      abddeb84
  21. 10 9月, 2014 1 次提交
    • M
      conf: Extend <loader/> and introduce <nvram/> · 68bf13db
      Michal Privoznik 提交于
      Up to now, users can configure BIOS via the <loader/> element. With
      the upcoming implementation of UEFI this is not enough as BIOS and
      UEFI are conceptually different. For instance, while BIOS is ROM, UEFI
      is programmable flash (although all writes to code section are
      denied). Therefore we need new attribute @type which will
      differentiate the two. Then, new attribute @readonly is introduced to
      reflect the fact that some images are RO.
      
      Moreover, the OVMF (which is going to be used mostly), works in two
      modes:
      1) Code and UEFI variable store is mixed in one file.
      2) Code and UEFI variable store is separated in two files
      
      The latter has advantage of updating the UEFI code without losing the
      configuration. However, in order to represent the latter case we need
      yet another XML element: <nvram/>. Currently, it has no additional
      attributes, it's just a bare element containing path to the variable
      store file.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      68bf13db
  22. 05 9月, 2014 1 次提交
    • E
      maint: use hanging curly braces · 625e04a8
      Eric Blake 提交于
      Our style overwhelmingly uses hanging braces (the open brace
      hangs at the end of the compound condition, rather than on
      its own line), with the primary exception of the top level function
      body.  Fix the few remaining outliers, before adding a syntax
      check in a later patch.
      
      * src/interface/interface_backend_netcf.c (netcfStateReload)
      (netcfInterfaceClose, netcf_to_vir_err): Correct use of { in
      compound statement.
      * src/conf/domain_conf.c (virDomainHostdevDefFormatSubsys)
      (virDomainHostdevDefFormatCaps): Likewise.
      * src/network/bridge_driver.c (networkAllocateActualDevice):
      Likewise.
      * src/util/virfile.c (virBuildPathInternal): Likewise.
      * src/util/virnetdev.c (virNetDevGetVirtualFunctions): Likewise.
      * src/util/virnetdevmacvlan.c
      (virNetDevMacVLanVPortProfileCallback): Likewise.
      * src/util/virtypedparam.c (virTypedParameterAssign): Likewise.
      * src/util/virutil.c (virGetWin32DirectoryRoot)
      (virFileWaitForDevices): Likewise.
      * src/vbox/vbox_common.c (vboxDumpNetwork): Likewise.
      * tests/seclabeltest.c (main): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      625e04a8
  23. 04 9月, 2014 1 次提交
    • E
      maint: use consistent if-else braces in lxc, vbox, phyp · 279b1b10
      Eric Blake 提交于
      I'm about to add a syntax check that enforces our documented
      HACKING style of always using matching {} on if-else statements.
      
      This patch focuses on drivers that had several issues.
      
      * src/lxc/lxc_fuse.c (lxcProcGetattr, lxcProcReadMeminfo): Correct
      use of {}.
      * src/lxc/lxc_driver.c (lxcDomainMergeBlkioDevice): Likewise.
      * src/phyp/phyp_driver.c (phypConnectNumOfDomainsGeneric)
      (phypUUIDTable_Init, openSSHSession, phypStoragePoolListVolumes)
      (phypConnectListStoragePools, phypDomainSetVcpusFlags)
      (phypStorageVolGetXMLDesc, phypStoragePoolGetXMLDesc)
      (phypConnectListDefinedDomains): Likewise.
      * src/vbox/vbox_common.c (vboxAttachSound, vboxDumpDisplay)
      (vboxDomainRevertToSnapshot, vboxDomainSnapshotDelete): Likewise.
      * src/vbox/vbox_tmpl.c (vboxStorageVolGetXMLDesc): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      279b1b10
  24. 15 8月, 2014 11 次提交