1. 21 4月, 2015 4 次提交
  2. 20 4月, 2015 2 次提交
  3. 09 4月, 2015 1 次提交
  4. 08 4月, 2015 1 次提交
  5. 23 3月, 2015 2 次提交
    • P
      conf: Add interface to parse and format memory device information · 3e4230d2
      Peter Krempa 提交于
      This patch adds code that parses and formats configuration for memory
      devices.
      
      A simple configuration would be:
      <memory model='dimm'>
        <target>
          <size unit='KiB'>524287</size>
          <node>0</node>
        </target>
      </memory>
      
      A complete configuration of a memory device:
      <memory model='dimm'>
        <source>
          <pagesize unit='KiB'>4096</pagesize>
          <nodemask>1-3</nodemask>
        </source>
        <target>
          <size unit='KiB'>524287</size>
          <node>1</node>
        </target>
      </memory>
      
      This patch preemptively forbids use of the <memory> device in individual
      drivers so the users are warned right away that the device is not
      supported.
      3e4230d2
    • P
      conf: Add support for parsing and formatting max memory and slot count · bffb9163
      Peter Krempa 提交于
      Add a XML element that will allow to specify maximum supportable memory
      and the count of memory slots to use with memory hotplug.
      
      To avoid possible confusion and misuse of the new element this patch
      also explicitly forbids the use of the maxMemory setting in individual
      drivers's post parse callbacks. This limitation will be lifted when the
      support is implemented.
      bffb9163
  6. 19 3月, 2015 1 次提交
    • L
      util: clean up #includes of virnetdevopenvswitch.h · 451547a4
      Laine Stump 提交于
      virnetdevopenvswitch.h declares a few functions that can be called to
      add ports to and remove them from OVS bridges, and retrieve the
      migration data for a port. It does not contain any data definitions
      that are used by domain_conf.h. But for some reason, domain_conf.h
      virnetdevopenvswitch.h should be directly #including it. This adds a
      few lines to the project, but saves all the files that don't need it
      from the extra computing, and makes the dependencies more clear cut.
      451547a4
  7. 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
  8. 06 3月, 2015 1 次提交
    • P
      memtune: change the way how we store unlimited value · cf521fc8
      Pavel Hrdina 提交于
      There was a mess in the way how we store unlimited value for memory
      limits and how we handled values provided by user.  Internally there
      were two possible ways how to store unlimited value: as 0 value or as
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED.  Because we chose to store memory
      limits as unsigned long long, we cannot use -1 to represent unlimited.
      It's much easier for us to say that everything greater than
      VIR_DOMAIN_MEMORY_PARAM_UNLIMITED means unlimited and leave 0 as valid
      value despite that it makes no sense to set limit to 0.
      
      Remove unnecessary function virCompareLimitUlong.  The update of test
      is to prevent the 0 to be miss-used as unlimited in future.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146539Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cf521fc8
  9. 26 2月, 2015 1 次提交
    • L
      network: only clear bandwidth if it has been set · 118b2408
      Laine Stump 提交于
      libvirt was unconditionally calling virNetDevBandwidthClear() for
      every interface (and network bridge) of a type that supported
      bandwidth, whether it actually had anything set or not. This doesn't
      hurt anything (unless ifname == NULL!), but is wasteful.
      
      This patch makes sure that all calls to virNetDevBandwidthClear() are
      qualified by checking that the interface really had some bandwidth
      setup done, and checks for a null ifname inside
      virNetDevBandwidthClear(), silently returning success if it is null
      (as well as removing the ATTRIBUTE_NONNULL from that function's
      prototype, since we can't guarantee that it is never null,
      e.g. sometimes a type='ethernet' interface has no ifname as it is
      provided on the fly by qemu).
      118b2408
  10. 21 2月, 2015 3 次提交
  11. 19 2月, 2015 1 次提交
    • J
      Search for schemas and cpu_map.xml in source tree · bc6e2063
      Jiri Denemark 提交于
      Not all files we want to find using virFileFindResource{,Full} are
      generated when libvirt is built, some of them (such as RNG schemas) are
      distributed with sources. The current API was not able to find source
      files if libvirt was built in VPATH.
      
      Both RNG schemas and cpu_map.xml are distributed in source tarball.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      bc6e2063
  12. 14 2月, 2015 3 次提交
    • L
      lxc: Fix container cleanup for LXCProcessStart · 8e6492f2
      Luyao Huang 提交于
      Jumping to the cleanup label prior to starting the container failed to
      properly clean everything up that is handled by the virLXCProcessCleanup
      which is called if virLXCProcessStop is called on failure after the
      container properly starts. Most importantly is prior to this patch none
      of the stop/release hooks, host device reattachment, and network cleanup
      (that is reverse of virLXCProcessSetupInterfaces).
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      8e6492f2
    • J
      lxc: Modify/add some debug messages · 2b8e018a
      John Ferlan 提交于
      Modify the VIR_DEBUG message in virLXCProcessCleanup to make it clearer
      about the path.  Also add some more VIR_DEBUG messages in virLXCProcessStart
      in order to help debug error flow.
      2b8e018a
    • L
      lxc: Move console checks in LXCProcessStart · 72129907
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1176503
      
      Move the two console checks - one for zero nconsoles present and the
      other for an invalid console type to earlier in the processing rather than
      getting after performing some setup that has to be undone for what amounts
      to an invalid configuration.
      
      This resolves the above bug since it's not not possible to have changed
      the security labels when we cause the configuration check failure.
      72129907
  13. 13 2月, 2015 1 次提交
  14. 09 2月, 2015 1 次提交
  15. 06 2月, 2015 1 次提交
  16. 04 2月, 2015 1 次提交
  17. 27 1月, 2015 8 次提交
    • D
      lxc: report veth device indexes to systemd · a2bdfa52
      Daniel P. Berrange 提交于
      Record the index of each host-side veth device created and report
      them to systemd, so they show up in machinectl status for the VM.
      
      lxc-shell(95449419f969d649d9962566ec42af7d)
           Since: Fri 2015-01-16 16:53:37 GMT; 3s ago
          Leader: 28085 (sh)
         Service: libvirt-lxc; class container
           Iface: vnet0
         Address: fe80::216:3eff:fe00:c317%124
              OS: Fedora 21 (Twenty One)
            Unit: machine-lxc\x2dshell.scope
                  └─28085 /bin/sh
      a2bdfa52
    • D
      lxc: more logging during startup paths · e4fc4f0c
      Daniel P. Berrange 提交于
      Add more logging to the lxc controller and container files to
      facilitate debugging startup problems. Also make it clear when
      the container is going to close stdout and thus no longer do
      any logging.
      e4fc4f0c
    • D
      lxc: delay setup of cgroup until we have the init pid · 4acb01e4
      Daniel P. Berrange 提交于
      Don't create the cgroups ahead of launching the container since
      there is no need for the limits to apply during initial bootstrap.
      Create the cgroup after the container PID is known and tell
      systemd the initpid is the leader, instead of the controller
      pid.
      4acb01e4
    • D
      lxc: only write XML once for lxc controller · 0a8addc1
      Daniel P. Berrange 提交于
      Currently when launching the LXC controller we first write out
      the plain, inactive XML configuration, then launch the controller,
      then replace the file with the live status XML configuration.
      By good fortune this hasn't caused any problems other than some
      misleading error messages during failure scenarios.
      
      This simplifies the code so it only writes out the XML once and
      always writes the live status XML. To do this we need to handshake
      with the child process, to make execution pause just before exec()
      so we can write the XML status with the child PID present.
      0a8addc1
    • D
      lxc: re-arrange startup synchronization sequence with controller · e1de5521
      Daniel P. Berrange 提交于
      Currently the lxc controller process itself is responsible for
      daemonizing itself into the background and writing out its pid
      file. The lxc driver would fork the controller and then attempt
      to connect to the lxc monitor. This connection would only
      succeed after the controller has backgrounded itself, setup
      cgroups and written its pid file, so startup was race free.
      
      The problem is that we need to delay create of the cgroups to
      much later, such that we can tell systemd the container init
      pid when we create the cgroups. If we delay cgroup creation
      though the current synchronization won't work.
      
      A second problem is that the controller needs the XML config
      of the guest. Currently we write out the plain virDomainDefPtr
      XML before starting the controller, and then later replace it
      with the full virDomainObjPtr status XML. This is kind of gross
      and also means that the controller doesn't get a record of the
      live XML config right away. This means it doesn't have a record
      of the veth device names either and so can't give that info
      to systemd when creating the cgroups.
      
      To address this we change the startup sequencing. The goal
      is that we want to get the PID as soon as possible, before
      the LXC controller even starts. So we stop letting the LXC
      controller daemonize itself, and instead use virCommand's
      built-in capabilities. This daemonizes and writes the PID
      before LXC controller is exec'd. So the driver can read
      the PID as soon as virCommandRun returns. It is no longer
      safe to connect to the monitor or detect the cgroups though.
      
      Fortunately the LXC controller already has a second point
      of synchronization. Immediately before its  event loop
      starts running, it performs a handshake with the driver.
      So we move the opening of the monitor connection and cgroup
      detection after this synchronization point.
      e1de5521
    • D
      lxc: don't build pidfile string multiple times · a5979e33
      Daniel P. Berrange 提交于
      Build the pidfile string once when starting a guest and then
      use the same string thereafter. This will benefit following
      patches which need the pidfile string in more situations.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a5979e33
    • 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
    • D
      Remove use of nwfilterPrivateData from nwfilter driver · 7b1ba956
      Daniel P. Berrange 提交于
      The nwfilter driver can rely on its global state instead
      of the connect private data.
      7b1ba956
  18. 16 1月, 2015 2 次提交
  19. 15 1月, 2015 1 次提交
    • D
      Add support for systemd-machined CreateMachineWithNetwork · 318df5a0
      Daniel P. Berrange 提交于
      systemd-machined introduced a new method CreateMachineWithNetwork
      that obsoletes CreateMachine. It expects to be given a list of
      VETH/TAP device indexes for the host side device(s) associated
      with a container/machine.
      
      This falls back to the old CreateMachine method when the new
      one is not supported.
      318df5a0
  20. 14 1月, 2015 2 次提交
    • M
      qemu, lxc: Warn if setting QoS on unsupported vNIC types · 04cf99a6
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1165993
      
      So, there are still plenty of vNIC types that we don't know how to set
      bandwidth on. Let's warn explicitly in case user has requested it
      instead of pretending everything was set.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      04cf99a6
    • 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
  21. 13 1月, 2015 2 次提交