1. 08 11月, 2014 1 次提交
    • M
      domain_conf: Use virDomainParseMemory more widely · 01b4de2b
      Michal Privoznik 提交于
      As reviewing patches upstream it occurred to me, that we have two
      functions doing nearly the same: virDomainParseMemory which
      expects XML in the following format:
      
        <memory unit='MiB'>1337</memory>
      
      The other function being virDomainHugepagesParseXML expecting the
      following format:
      
        <someElement size='1337' unit='MiB'/>
      
      It wouldn't matter to have two functions handle two different
      scenarios like this if we could only not copy code that handles
      32bit arches around. So this code merges the common parts into
      one by inventing new @units_xpath argument to
      virDomainParseMemory which allows overriding the default location
      of @unit attribute in XML. With this change both scenarios above
      can be parsed with virDomainParseMemory.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      01b4de2b
  2. 07 11月, 2014 1 次提交
  3. 01 11月, 2014 1 次提交
    • E
      domain: fix parsing of memory tunables on 32-bit machines · 9998a657
      Eric Blake 提交于
      Commit 6c9a8a49 (Oct 2014) exposed a long-standing issue on 32-bit
      machines: code related to virDomainSetMemoryParameters has always
      been documented as using a 64-bit limit, but it was implemented by
      calling virDomainParseMemory which enforced an 'unsigned long'
      limit.  Since VIR_DOMAIN_MEMORY_PARAM_UNLIMITED capped to a
      long is -1, but virDomainParseScaledValue no longer accepts
      negative values, an attempt to use 2^53-1 as a hard memory limit
      started failing the testsuite.  However, the problem with capping
      things artificially low has existed for much longer - ever since
      commits 4888f0fb and 2e22f23b (Mar 2012) switched internal tracking
      from 'unsigned long' to 'unsigned long long' (prior to that time,
      the cap was a side-effect of the choice of types).  We _have_ to
      cap the balloon memory values, (no thanks to baked in 'unsigned long'
      of API such as virDomainSetMaxMemory or virDomainGetInfo with no
      counterpart API that guarantees 64-bit access to those numbers)
      but memory parameters have never needed the artificial limit.
      
      At any rate, the solution is to make the parser function gain a
      parameter, and only do the reduced 32-bit cap for the values that
      are constrained due to API.
      
      * src/conf/domain_conf.h (_virDomainMemtune): Add comments.
      * src/conf/domain_conf.c (virDomainParseMemory): Add parameter.
      (virDomainDefParseXML): Adjust callers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9998a657
  4. 30 10月, 2014 1 次提交
  5. 25 10月, 2014 1 次提交
  6. 20 10月, 2014 1 次提交
  7. 15 10月, 2014 4 次提交
  8. 13 10月, 2014 1 次提交
  9. 11 10月, 2014 1 次提交
    • J
      Xen: Defer setting default vram value to Xen drivers · 9320c3ff
      Jim Fehlig 提交于
      Allow the Xen drivers to determine default vram values.  Sane
      default vaules depend on the device model being used, so the
      drivers are in the best position to determine the defaults.
      
      For the legacy xen driver, it is best to maintain the existing
      logic for setting default vram values to ensure there are no
      regressions.  The libxl driver currently does not support
      configuring a video device.  Support will be added in a
      subsequent patch, where the benefit of this change will be
      reaped.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      9320c3ff
  10. 06 10月, 2014 1 次提交
    • L
      conf: add trustGuestRxFilters attribute to network and domain interface · 07450cd4
      Laine Stump 提交于
      This new attribute will control whether or not libvirt will pay
      attention to guest notifications about changes to network device mac
      addresses and receive filters. The default for this is 'no' (for
      security reasons). If it is set to 'yes' *and* the specified device
      model and connection support it (currently only macvtap+virtio) then
      libvirt will watch for NIC_RX_FILTER_CHANGED events, and when it
      receives one, it will issue a query-rx-filter command, retrieve the
      result, and modify the host-side macvtap interface's mac address and
      unicast/multicast filters accordingly.
      
      The functionality behind this attribute will be in a later patch. This
      patch merely adds the attribute to the top-level of a domain's
      <interface> as well as to <network> and <portgroup>, and adds
      documentation and schema/xml2xml tests. Rather than adding even more
      test files, I've just added the net attribute in various applicable
      places of existing test files.
      07450cd4
  11. 04 10月, 2014 3 次提交
  12. 01 10月, 2014 1 次提交
  13. 24 9月, 2014 2 次提交
  14. 23 9月, 2014 1 次提交
  15. 19 9月, 2014 2 次提交
  16. 16 9月, 2014 5 次提交
  17. 15 9月, 2014 1 次提交
    • J
      domain_conf: Resolve Coverity COPY_PASTE_ERROR · 96aa6052
      John Ferlan 提交于
      Seems when commit id 'ea130e3b' added the checks to ensure each of
      the hard_limit, soft_limit, and swap_hard_limit wasn't set at
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED - a copy/paste error of using
      the 'hard_limit' for each comparison was done. Adjust the code.
      96aa6052
  18. 10 9月, 2014 2 次提交
    • M
      qemu: Automatically create NVRAM store · 742b08e3
      Michal Privoznik 提交于
      When using split UEFI image, it may come handy if libvirt manages per
      domain _VARS file automatically. While the _CODE file is RO and can be
      shared among multiple domains, you certainly don't want to do that on
      the _VARS file. This latter one needs to be per domain. So at the
      domain startup process, if it's determined that domain needs _VARS
      file it's copied from this master _VARS file. The location of the
      master file is configurable in qemu.conf.
      
      Temporary, on per domain basis the location of master NVRAM file can
      be overridden by this @template attribute I'm inventing to the
      <nvram/> element. All it does is holding path to the master NVRAM file
      from which local copy is created. If that's the case, the map in
      qemu.conf is not consulted.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      742b08e3
    • 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
  19. 09 9月, 2014 1 次提交
    • E
      blockcopy: add a way to parse disk source · 37588b25
      Eric Blake 提交于
      The new blockcopy API wants to reuse only a subset of the disk
      hotplug parser - namely, we only care about the embedded
      virStorageSourcePtr inside a <disk> XML.  Strange as it may
      seem, it was easier to just parse an entire disk definition,
      then throw away everything but the embedded source, than it
      was to disentangle the source parsing code from the rest of
      the overall disk parsing function.  All that I needed was a
      couple of tweaks and a new internal flag that determines
      whether the normally-mandatory target element can be
      gracefully skipped, since everything else was already optional.
      
      * src/conf/domain_conf.h (virDomainDiskSourceParse): New
      prototype.
      * src/conf/domain_conf.c (VIR_DOMAIN_XML_INTERNAL_DISK_SOURCE):
      New flag.
      (virDomainDiskDefParseXML): Honor flag to make target optional.
      (virDomainDiskSourceParse): New function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      37588b25
  20. 05 9月, 2014 2 次提交
    • M
      conf: Fix even implicit labels · d869a6ea
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1027096#c8
      
      There are two ways in which security model can make it way into
      <seclabel/>. One is as the @model attribute, the second one is
      via security_driver knob in qemu.conf. Then, while parsing
      <seclabel/> several checks and fix ups of old, stale combinations
      are performed. However, iff @model is specified. They are not
      done in the latter case. So it's still possible to feed libvirt
      with senseless combinations (if qemu.conf is adjusted correctly).
      
      One example of a seclabel that needs some adjustment (in case
      security_driver=none in qemu.conf) is:
      
          <seclabel type='dynamic' relabel='yes'/>
      
      The fixup code is copied from virSecurityLabelDefParseXML
      (covering the former case) into virSecurityLabelDefsParseXML
      (which handles the latter case).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      d869a6ea
    • 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
  21. 04 9月, 2014 1 次提交
    • E
      maint: use consistent if-else braces in conf and friends · ff78ff7c
      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 code shared between multiple drivers.
      
      * src/conf/domain_conf.c (virDomainFSDefParseXML)
      (virSysinfoParseXML, virDomainNetDefParseXML)
      (virDomainWatchdogDefParseXML)
      (virDomainRedirFilterUSBDevDefParseXML): Correct use of {}.
      * src/conf/interface_conf.c (virInterfaceDefParseDhcp)
      (virInterfaceDefParseIp, virInterfaceVlanDefFormat)
      (virInterfaceDefParseStartMode, virInterfaceDefParseBondMode)
      (virInterfaceDefParseBondMiiCarrier)
      (virInterfaceDefParseBondArpValid): Likewise.
      * src/conf/node_device_conf.c (virNodeDevCapStorageParseXML):
      Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterRuleDetailsParse)
      (virNWFilterRuleParse, virNWFilterDefParseXML): Likewise.
      * src/conf/secret_conf.c (secretXMLParseNode): Likewise.
      * src/cpu/cpu_x86.c (x86Baseline, x86FeatureLoad, x86ModelLoad):
      Likewise.
      * src/network/bridge_driver.c (networkKillDaemon)
      (networkDnsmasqConfContents): Likewise.
      * src/node_device/node_device_hal.c (dev_refresh): Likewise.
      * src/nwfilter/nwfilter_gentech_driver.c (virNWFilterInstantiate):
      Likewise.
      * src/nwfilter/nwfilter_ebiptables_driver.c
      (_iptablesCreateRuleInstance): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskBuildPool): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ff78ff7c
  22. 29 8月, 2014 2 次提交
    • J
      domain_conf: Add support for iothreads in disk definition · e2523de5
      John Ferlan 提交于
      Add a new disk "driver" attribute "iothread" to be parsed as the thread
      number for the disk to use. In order to more easily facilitate the usage
      and configuration of the iothread, a "zero" for the attribute indicates
      iothreads are not supported for the device and a positive value indicates
      the specific thread to try and use.
      e2523de5
    • J
      domain_conf: Introduce iothreads XML · ee3a9620
      John Ferlan 提交于
      Introduce XML to allowing adding iothreads to the domain. These can be
      used by virtio-blk-pci devices in order to assign a specific thread to
      handle the workload for the device.  The iothreads are the official
      implementation of the virtio-blk Data Plane that's been in tech preview
      for QEMU.
      ee3a9620
  23. 28 8月, 2014 4 次提交
    • J
      domain_conf: Resolve Coverity DEADCODE · dad6ef18
      John Ferlan 提交于
      A bunch of a useless warnings brought on by our own doing.
      dad6ef18
    • J
      domain_conf: Resolve Coverity RESOURCE_LEAK · f9c827e3
      John Ferlan 提交于
      Resolve a few RESOURCE_LEAK's identified by Coverity
      f9c827e3
    • P
      conf: Add helper to free domain list · e4151224
      Peter Krempa 提交于
      Add helper to free a list of virDomainPtrs without raising or clearing
      errors. Use it in one place and prepare it for reuse.
      e4151224
    • J
      domain_conf: Resolve Coverity REVERSE_INULL · 0c5ca985
      John Ferlan 提交于
      Coverity complains that checking for domain->def being non NULL in the
      if (live) path of virDomainObjAssignDef() would be unnecessary or a
      NULL deref since the call to virDomainObjIsActive() would already
      dereference domain->def when checking if the def->id field was != -1.
      
      Checked all callers to virDomainObjAssignDef() and each at some point
      dereferences (vm)->def->{field} prior to calling when live is true.
      0c5ca985