1. 26 8月, 2016 3 次提交
    • L
      qemu: set tap device online for type='ethernet' · 07262221
      Laine Stump 提交于
      When support for auto-creating tap devices was added to <interface
      type='ethernet'> in commit 9c17d6, the code assumed that
      virNetDevTapCreate() would honor the VIR_NETDEV_TAP__CREATE_IFUP flag
      that is supported by virNetDevTapCreateInBridgePort(). That isn't the
      case - the latter function performs several operations, and one of
      them is setting the tap device online. But virNetDevTapCreate() *only*
      creates the tap device, and relies on the caller to do everything
      else, so qemuInterfaceEthernetConnect() needs to call
      virNetDevSetOnline() after the device is successfully created.
      07262221
    • L
      qemu: remove unnecessary setting of tap device online state · dbb79039
      Laine Stump 提交于
      The linkstate setting of an <interface> is only meant to change the
      online status reported to the guest system by the emulated network
      device driver in qemu, but when support for auto-creating tap devices
      for <interface type='ethernet'> was added in commit 9717d6, a chunk of
      code was also added to qemuDomainChangeNetLinkState() that sets the
      online status of the tap device (i.e. the *host* side of the
      interface) for type='ethernet'. This was never done for tap devices
      used in type='bridge' or type='network' interfaces, nor was it done in
      the past for tap devices created by external scripts for
      type='ethernet', so we shouldn't be doing it now.
      
      This patch removes the bit of code in qemuDomainChangeNetLinkState()
      that modifies online status of the tap device.
      dbb79039
    • V
      qemu: fix ethernet network type ip/route assign · 5f243153
      Vasiliy Tolstov 提交于
      The call to virNetDevIPInfoAddToDev() that sets up tap device IP
      addresses and routes was somehow incorrectly placed in
      qemuInterfaceStopDevice() instead of qemuInterfaceStartDevice() in
      commit fe8567f6.  This fixes that error by moving the call to
      virNetDevIPInfoAddToDev() to qemuInterfaceStartDevice().
      Signed-off-by: NVasiliy Tolstov <v.tolstov@selfip.ru>
      5f243153
  2. 25 8月, 2016 20 次提交
    • P
      qemu: hotplug: Add support for VCPU unplug · e3229f6e
      Peter Krempa 提交于
      This patch removes the old vcpu unplug code completely and replaces it
      with the new code using device_del. The old hotplug code basically never
      worked with any recent qemu and thus is useless.
      
      As the new code is using device_del all the implications of using it
      are present. Contrary to the device deletion code, the vcpu deletion
      code fails if the unplug request is not executed in time.
      e3229f6e
    • P
      qemu: hotplug: Allow marking unplugged devices by alias · 00990d9f
      Peter Krempa 提交于
      Add a overlay function that takes the alias directly rather than
      extracting it from a device info.
      00990d9f
    • P
      qemu: Use modern vcpu hotplug approach if possible · 6d4ee77d
      Peter Krempa 提交于
      To allow unplugging the vcpus, hotplugging of vcpus on platforms which
      require to plug multiple logical vcpus at once or plugging them in an
      arbitrary order it's necessary to use the new device_add interface for
      vcpu hotplug.
      
      This patch adds support for the device_add interface using the old
      setvcpus API by implementing an algorithm to select the appropriate
      entities to plug in.
      6d4ee77d
    • P
      qemu: command: Add support for sparse vcpu topologies · 9eb9106e
      Peter Krempa 提交于
      Add support for using the new approach to hotplug vcpus using device_add
      during startup of qemu to allow sparse vcpu topologies.
      
      There are a few limitations imposed by qemu on the supported
      configuration:
      - vcpu0 needs to be always present and not hotpluggable
      - non-hotpluggable cpus need to be ordered at the beginning
      - order of the vcpus needs to be unique for every single hotpluggable
        entity
      
      Qemu also doesn't really allow to query the information necessary to
      start a VM with the vcpus directly on the commandline. Fortunately they
      can be hotplugged during startup.
      
      The new hotplug code uses the following approach:
      - non-hotpluggable vcpus are counted and put to the -smp option
      - qemu is started
      - qemu is queried for the necessary information
      - the configuration is checked
      - the hotpluggable vcpus are hotplugged
      - vcpus are started
      
      This patch adds a lot of checking code and enables the support to
      specify the individual vcpu element with qemu.
      9eb9106e
    • P
      qemu: process: Copy final vcpu order information into the vcpu definition · 20ef1232
      Peter Krempa 提交于
      The vcpu order information is extracted only for hotpluggable entities,
      while vcpu definitions belonging to the same hotpluggable entity need
      to all share the order information.
      
      We also can't overwrite it right away in the vcpu info detection code as
      the order is necessary to add the hotpluggable vcpus enabled on boot in
      the correct order.
      
      The helper will store the order information in places where we are
      certain that it's necessary.
      20ef1232
    • P
      qemu: command: Add helper to convert vcpu definition to JSON props · 8807f28b
      Peter Krempa 提交于
      For use on the monitor we need to format certain parts of the vcpu
      private definition into a JSON object. Add a helper.
      8807f28b
    • P
      qemu: migration: Prepare for non-contiguous vcpu configurations · 48e3d428
      Peter Krempa 提交于
      Introduce a new migration cookie flag that will be used for any
      configurations that are not compatible with libvirt that would not
      support the specific vcpu hotplug approach. This will make sure that old
      libvirt does not fail to reproduce the configuration correctly.
      48e3d428
    • P
      conf: Add XML for individual vCPU hotplug · 5847bc5c
      Peter Krempa 提交于
      Individual vCPU hotplug requires us to track the state of any vCPU. To
      allow this add the following XML:
      
      <domain>
        ...
        <vcpu current='2'>3</vcpu>
        <vcpus>
          <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
          <vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
          <vcpu id='1' enabled='no' hotpluggable='yes'/>
        </vcpus>
        ...
      
      The 'enabled' attribute allows to control the state of the vcpu.
      'hotpluggable' controls whether given vcpu can be hotplugged and 'order'
      allows to specify the order to add the vcpus.
      5847bc5c
    • P
    • P
      qemu: domain: Prepare for VCPUs vanishing while libvirt is not running · 133be0a9
      Peter Krempa 提交于
      Similarly to devices the guest may allow unplug of the VCPU if libvirt
      is down. To avoid problems, refresh the vcpu state on reconnect. Don't
      mess with the vcpu state otherwise.
      133be0a9
    • P
      qemu: domain: Extract cpu-hotplug related data · 6b4a23ff
      Peter Krempa 提交于
      Now that the monitor code gathers all the data we can extract it to
      relevant places either in the definition or the private data of a vcpu.
      
      As only thread id is broken for TCG guests we may extract the rest of
      the data and just skip assigning of the thread id. In case where qemu
      would allow cpu hotplug in TCG mode this will make it work eventually.
      6b4a23ff
    • P
      qemu: monitor: Add algorithm for combining query-(hotpluggable-)-cpus data · 9bbbc88a
      Peter Krempa 提交于
      For hotplug purposes it's necessary to retrieve data using
      query-hotpluggable-cpus while the old query-cpus API report thread IDs
      and order of hotplug.
      
      This patch adds code that merges the data using a rather non-trivial
      algorithm and fills the data to the qemuMonitorCPUInfo structure for
      adding to appropriate place in the domain definition.
      9bbbc88a
    • P
      qemu: monitor: Add support for calling query-hotpluggable-cpus · 1213f0f8
      Peter Krempa 提交于
      Add support for retrieving information regarding hotpluggable cpu units
      supported by qemu. Data returned by the command carries information
      needed to figure out the granularity of hotplug, the necessary cpu type
      name and the topology information.
      
      Note that qemu doesn't specify any particular order of the entries thus
      it's necessary sort them by socket_id, core_id and thread_id to the
      order libvirt expects.
      1213f0f8
    • P
      qemu: monitor: Extract QOM path from query-cpus reply · c91be16b
      Peter Krempa 提交于
      To allow matching up the data returned by query-cpus to entries in the
      query-hotpluggable-cpus reply for CPU hotplug it's necessary to extract
      the QOM path as it's the only link between the two.
      c91be16b
    • P
      qemu: capabilities: Extract availability of new cpu hotplug for machine types · 920bbe5c
      Peter Krempa 提交于
      QEMU reports whether 'query-hotpluggable-cpus' is supported for a given
      machine type. Extract and cache the information using the capability
      cache.
      
      When copying the capabilities for a new start of qemu, mask out the
      presence of QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS if the machine type
      doesn't support hotpluggable cpus.
      920bbe5c
    • P
      qemu: Forbid config when topology based cpu count doesn't match the config · ffa536e0
      Peter Krempa 提交于
      As of qemu commit:
      commit a32ef3bfc12c8d0588f43f74dcc5280885bbdb30
      Author: Thomas Huth <thuth@redhat.com>
      Date:   Wed Jul 22 15:59:50 2015 +0200
      
          vl: Add another sanity check to smp_parse() function
      
      v2.4.0-952-ga32ef3b
      
      configuration where the maximum CPU count doesn't match the topology is
      rejected. Prior to that only configurations where the topology would
      contain more cpus than the maximum count would be rejected.
      
      Use QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS as a relevant recent enough
      witness to avoid breaking old configs.
      ffa536e0
    • P
      f17ddfee
    • P
      qemu: monitor: Return struct from qemuMonitor(Text|Json)QueryCPUs · b3180425
      Peter Krempa 提交于
      Prepare to extract more data by returning an array of structs rather than
      just an array of thread ids. Additionally report fatal errors separately
      from qemu not being able to produce data.
      b3180425
    • P
      qemu: monitor: Return structures from qemuMonitorGetCPUInfo · 5b5f494a
      Peter Krempa 提交于
      The function will gradually add more returned data. Return a struct for
      every vCPU containing the data.
      5b5f494a
    • C
      storage_backend_rbd: fix typos · 6de1d22c
      Chen Hanxiao 提交于
      s/failed/failed to
      Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com>
      6de1d22c
  3. 24 8月, 2016 10 次提交
  4. 23 8月, 2016 1 次提交
  5. 22 8月, 2016 1 次提交
  6. 20 8月, 2016 4 次提交
    • J
      qemu: Fix crash hot plugging luks volume · b4478c16
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1367259
      
      Crash occurs because 'secrets' is being dereferenced in call:
      
              if (qemuDomainSecretSetup(conn, priv, secinfo, disk->info.alias,
                                        VIR_SECRET_USAGE_TYPE_VOLUME, NULL,
                                        &src->encryption->secrets[0]->seclookupdef,
                                        true) < 0)
      
      (gdb) p *src->encryption
      $1 = {format = 2, nsecrets = 0, secrets = 0x0, encinfo = {cipher_size = 0,
          cipher_name = 0x0, cipher_mode = 0x0, cipher_hash = 0x0, ivgen_name = 0x0,
          ivgen_hash = 0x0}}
      (gdb) bt
          priv=priv@entry=0x7fffc03be160, disk=disk@entry=0x7fffb4002ae0)
          at qemu/qemu_domain.c:1087
          disk=0x7fffb4002ae0, vm=0x7fffc03a2580, driver=0x7fffc02ca390,
          conn=0x7fffb00009a0) at qemu/qemu_hotplug.c:355
      
      Upon entry to qemuDomainAttachVirtioDiskDevice, src->encryption points
      at a valid 'secret' buffer w/ nsecrets == 1; however, the call to
      qemuDomainDetermineDiskChain will call virStorageFileGetMetadata
      and eventually virStorageFileGetMetadataInternal where the src->encryption
      was overwritten when probing the volume.
      
      Commit id 'a48c7141' added code to virStorageFileGetMetadataInternal
      to determine if the disk/volume would use/need encryption and allocated
      a meta->encryption. This overwrote an existing encryption buffer
      already provided by the XML
      
      This patch adds a check for meta->encryption already present before
      just allocating and overwriting an existing buffer. It then checks the
      existing encryption data to ensure the XML provided format for the
      disk matches the expected format read from the disk and errors if there
      is a mismatch.
      b4478c16
    • L
      network: allow limiting a <forwarder> element to certain domains · 0b6336c2
      Laine Stump 提交于
      For some unknown reason the original implementation of the <forwarder>
      element only took advantage of part of the functionality in the
      dnsmasq feature it exposes - it allowed specifying the ip address of a
      DNS server which *all* DNS requests would be forwarded to, like this:
      
         <forwarder addr='192.168.123.25'/>
      
      This is a frontend for dnsmasq's "server" option, which also allows
      you to specify a domain that must be matched in order for a request to
      be forwarded to a particular server. This patch adds support for
      specifying the domain. For example:
      
         <forwarder domain='example.com' addr='192.168.1.1'/>
         <forwarder domain='www.example.com'/>
         <forwarder domain='travesty.org' addr='10.0.0.1'/>
      
      would forward requests for bob.example.com, ftp.example.com and
      joe.corp.example.com all to the DNS server at 192.168.1.1, but would
      forward requests for travesty.org and www.travesty.org to
      10.0.0.1. And due to the second line, requests for www.example.com,
      and odd.www.example.com would be resolved by the libvirt network's own
      DNS server (i.e. thery wouldn't be immediately forwarded) even though
      they also match 'example.com' - the match is given to the entry with
      the longest matching domain. DNS requests not matching any of the
      entries would be resolved by the libvirt network's own DNS server.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1331796
      0b6336c2
    • L
      network: allow disabling dnsmasq's DNS server · 9065cfaa
      Laine Stump 提交于
      If you define a libvirt virtual network with one or more IP addresses,
      it starts up an instance of dnsmasq. It's always been possible to
      avoid dnsmasq's dhcp server (simply don't include a <dhcp> element),
      but until now it wasn't possible to avoid having the DNS server
      listening; even if the network has no <dns> element, it is started
      using default settings.
      
      This patch adds a new attribute to <dns>: enable='yes|no'. For
      backward compatibility, it defaults to 'yes', but if you don't want a
      DNS server created for the network, you can simply add:
      
         <dns enable='no'/>
      
      to the network configuration, and next time the network is started
      there will be no dns server created (if there is dhcp configuration,
      dnsmasq will be started with "port=0" which disables the DNS server;
      if there is no dhcp configuration, dnsmasq won't be started at all).
      9065cfaa
    • L
      network: new network forward mode 'open' · 25e8112d
      Laine Stump 提交于
      The new forward mode 'open' is just like mode='route', except that no
      firewall rules are added to assure that any traffic does or doesn't
      pass. It is assumed that either they aren't necessary, or they will be
      setup outside the scope of libvirt.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=846810
      25e8112d
  7. 19 8月, 2016 1 次提交
    • M
      vz: add validation callbacks · 72abe564
      Mikhail Feoktistov 提交于
      This patch fixes a bug which occurs when we check a bus and unit number
      for a new attached disk. We should do this check in ValidadionCallback,
      not in PostParse callback. Because in PostParse we have not initialized
      disk->info.addr.drive struct yet.
      Move part of code from domainPostParseCallback to domainValidateCallback
      and part from devicesPostParseCallback to deviceValidateCallback.
      PostParse callbacks are for modification data.
      ValidateCallbacks are only for checks.
      72abe564