1. 05 9月, 2012 6 次提交
    • J
      qemu: Do not require auth scheme in graphics events · 965ccdd1
      Jiri Denemark 提交于
      Only VNC_{{DIS,}CONNECTED,INITIALIZED} and SPICE_INITIALIZED events are
      documented to support server/auth field and even there it is marked as
      optional. Emit "" auth scheme in case QEMU didn't send it.
      965ccdd1
    • M
      conf: describe security_driver behavior · 95fbc833
      Martin Kletzander 提交于
      As a request was raised for this, I added few lines in the "Notes"
      part of the "security_driver" comments about allowed values.
      95fbc833
    • M
      docs: correct dompmwakeup description · aa698a49
      Martin Kletzander 提交于
      aa698a49
    • P
      Pass a correct pointer type to localtime_r(3). · 15d2c9fa
      Paul Eggert 提交于
      On 09/04/2012 08:20 AM, Eric Blake wrote:
      > tv_sec is required by POSIX to be
      > of type time_t; so this is a bug in the OpenBSD header
      > [for declaring it as long]
      
      Most likely this problem arose because of the patch I pushed
      in gnulib commit e07d7c40f3ca5ec410cf5aa6fa03cfe51e712039.
      Previously, gnulib required timeval's tv_sec to be
      the same size as time_t.  But now, it requires only that
      tv_sec be big enough to hold a time_t.
      
      This patch was needed for Emacs.  Without the patch, gnulib
      replaced struct timeval on OpenBSD, and this messed up
      utimens.c, and Emacs wouldn't build.
      
      Alternatively, gnulib could substitute its own struct timeval
      for the system's, wrapping every struct timeval-using function
      (gettimeofday, futimesat, futimes, lutimes, etc.  That'd be
      more work, though.  And it would introduce some performance
      issues with gettimeofday, which is supposed to be fast.
      
      I've been trying to get away from using struct timeval,
      and to use the higher-resolution struct timespec instead,
      so messing with these obsolescent interfaces has been
      lower priority for me.  But if someone wants to take the
      more-ambitious approach that'd be fine, I expect.
      
      For this particular case, though, how about if we avoid
      the problem entirely?  libvirt doesn't need to use struct
      timeval here at all.  It makes libvirt smaller and probably
      faster, and it ports to OpenBSD without messing with gnulib.
      15d2c9fa
    • E
      build: use correct libraries for clock_gettime · d74e5a4d
      Eric Blake 提交于
      On OpenBSD, clock_gettime() exists in libc rather than librt, and
      blindly linking with -lrt made the build fail.  Gnulib already
      did the work for determining which libraries to use, so we should
      reuse that work rather than doing it ourselves.
      
      * bootstrap.conf (gnulib_modules): Pull in clock-time.
      * configure.ac (RT_LIBS): Drop.
      * src/Makefile.am (libvirt_util_la_LIBADD): Use gnulib variable
      instead.
      * src/util/virtime.c (includes): Simplify.
      d74e5a4d
    • J
      afa67b77
  2. 04 9月, 2012 3 次提交
    • V
      Rename iolimit to blockio. · 72f1f220
      Viktor Mihajlovski 提交于
      After discussion with DB we decided to rename the new iolimit
      element as it creates the impression it would be there to
      limit (i.e. throttle) I/O instead of specifying immutable
      characteristics of a block device.
      This is also backed by the fact that the term I/O Limits has
      vanished from newer storage admin documentation.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      72f1f220
    • J
      qemu: Fix reboot with guest agent · 03c42a45
      Jiri Denemark 提交于
      When reboot using qemu guest agent was requested, qemu driver kept
      waiting for SHUTDOWN event from qemu. However, such event is never
      emitted during guest reboot and qemu driver would keep waiting forever.
      03c42a45
    • D
      Fix mingw64 build by using intptr_t for int->void* casts · 8675406c
      Daniel P. Berrange 提交于
      The viratomictest.c was casting from an int to a void* via a
      long. This works on Linux or Mingw32, but fails on Mingw64
      due to a pointer/integer size mis-match. Replacing 'long'
      with 'intptr_t' ensures matching type sizes
      8675406c
  3. 03 9月, 2012 4 次提交
  4. 01 9月, 2012 3 次提交
    • E
      python: don't mask libvirt errors · 63bfc598
      Eric Blake 提交于
      A user reported this crash when using python bindings:
      
        File "/home/nox/workspace/NOX/src/NOX/hooks.py", line 134, in trigger
          hook.trigger(event)
        File "/home/nox/workspace/NOX/src/NOX/hooks.py", line 33, in trigger
          self.handlers[event]()
        File "/home/nox/workspace/NOX/hooks/volatility.py", line 81, in memory_dump
          for block in Memory(self.ctx):
        File "/home/see/workspace/NOX/src/NOX/lib/libtools.py", line 179, in next
          libvirt.VIR_MEMORY_PHYSICAL)
        File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1759, in memoryPeek
          ret = libvirtmod.virDomainMemoryPeek(self._o, start, size, flags)
      SystemError: error return without exception set
      
      In the python bindings, returning NULL makes python think an
      exception was thrown, while returning the None object lets the
      wrappers know that a libvirt error exists.
      
      Reported by Nox DaFox, fix suggested by Dan Berrange.
      
      * python/libvirt-override.c (libvirt_virDomainBlockPeek)
      (libvirt_virDomainMemoryPeek): Return python's None object, so
      wrapper knows to check libvirt error.
      63bfc598
    • V
      qemu: Support for Block Device IO Limits. · 277a49bc
      Viktor Mihajlovski 提交于
      Implementation of iolimits for the qemu driver with
      capability probing for block size attribute and
      command line generation for block sizes.
      Including testcase for qemuxml2argvtest.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      277a49bc
    • V
      conf: Support for Block Device IO Limits · 5cc50ad7
      Viktor Mihajlovski 提交于
      Introducing a new iolimits element allowing to override certain
      properties of a guest block device like the physical and logical
      block size.
      This can be useful for platforms with 'non-standard' disk formats
      like S390 DASD with its 4K block size.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      5cc50ad7
  5. 31 8月, 2012 24 次提交
    • E
      command: shell-quote when logging commands · 54e99644
      Eric Blake 提交于
      Without this patch, logged command executions can be ambiguous if
      the command contained any shell metacharacters.  This has caused
      more than one person to attempt to patch clients to add unnecessary
      quoting, without realizing that the command itself was run with
      correct args, and only the logged output was ambiguous.
      
      * src/util/command.c (virCommandToString): Add shell escapes.
      * tests/commandtest.c (test16): Test new behavior.
      * tests/commanddata/test16.log: Update expected output.
      * tests/qemuxml2argvdata/qemuxml2argv-*.args: Likewise.
      * tests/networkxml2argvdata/*.argv: Likewise.
      54e99644
    • P
      virsh: remove unneeded usage of vshConnectionUsability() · 67f83cd4
      Peter Krempa 提交于
      Now that vshCommandRun() checks for the connection automaticaly, remove
      all of the redundant checks in the code.
      
      vshConnectionUsability() no longer needs to be exported and this patch
      marks it static.
      67f83cd4
    • P
      virsh: Improve checking for connection when running commands · 70e60891
      Peter Krempa 提交于
      Almost each virsh command uses the function vshConnectionUsability
      before doing anything, to check if the connection is "alive".  Commands
      that don't need an conection are already conveniently marked with
      VSH_CMD_FLAG_NOCONNECT. We can automaticaly check for the connection
      before calling any remote command so we don't forget to do so.
      
      This patch also upgrades the connection check to use virConnectIsAlive
      along with the current approach.
      70e60891
    • M
      qemu: fix remote port searching · b805e342
      Martin Kletzander 提交于
      After fixing the last review comments on remote port searching (commit
      a14b4aea), the commit right after that
      wasn't modified accordingly, therefore two values weren't changed as
      they should and the configurable ports don't work as expected.
      
      This simple commit changes last two values missed and fixes the issue.
      b805e342
    • O
      schemas: Fix wwn pattern · c289ebac
      Osier Yang 提交于
      It should be [] instead of ().
      c289ebac
    • O
      util: Update the inconsistent and outdated comments · a2145fae
      Osier Yang 提交于
      The codes were updated to allow to reset the device as long as
      there is no devices/functions behind the same bus. However, the
      comments were kept without touched.
      a2145fae
    • D
      Release of libvirt-0.10.1 · 383a4165
      Daniel Veillard 提交于
      * configure.ac docs/news.html.in libvirt.spec.in: update for release
      * po/*.po*: pulled localization updates for sp,ja,mr,pa,uk,zh_CN,zh_TW
        and regenerated
      383a4165
    • M
      conf: Avoid formatting auto-generated DAC labels · 990e46c4
      Marcelo Cerri 提交于
      To avoid backward compatibility issues, this patch suppresses
      auto-generated DAC labels from XML. This change affects commands such as
      dumpxml and save.
      Signed-off-by: NMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
      990e46c4
    • M
      conf: Fix parsing of seclabels without model · 86e205a2
      Marcelo Cerri 提交于
      With this patch libvirt tries to assign a model to a single seclabel
      when model is missing. Libvirt will look up at host's capabilities and
      assign the first model to seclabel.
      
      This patch fixes:
      
      1. The problem with existing guests that have a seclabel defined in its XML.
      2. A XML parse error when a guest is restored.
      Signed-off-by: NMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
      86e205a2
    • V
      virsh: fixed incorrect timing report · 641d406d
      Viktor Mihajlovski 提交于
      When executing virsh -t <command> the reported timing was off
      by 3 orders of magnitude if the command took more than one
      second.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      641d406d
    • J
      virsh: Document subdriver option of attach-disk · eac1ab05
      Jiri Denemark 提交于
      eac1ab05
    • J
      qemu: Don't ignore CPU tuning config if required cgroups are missing · 774eb45b
      Jiri Denemark 提交于
      When domain XML contains any of the elements for setting up CPU
      scheduling parameters (period, quota, emulator_period, or
      emulator_quota) we need cpu cgroup to enforce the configuration.
      However, the existing code would just ignore silently such settings if
      either cgroups were not available at all cpu cgroup was not available.
      Moreover, APIs for manipulating CPU scheduler parameters were already
      failing if cpu cgroup was not available. This patch makes cpu cgroup
      mandatory for all domains that use CPU scheduling elements in their XML.
      774eb45b
    • G
    • G
      cgroup: fix libvirtd crash caused by messed memory · fccab89d
      Guannan Ren 提交于
      The variable max_id is initialized again in the step of
      getting cpu mapping variable map2. But in the next for loop
      we still expect original value of max_id, the bug will
      crash libvirtd when using on NUMA machine with big number
      of cpus.
      fccab89d
    • G
      657fef14
    • G
      cgroup: read more data from cgroup cpuacct.usage_percpu · c402eebc
      Guannan Ren 提交于
      On NUMA machine, the length of string got from file
      cpuacct.usage_percpu is quite large, so expand the
      limit of 1024 bytes.
      
      errors like:
      Failed to read file \
      '/cgroup/cpuacct/libvirt/qemu/rhel6q/cpuacct.usage_percpu': \
      Value too large for defined data type
      c402eebc
    • J
      docs: Fix typo in CPU tuning · b10ec38d
      Jiri Denemark 提交于
      b10ec38d
    • P
      doc: Fix emulator pinning example in formatdomain.html · f8fbfbc2
      Peter Krempa 提交于
      Add correct closing tags.
      f8fbfbc2
    • S
      nwfilter: adapt IP learning for broadcasted DHCP replies · 4021b85f
      Stefan Berger 提交于
      Adapt the IP learning code to also accept broadcasted DHCP replies
      4021b85f
    • S
      nwfilter: accept broadcasted DHCP replies in DHCP snooping code · c828a746
      Stefan Berger 提交于
      Some DHCP servers send their DHCP replies to the broadcast MAC address
      rather than to the MAC address of the VM. The existing DHCP snooping
      code assumes that the reply always goes to the MAC address of the VM
      thus filtering the traffic of some DHCP servers' replies.
      
      The below patch adapts the code to
      
      1) filter DHCP replies by comparing the MAC address in the reply against
         the MAC address of the VM (held in the snoop request)
      
      2) adapts the pcap filter for traffic towards the VM to accept DHCP replies
         sent to any MAC address; for further filtering we rely on 1)
      
      3) creates initial rules that are active while waiting for DHCP replies;
         these rules now accept DHCP replies to the VM's MAC address or to the
         MAC broadcast address
      c828a746
    • S
      Implement virMacAddrIsBroadcastRaw · 46b2cafb
      Stefan Berger 提交于
      Add function for testing for Ethernet broadcast address
      46b2cafb
    • K
      Fix adding ports to OVS bridges without VLAN tags · 7b9d55e6
      Kyle Mestery 提交于
      The introduction of the new VLAN code, along with the fix
      from 5e465df6, caused the
      addition of OVS ports to fail with the following message:
      
      ovs-vsctl: 00002|vsctl|ERR|: missing column name
      
      This fix takes into account the VLAN arguments are optional,
      and correctly sets up the command line to run the "ovs-vsctl"
      command to add ports to the OVS bridge.
      Signed-off-by: NKyle Mestery <kmestery@cisco.com>
      CC: Eric Blake <eblake@redhat.com>
      7b9d55e6
    • J
      Fix xen driver following changes to make it stateful · f781e276
      Jim Fehlig 提交于
      Recent work to improve support for loadable driver modules introduced
      a regression in the xen driver.  The legacy xen driver is now a
      stateful, libvirtd driver but was not being registered when building
      without driver modules.
      
      A slight behavior change was also noted in the xen drivers when
      built as driver modules.  Previously, explicitly specifying a
      connection URI was not necessary, but now
      
      Compiled against library: libvirt 0.10.0
      Using library: libvirt 0.10.0
      Using API: QEMU 0.10.0
      error: failed to get the hypervisor version
      error: internal error Cannot find suitable emulator for x86_64
      
      The xen drivers need to be registered before the qemu driver since
      the qemu driver will return success with a null connection URI.
      This ordering is safe since the xen drivers will decline when not
      running the xen kernel.
      f781e276
    • N
      Fix issue of PF brought down if VF is 8021.Qbh and pci passthrough · 3044433f
      Nishank Trivedi 提交于
      If a 8021.Qbh network device supports SRIOV and its VF is being used
      in pci passthrough mode, when the guest is shutdown or destroyed, the
      PF inteface is also brought down. qemuDomainHostdevNetConfigRestore()
      finds out the PF for provided hostdev (which is VF) and passes it to
      virNetDevPortProfileDisassociate() as linkdev. Later, linkdev gets passed
      to virNetDevSetOnline() where the interface is brought down by clearing
      IFF_UP flag.
      
      Bringing down a PF, when only VF is being brought down is not expected
      behavior. This patch adds a check so that virNetDevSetOnline() is called
      only for PF and not if device is a VF.
      Signed-off-by: NNishank Trivedi <nistrive@cisco.com>
      3044433f