1. 24 7月, 2015 2 次提交
    • L
      test: introduce a function in test driver to check get vcpupin info · b70b5ff4
      Luyao Huang 提交于
      As there is a regression in use vcpupin get info, introduce a new function
      to test the virsh client.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      b70b5ff4
    • L
      conf: reorganize virNetworkDHCPDefParseXML · 03b6bdca
      Laine Stump 提交于
      This makes the range and static host array management in
      virNetworkDHCPDefParseXML() more similar to what is done in
      virNetworkDefUpdateIPDHCPRange() and virNetworkDefUpdateIPDHCPHost() -
      they use VIR_APPEND_ELEMENT rather than a combination of
      VIR_REALLOC_N() and separate incrementing of the array size.
      
      The one functional change here is that a memory leak of the contents
      of the last (unsuccessful) virNetworkDHCPHostDef was previously leaked
      in certain failure conditions, but it is now properly cleaned up.
      03b6bdca
  2. 23 7月, 2015 3 次提交
  3. 22 7月, 2015 18 次提交
    • R
      netdev: fix build on FreeBSD · 830344d6
      Roman Bogorodskiy 提交于
      Commit ac3ed208 breaks build on FreeBSD with:
      
        CC       util/libvirt_util_la-virnetdev.lo
      util/virnetdev.c:2967:1: error: unused function 'virNetDevRDMAFeature' [-Werror,-Wunused-function]
      virNetDevRDMAFeature(const char *ifname,
      ^
      
      So hide virNetDevRDMAFeature function under the #ifdef 'SIOCETHTOOL'
      and 'HAVE_STRUCT_IFREQ' section.
      
      Pushed under the build breaker rule.
      830344d6
    • D
      configure: clarify rationale for checking pkcheck · a92bb087
      Daniel P. Berrange 提交于
      We don't need pkcheck binary, but we must detect it in order
      to see if we're preferring polkit-1 over polkit-0 when both
      are installed. We should also check $with_dbus to see if we
      have dbus-devel available, as that's required to talk to
      polkit-1.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a92bb087
    • L
      qemu: fix the error cover issue in SetMemoryParameters · 704cf06a
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1245476
      
      We won't return the errno after commit 0d7f45ae, and
      the more clearly error will be set in the code in vircgroup*.
      Also We will always report error "Operation not permitted",
      because the return is -1.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      704cf06a
    • A
      nodeinfo: Calculate present and online CPUs only once · 6395ec1c
      Andrea Bolognani 提交于
      Move the calls to the respective functions from virNodeParseNode(),
      which is executed once for every NUMA node, to
      linuxNodeInfoCPUPopulate(), which is executed just once per host.
      6395ec1c
    • A
      nodeinfo: Use a bitmap to keep track of node CPUs · 05be6062
      Andrea Bolognani 提交于
      Keep track of what CPUs belong to the current node while walking
      through the sysfs node entry, so we don't need to do it a second
      time immediately afterwards.
      
      This also allows us to loop through all CPUs that are part of a
      node in guaranteed ascending order, which is something that is
      required for some upcoming changes.
      05be6062
    • A
      nodeinfo: Use nodeGetOnlineCPUBitmap() when parsing node · b909e9fb
      Andrea Bolognani 提交于
      No need to look up the online status of each CPU separately when we
      can get all the information in one go.
      b909e9fb
    • A
      nodeinfo: Phase out cpu_set_t usage · b7b50647
      Andrea Bolognani 提交于
      Swap out all instances of cpu_set_t and replace them with virBitmap,
      which some of the code was already using anyway.
      
      The changes are pretty mechanical, with one notable exception: an
      assumption has been added on the max value we can run into while
      reading either socket_it or core_id.
      
      While this specific assumption was not in place before, we were
      using cpu_set_t improperly by not making sure not to set any bit
      past CPU_SETSIZE or explicitly allocating bigger bitmaps; in fact
      the default size of a cpu_set_t, 1024, is way too low to run our
      testsuite, which includes core_id values in the 2000s.
      b7b50647
    • A
      nodeinfo: Rename nodeGetCPUBitmap() to nodeGetOnlineCPUBitmap() · c1df42d7
      Andrea Bolognani 提交于
      The new name makes it clear that the returned bitmap contains the
      information about which CPUs are online, not eg. which CPUs are
      present.
      
      No behavioral change.
      c1df42d7
    • A
      nodeinfo: Remove out parameter from nodeGetCPUBitmap() · ccd0ea7e
      Andrea Bolognani 提交于
      Not all users of this API will need the size of the returned
      bitmap; those who do can simply call virBitmapSize() themselves.
      ccd0ea7e
    • A
      nodeinfo: Add old kernel compatibility to nodeGetPresentCPUBitmap() · 37f73e4a
      Andrea Bolognani 提交于
      If the cpu/present file is not available, we assume that the kernel
      is too old to support non-consecutive CPU ids and return a bitmap
      with all the bits set to represent this fact. This assumption is
      already exploited in nodeGetCPUCount().
      
      This means users of this API can expect the information to always
      be available unless an error has occurred, and no longer need to
      treat the NULL return value as a special case.
      
      The error message has been updated as well.
      37f73e4a
    • A
      nodeinfo: Rename linuxParseCPUmax() to linuxParseCPUCount() · a2e2add1
      Andrea Bolognani 提交于
      The original name was confusing because the function returns the number
      of CPUs, not the maximum CPU id. The comment above the function has
      been updated to reflect this.
      
      No behavioral changes.
      a2e2add1
    • A
      nodeinfo: Introduce linuxGetCPUOnlinePath() · 6fecc401
      Andrea Bolognani 提交于
      6fecc401
    • A
      nodeinfo: Introduce linuxGetCPUGlobalPath() · bd87f07c
      Andrea Bolognani 提交于
      This is just a more generic version of linuxGetCPUPresentPath(),
      which is now implemented by calling the new function appropriately.
      bd87f07c
    • A
      nodeinfo: Fix nodeGetCPUBitmap()'s fallback code path · 2a680189
      Andrea Bolognani 提交于
      During the recent refactoring/cleanups, a bug has been introduced
      that caused all CPUs to be reported as online unless the sysfs
      cpu/present file was available.
      
      This commit fixes the fallback code path by building the directory
      path passed to virNodeGetCpuValue() correctly.
      2a680189
    • A
    • A
      tests: Restore links in deconfigured-cpus nodeinfo test · cc3d52eb
      Andrea Bolognani 提交于
      When cleaning up the data (taken from a running system) for inclusion
      I went a little too far and deleted a bunch of links that should have
      been left alone. The test worked despite this because it was going
      through a fallback code path.
      
      A few other files are affected as well: again, the data is taken from
      a running system, so even thought we would probably be okay if we
      just added the links, aligning everything is definitely safer.
      cc3d52eb
    • P
      cgroup: Drop resource partition from virSystemdMakeScopeName · 88f6c007
      Peter Krempa 提交于
      The scope name, even according to our docs is
      "machine-$DRIVER\x2d$VMNAME.scope" virSystemdMakeScopeName would use the
      resource partition name instead of "machine-" if it was specified thus
      creating invalid scope paths.
      
      This makes libvirt drop cgroups for a VM that uses custom resource
      partition upon reconnecting since the detected scope name would not
      match the expected name generated by virSystemdMakeScopeName.
      
      The error is exposed by the following log entry:
      
      debug : virCgroupValidateMachineGroup:302 : Name 'machine-qemu\x2dtestvm.scope' for controller 'cpu' does not match 'testvm', 'testvm.libvirt-qemu' or 'machine-test-qemu\x2dtestvm.scope'
      
      for a "/machine/test" resource and "testvm" vm.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238570
      88f6c007
    • C
      spec: Fix polkit dep on F23 · 6600f4f3
      Cole Robinson 提交于
      As of fedora polkit-0.113-2, polkit-devel only pulls in polkit-libs, not
      full polkit, but we need the latter for pkcheck otherwise our configure
      test fails.
      6600f4f3
  4. 21 7月, 2015 14 次提交
    • P
      virsh: Refactor block job waiting in cmdBlockCopy · faa14391
      Peter Krempa 提交于
      Similarly to the refactor of cmdBlockCommit in a previous commit this
      does the same change for cmdBlockCopy.
      faa14391
    • P
      virsh: Refactor block job waiting in cmdBlockCommit · 74084035
      Peter Krempa 提交于
      Reuse the vshBlockJobWait infrastructure to refactor cmdBlockCommit to
      use the common code. This additionally fixes a bug when working with
      new qemus, where when doing an active commit with --pivot the pivoting
      would fail, since qemu reaches 100% completion but the job doesn't
      switch to synchronized phase right away.
      74084035
    • P
      virsh: Refactor block job waiting in cmdBlockPull · 2e782763
      Peter Krempa 提交于
      Introduce helper function that will provide logic for waiting for block
      job completion so the 3 open coded places can be unified and improved.
      
      This patch introduces the whole logic and uses it to fix
      cmdBlockJobPull. The vshBlockJobWait function provides common logic for
      block job waiting that should be robust enough to work across all
      previous versions of libvirt. Since virsh allows passing user-provided
      strings as paths of block devices we can't reliably use block job events
      for detection of block job states so the function contains a great deal
      of fallback logic.
      2e782763
    • P
      qemu: Update state of block job to READY only if it actually is ready · eae59247
      Peter Krempa 提交于
      Few parts of the code looked at the current progress of and assumed that
      a two phase blockjob is in the _READY state as soon as the progress
      reached 100% (info.cur == info.end). In current versions of qemu this
      assumption is invalid and qemu exposes a new flag 'ready' in the
      query-block-jobs output that is set to true if the job is actually
      finished.
      
      This patch adds internal data handling for reading the 'ready' flag and
      acting appropriately as long as the flag is present.
      
      While this still doesn't fix the virsh client problem with two phase
      block jobs and the --pivot option, it at least improves the error
      message:
      
      $ virsh blockcommit  --wait --verbose vm vda  --base vda[1] --active --pivot
      Block commit: [100 %]error: failed to pivot job for disk vda
      error: internal error: unable to execute QEMU command 'block-job-complete': The active block job for device 'drive-virtio-disk0' cannot be completed
      
      to
      
      $ virsh blockcommit  --wait --verbose VM vda  --base vda[1] --active --pivot
      Block commit: [100 %]error: failed to pivot job for disk vda
      error: block copy still active: disk 'vda' not ready for pivot yet
      eae59247
    • P
      virsh: Refactor argument handling in cmdBlockPull · 44b18323
      Peter Krempa 提交于
      Put all argument parsing together and refactor the argument checking
      code.
      44b18323
    • P
      virsh: Refactor argument handling in cmdBlockCopy · 8e85f628
      Peter Krempa 提交于
      Put all argument parsing together and refactor the argument checking
      code.
      8e85f628
    • P
      virsh: Refactor argument checking in cmdBlockCommit · bd687cf9
      Peter Krempa 提交于
      Use the VSH_EXCLUSIVE_OPTIONS to exclude combinations of --pivot and
      --keep-overlay and refactor the enforcing of the --wait option and other
      flags that imply --wait.
      bd687cf9
    • P
      virsh: Kill blockJobImpl by moving the final impl into cmdBlockCommit · 5dceea2c
      Peter Krempa 提交于
      Final cleanup to get rid of the hub function.
      5dceea2c
    • P
      bb5a145d
    • P
      virsh: block job: separate abort from blockJobImpl · a538ff8d
      Peter Krempa 提交于
      a538ff8d
    • P
      42c9c6fc
    • P
      virsh: cmdBlockJob: Switch to declarative flag interlocking · 2f12cb93
      Peter Krempa 提交于
      Use the VSH_EXCLUSIVE_OPTIONS_VAR to interlock incompatible options.
      Since a variable named 'abort' would conflict with older compilers use
      VSH_EXCLUSIVE_OPTIONS for the --abort option.
      2f12cb93
    • P
      virsh: blockjob: Extract block job info code into a separate function · dda95b53
      Peter Krempa 提交于
      cmdBlockJob will be converted to a hub that will call into the
      individual executor functions.
      dda95b53
    • M
      nodedev: add RDMA and tx-udp_tnl-segmentation NIC capabilities · ac3ed208
      Moshe Levi 提交于
      Adding functionality to libvirt that will allow
      it query the interface for the availability of RDMA and
      tx-udp_tnl-segmentation Offloading NIC capabilities
      
      Here is an example of the feature XML definition:
      
      <device>
      <name>net_eth4_90_e2_ba_5e_a5_45</name>
        <path>/sys/devices/pci0000:00/0000:00:03.0/0000:08:00.1/net/eth4</path>
        <parent>pci_0000_08_00_1</parent>
        <capability type='net'>
          <interface>eth4</interface>
          <address>90:e2:ba:5e:a5:45</address>
          <link speed='10000' state='up'/>
          <feature name='rx'/>
          <feature name='tx'/>
          <feature name='sg'/>
          <feature name='tso'/>
          <feature name='gso'/>
          <feature name='gro'/>
          <feature name='rxvlan'/>
          <feature name='txvlan'/>
          <feature name='rxhash'/>
          <feature name='rdma'/>
          <feature name='txudptnl'/>
          <capability type='80203'/>
        </capability>
      </device>
      ac3ed208
  5. 20 7月, 2015 3 次提交
    • R
      nodeinfo: fix build on FreeBSD · e46791e0
      Roman Bogorodskiy 提交于
      Currently, build fails on FreeBSD with:
      
        CC       libvirt_driver_la-nodeinfo.lo
      nodeinfo.c:1941:56: error: use of undeclared identifier 'SYSFS_SYSTEM_PATH'
          const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SYSTEM_PATH;
                                                             ^
      1 error generated.
      
      This is caused by commit b97b3048 that added sysfs_prefix to
      nodeCapsInitNUMA and used SYSFS_CPU_PATH.
      
      Fix it by unconditionally defining SYSFS_CPU_PATH instead of defining it
      under #ifdef __linux__.
      e46791e0
    • M
      qemu: Reject updating unsupported disk information · 717c99f3
      Martin Kletzander 提交于
      If one calls update-device with information that is not updatable,
      libvirt reports success even though no data were updated.  The example
      used in the bug linked below uses updating device with <boot order='2'/>
      which, in my opinion, is a valid thing to request from user's
      perspective.  Mainly since we properly error out if user wants to update
      such data on a network device for example.
      
      And since there are many things that might happen (update-device on disk
      basically knows just how to change removable media), check for what's
      changing and moreover, since the function might be usable in other
      drivers (updating only disk path is a valid possibility) let's abstract
      it for any two disks.
      
      We can't possibly check for everything since for many fields our code
      does not properly differentiate between default and unspecified values.
      Even though this could be changed, I don't feel like it's worth the
      complexity so it's not the aim of this patch.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1007228
      717c99f3
    • M
      Escape left brace as new perl suggests · 0aa81bbd
      Martin Kletzander 提交于
      After upgrade to perl-5.22.0, it started complaining about one of our
      scripts.  The thing is that even though it works, it wants all curly
      brackets escaped properly.  The change is not functional, it merely gets
      rid of the following error:
      
        Unescaped left brace in regex is deprecated, passed through in regex;
        marked by <-- HERE in m/^enum { <-- HERE / at -e line 3.
      
      There is one more error like this that I'm getting, but it is because of
      GNU automake bug #21001:
      
        https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21001Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      0aa81bbd