1. 22 2月, 2018 2 次提交
  2. 09 2月, 2018 1 次提交
  3. 16 12月, 2017 1 次提交
  4. 09 11月, 2017 1 次提交
  5. 03 11月, 2017 1 次提交
    • A
      Remove backslash alignment attempts · 3e7db8d3
      Andrea Bolognani 提交于
      Right-aligning backslashes when defining macros or using complex
      commands in Makefiles looks cute, but as soon as any changes is
      required to the code you end up with either distractingly broken
      alignment or unnecessarily big diffs where most of the changes
      are just pushing all backslashes a few characters to one side.
      
      Generated using
      
        $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
          grep -E '*\.([chx]|am|mk)$$' | \
          while read f; do \
            sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
          done
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3e7db8d3
  6. 16 10月, 2017 1 次提交
  7. 14 10月, 2017 3 次提交
  8. 05 10月, 2017 2 次提交
  9. 21 9月, 2017 1 次提交
    • J
      cpu_conf: Drop updateCPU from virCPUDefFormat · 4fd179f5
      Jiri Denemark 提交于
      In the past we updated host-model CPUs with host CPU data by adding a
      model and features, but keeping the host-model mode. And since the CPU
      model is not normally formatted for host-model CPU defs, we had to pass
      the updateCPU flag to the formatting code to be able to properly output
      updated host-model CPUs. Libvirt doesn't do this anymore, host-model
      CPUs are turned into custom mode CPUs once updated with host CPU data
      and thus there's no reason for keeping the hacks inside CPU XML
      formatters.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      4fd179f5
  10. 18 9月, 2017 1 次提交
  11. 24 8月, 2017 1 次提交
  12. 08 8月, 2017 1 次提交
    • J
      introduce virConfReadString · e9f32227
      Ján Tomko 提交于
      Rewrite virConfReadMem to take a null-terminated string.
      All the callers were calling strlen on it anyway.
      e9f32227
  13. 25 6月, 2017 1 次提交
    • J
      events: Avoid double free possibility on remote call failure · 2065499b
      John Ferlan 提交于
      If a remote call fails during event registration (more than likely from
      a network failure or remote libvirtd restart timed just right), then when
      calling the virObjectEventStateDeregisterID we don't want to call the
      registered @freecb function because that breaks our contract that we
      would only call it after succesfully returning.  If the @freecb routine
      were called, it could result in a double free from properly coded
      applications that free their opaque data on failure to register, as seen
      in the following details:
      
          Program terminated with signal 6, Aborted.
          #0  0x00007fc45cba15d7 in raise
          #1  0x00007fc45cba2cc8 in abort
          #2  0x00007fc45cbe12f7 in __libc_message
          #3  0x00007fc45cbe86d3 in _int_free
          #4  0x00007fc45d8d292c in PyDict_Fini
          #5  0x00007fc45d94f46a in Py_Finalize
          #6  0x00007fc45d960735 in Py_Main
          #7  0x00007fc45cb8daf5 in __libc_start_main
          #8  0x0000000000400721 in _start
      
      The double dereference of 'pyobj_cbData' is triggered in the following way:
      
          (1) libvirt_virConnectDomainEventRegisterAny is invoked.
          (2) the event is successfully added to the event callback list
              (virDomainEventStateRegisterClient in
              remoteConnectDomainEventRegisterAny returns 1 which means ok).
          (3) when function remoteConnectDomainEventRegisterAny is hit,
              network connection disconnected coincidently (or libvirtd is
              restarted) in the context of function 'call' then the connection
              is lost and the function 'call' failed, the branch
              virObjectEventStateDeregisterID is therefore taken.
          (4) 'pyobj_conn' is dereferenced the 1st time in
              libvirt_virConnectDomainEventFreeFunc.
          (5) 'pyobj_cbData' (refered to pyobj_conn) is dereferenced the
               2nd time in libvirt_virConnectDomainEventRegisterAny.
          (6) the double free error is triggered.
      
      Resolve this by adding a @doFreeCb boolean in order to avoid calling the
      freeCb in virObjectEventStateDeregisterID for any remote call failure in
      a remoteConnect*EventRegister* API. For remoteConnect*EventDeregister* calls,
      the passed value would be true indicating they should run the freecb if it
      exists; whereas, it's false for the remote call failure path.
      
      Patch based on the investigation and initial patch posted by
      fangying <fangying1@huawei.com>.
      2065499b
  14. 03 4月, 2017 1 次提交
    • M
      virGetDomain: Set domain ID too · 5683b213
      Michal Privoznik 提交于
      So far our code is full of the following pattern:
      
        dom = virGetDomain(conn, name, uuid)
        if (dom)
            dom->id = 42;
      
      There is no reasong why it couldn't be just:
      
        dom = virGetDomain(conn, name, uuid, id);
      
      After all, client domain representation consists of tuple (name,
      uuid, id).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5683b213
  15. 16 2月, 2017 1 次提交
    • B
      libxl: add tunnelled migration support · 6a95edf9
      Bob Liu 提交于
      Tunnelled migration doesn't require any extra network connections
      beside the libvirt daemon.  It's capable of strong encryption and the
      default option of openstack-nova.
      
      This patch adds the tunnelled migration(Tunnel3params) support to
      libxl.  On the source side, the data flow is:
      
       * libxlDoMigrateSend() -> pipe libxlTunnel3MigrationFunc() polls pipe
       * out and then write to dest stream.
      
      While on the destination side:
       * Stream -> pipe -> 'recvfd of libxlDomainStartRestore'
      
      The usage is the same as p2p migration, execpt adding one extra
      '--tunnelled' to the libvirt p2p migration command.
      Signed-off-by: NBob Liu <bob.liu@oracle.com>
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      6a95edf9
  16. 10 2月, 2017 4 次提交
    • J
      libxl: fix dom0 maximum memory setting · 79692c38
      Jim Fehlig 提交于
      When the libxl driver is initialized, it creates a virDomainDef
      object for dom0 and adds it to the list of domains. Total memory
      for dom0 was being set from the max_memkb field of libxl_dominfo
      struct retrieved from libxl, but this field can be set to
      LIBXL_MEMKB_DEFAULT (~0ULL) if dom0 maximum memory has not been
      explicitly set by the user.
      
      This patch adds some simple parsing of the Xen commandline,
      looking for a dom0_mem parameter that also specifies a 'max' value.
      If not specified, dom0 maximum memory is effectively all physical
      host memory.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      79692c38
    • J
      libxl: fix reporting of maximum memory · d2b77608
      Jim Fehlig 提交于
      The libxl driver reports different values of maximum memory depending
      on state of a domain. If inactive, maximum memory value is reported
      correctly. When active, maximum memory is derived from max_pages value
      returned by the XEN_SYSCTL_getdomaininfolist sysctl operation. But
      max_pages can be changed by toolstacks and does not necessarily
      represent the maximum memory a domain can use during its active
      lifetime.
      
      A better location for determining a domain's maximum memory is the
      /local/domain/<id>/memory/static-max node in xenstore. This value
      is set from the libxl_domain_build_info.max_memkb field when creating
      the domain. Currently it cannot be changed nor can its value be
      exceeded by a balloon operation. From libvirt's perspective, always
      reporting maximum memory with virDomainDefGetMemoryTotal() will produce
      the same results as reading the static-max node in xenstore.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      d2b77608
    • J
      libxl: fix disk detach when <driver> not specified · bd116810
      Jim Fehlig 提交于
      When a user does not explicitly set a <driver> in the disk config,
      libvirt defers selection of a default to libxl. This approach works
      fine when starting a domain with such configuration or attaching a
      disk to a running domain. But when detaching such a disk, libxl
      will fail with "unrecognized disk backend type: 0". libxl makes no
      attempt to recalculate a default backend (driver) on detach and
      simply fails when uninitialized.
      
      This patch updates the libvirt disk config with the backend selected
      by libxl when starting a domain or attaching a disk to a running
      domain. Another benefit of this approach is that the live XML is
      also updated with the backend driver selected by libxl.
      bd116810
    • J
      libxl: set default disk format in device post-parse · 321a28c6
      Jim Fehlig 提交于
      When starting a domian, a libxl_domain_config object is created from
      virDomainDef. Any virDomainDiskDef devices with a format of
      VIR_STORAGE_FILE_NONE are mapped to LIBXL_DISK_FORMAT_RAW in the
      corresponding libxl_disk_device, but the virDomainDiskDef format is
      never updated to reflect the change.
      
      A better place to set a default format for disk devices is the
      device post-parse callback, ensuring the virDomainDiskDef object
      reflects the default format.
      321a28c6
  17. 09 2月, 2017 1 次提交
  18. 11 1月, 2017 2 次提交
    • C
      libxl: define a per-domain logger. · a30b08b7
      Cédric Bosdonnat 提交于
      libxl doesn't provide a way to write one log for each domain. Thus
      we need to demux the messages. If our logger doesn't know to which
      domain to attribute a message, then it will write it to the default
      log file.
      
      Starting with Xen 4.9 (commit f9858025 and following), libxl will
      write the domain ID in an easy to grab manner. The logger introduced
      by this commit will use it to demux the libxl log messages.
      
      Thanks to the default log file, this logger will also work with older
      versions of Xen.
      a30b08b7
    • J
      libxl: implement virDomainGetMaxVcpus · a05e2570
      Jim Fehlig 提交于
      The libxl driver already supports getting maximum vcpu count via
      libxlDomainGetVcpusFlags, allowing to trivially implement
      virDomainGetMaxVcpus.
      a05e2570
  19. 15 12月, 2016 1 次提交
    • J
      libxl: reverse defaults on HVM net device attach · de8607d7
      Joao Martins 提交于
      libvirt libxl picks its own default with respect to the default NIC
      to use. libxlMakeNic is the one responsible for this and on boot it
      picks LIBXL_NIC_TYPE_VIF_IOEMU for HVM domains such that it accomodates
      both PV and emulated one. The good behaving guest at boot will then
      select the pv and unplug the emulated device.
      
      Now, on HVM when attaching an interface it will pick the same default
      that is LIBXL_NIC_TYPE_VIF_IOEMU which as a result will fail the attach
      (see xen commit 32e9d0f ("libxl: nic type defaults to vif in hotplug for
      hvm guest"). Xen doesn't yet support the hotplug of emulated devices,
      but we don't want to rule out that case either, which might get support
      in the future. Hence we simply reverse the defaults when we are
      attaching the interface which allows libvirt to prefer the PV nic first
      without adding "model='netfront'" following the same pattern as above
      commit. Also to avoid ruling out the emulated one we set to
      LIBXL_NIC_TYPE_IOEMU when setting a model type that is not 'netfront'.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      de8607d7
  20. 09 12月, 2016 2 次提交
  21. 22 11月, 2016 1 次提交
  22. 22 10月, 2016 1 次提交
  23. 14 10月, 2016 1 次提交
  24. 12 10月, 2016 1 次提交
  25. 28 9月, 2016 2 次提交
    • J
      libxl: fix param assignment in domainGetSchedulerParameters · 4c600de7
      Jim Fehlig 提交于
      Due to a copy and paste error, the scheduler 'cap' parameter
      was over-writing the 'weight' parameter when preparing the
      return parameters in libxlDomainGetSchedulerParametersFlags.
      As a result, the scheduler weight was never shown when getting
      schedinfo and setting the weight failed as well
      
      virsh  schedinfo testvm
      Scheduler      : credit
      cap            : 0
      
      virsh  schedinfo testvm --cap 50 --weight 500
      Scheduler      : credit
      error: invalid scheduler option: weight
      
      The obvious fix is to assign the 'caps' parameter to the correct
      item in the parameter list.
      Reported-by: NVolo M. <vm@vovs.net>
      4c600de7
    • J
      libxl: channels support · 719b663f
      Joao Martins 提交于
      And allow libxl to handle channel element which creates a Xen
      console visible to the guest as a low-bandwitdh communication
      channel. If type is PTY we also fetch the tty after boot using
      libxl_channel_getinfo to fetch the tty path. On socket case,
      we autogenerate a path if not specified in the XML. Path autogenerated
      is slightly different from qemu driver: qemu stores also on
      "channels/target" but it creates then a directory per domain with
      each channel target name. libxl doesn't appear to have a clear
      definition of private files associated with each domain, so for
      simplicity we do it slightly different. On qemu each autogenerated
      channel goes like:
      
      channels/target/<domain-name>/<target name>
      
      Whereas for libxl:
      
      channels/target/<domain-name>-<target name>
      
      Should note that if path is not specified it won't persist,
      existing only on live XML, unless user had initially specified it.
      Since support for libxl channels only came on Xen >= 4.5 we therefore
      need to conditionally compile it with LIBXL_HAVE_DEVICE_CHANNEL.
      
      After this patch and having a qemu guest agent:
       $ cat domain.xml | grep -a1 channel | head -n 5 | tail -n 4
       <channel type='unix'>
         <source mode='bind' path='/tmp/channel'/>
         <target type='xen' name='org.qemu.guest_agent.0'/>
       </channel>
      
       $ virsh create domain.xml
       $ echo '{"execute":"guest-network-get-interfaces"}' | socat
       stdio,ignoreeof  unix-connect:/tmp/channel
      
       {"execute":"guest-network-get-interfaces"}
       {"return": [{"name": "lo", "ip-addresses": [{"ip-address-type": "ipv4",
       "ip-address": "127.0.0.1", "prefix": 8}, {"ip-address-type": "ipv6",
       "ip-address": "::1", "prefix": 128}], "hardware-address":
       "00:00:00:00:00:00"}, {"name": "eth0", "ip-addresses":
       [{"ip-address-type": "ipv4", "ip-address": "10.100.0.6", "prefix": 24},
       {"ip-address-type": "ipv6", "ip-address": "fe80::216:3eff:fe40:88eb",
       "prefix": 64}], "hardware-address": "00:16:3e:40:88:eb"}, {"name":
       "sit0"}]}
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      719b663f
  26. 26 9月, 2016 1 次提交
  27. 22 9月, 2016 1 次提交
    • J
      cpu: Rework cpuCompare* APIs · 7f127ded
      Jiri Denemark 提交于
      Both cpuCompare* APIs are renamed to virCPUCompare*. And they should now
      work for any guest CPU definition, i.e., even for host-passthrough
      (trivial) and host-model CPUs. The implementation in x86 driver is
      enhanced to provide a hint about -noTSX Broadwell and Haswell models
      when appropriate.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      7f127ded
  28. 12 9月, 2016 2 次提交
  29. 03 9月, 2016 1 次提交