1. 03 5月, 2013 8 次提交
    • M
      esx: Reduce code duplication in generator · 4ffb52ac
      Matthias Bolte 提交于
      4ffb52ac
    • J
      build: Fix build when WITH_HAL is defined · ce45c761
      Jim Fehlig 提交于
      Commit 7c9a2d88 missed inclusion of virstring.h in a few places
      when WITH_HAL is defined, causing build failures.
      ce45c761
    • E
      build: fix mingw build of vbox · 4f8e2bac
      Eric Blake 提交于
      More fallout from commit 7c9a2d88 dropping too many headers.  Fixes:
      
      In file included from ../../src/vbox/vbox_glue.c:26:0:
      ../../src/vbox/vbox_MSCOMGlue.c: In function 'vboxLookupVersionInRegistry':
      ../../src/vbox/vbox_MSCOMGlue.c:435:5: error: implicit declaration of function 'virParseVersionString' [-Werror=implicit-function-declaration]
      ...
      ../../src/vbox/vbox_driver.c: In function 'vboxConnectOpen':
      ../../src/vbox/vbox_driver.c:147:5: error: implicit declaration of function 'getuid' [-Werror=implicit-function-declaration]
      ../../src/vbox/vbox_driver.c:147:5: error: nested extern declaration of 'getuid' [-Werror=nested-externs]
      
      * src/vbox/vbox_MSCOMGlue.c (includes): Add missing includes.
      * src/vbox/vbox_driver.c (includes): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4f8e2bac
    • E
      build: fix mingw build of virprocess.c · 05f79a38
      Eric Blake 提交于
      Commit 776d49f4 added a static function that is only called
      conditionally; leading to this compile error on mingw:
      
        CC       libvirt_util_la-virprocess.lo
      ../../src/util/virprocess.c:624:26: error: 'struct rlimit' declared inside parameter list [-Werror]
      ../../src/util/virprocess.c:624:26: error: its scope is only this definition or declaration, which is probably not what you want [-Werror]
      ../../src/util/virprocess.c:622:1: error: 'virProcessPrLimit' defined but not used [-Werror=unused-function]
      
      * src/util/virprocess.c (virProcessPrLimit): Only declare
      virProcessPrLimit when used.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      05f79a38
    • E
      build: fix FreeBSD build · 348ac061
      Eric Blake 提交于
      Commit 7c9a2d88 cleaned up too many headers; FreeBSD builds
      failed due to:
      
      util/virutil.c:556: warning: implicit declaration of function 'canonicalize_file_name'
      
      (Not sure which Linux header leaked this declaration, but gnulib
      only guarantees it in stdlib.h)
      
      libvirt.c:956: warning: implicit declaration of function 'virGetUserConfigDirectory'
      
      (Here, a build on Linux was picking up virutil.h indirectly via
      one of the conditional driver headers, where that driver was not
      being built on my FreeBSD setup)
      
      * src/util/virutil.c (includes): Need <stdlib.h> for
      canonicalize_file_name.
      * src/libvirt.c (includes): Use "virutil.h" unconditionally,
      rather than relying on conditional indirect inclusion.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      348ac061
    • E
      build: avoid useless virAsprintf · 25ae3d30
      Eric Blake 提交于
      virAsprintf(&foo, "%s", bar) is wasteful compared to
      foo = strdup(bar) (or eventually, VIR_STRDUP(foo, bar),
      but one thing at a time...).
      
      Noticed while reviewing Laine's attempt to clean up broken
      qemu:///session.
      
      * cfg.mk (sc_prohibit_asprintf): Enhance rule.
      * src/esx/esx_storage_backend_vmfs.c
      (esxStorageBackendVMFSVolumeLookupByKey): Fix offender.
      * src/network/bridge_driver.c (networkStateInitialize): Likewise.
      * src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopDHCPOpen):
      Likewise.
      * src/storage/storage_backend_sheepdog.c
      (virStorageBackendSheepdogRefreshVol): Likewise.
      * src/util/vircgroup.c (virCgroupAddTaskStrController): Likewise.
      * src/util/virdnsmasq.c (addnhostsAdd): Likewise.
      * src/xen/block_stats.c (xenLinuxDomainDeviceID): Likewise.
      * src/xen/xen_driver.c (xenUnifiedConnectOpen): Likewise.
      * tools/virsh.c (vshGetTypedParamValue): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      25ae3d30
    • E
      build: always include sanitytest in tarball · 5a3487da
      Eric Blake 提交于
      The libvirt 1.0.5 tarball is missing a file which renders 'make
      check' broken; first reported on list by Guido Günther.
      
      * python/Makefile.am (EXTRA_DIST): Hoist sanitytest.py out of
      HAVE_PYTHON conditional.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5a3487da
    • L
      util: fix compile errors caused by moving string functions · cc8f9e67
      Laine Stump 提交于
      commit 7c9a2d88 missed adding in a few #include "virstring.h"s, causing
      builds to fail.
      cc8f9e67
  2. 02 5月, 2013 9 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
    • M
      qemu: Generate agent socket path if missing · 297c99a5
      Michal Privoznik 提交于
      It's not desired to force users imagine path for a socket they
      are not even supposed to connect to. On the other hand, we
      already have a release where the qemu agent socket path is
      exposed to XML, so we cannot silently drop it from there.
      The new path is generated in form:
      
      $LOCALSTATEDIR/lib/libvirt/qemu/channel/target/$domain.$name
      
      for qemu system mode, and
      
      $XDG_CONFIG_HOME/qemu/lib/channel/target/$domain.$name
      
      for qemu session mode.
      297c99a5
    • G
      virInitctlRequest: unbreak make syntax check · ca75c443
      Guido Günther 提交于
      introduced by dcf97846
      
      To trigger this cppi needs to be installed.
      ca75c443
    • G
      virInitctlRequest: unbreak make syntax check · a1365d73
      Guido Günther 提交于
      introduced by dcf97846
      a1365d73
    • D
      Release of libvirt-1.0.5 · 8e20a23f
      Daniel Veillard 提交于
      * configure.ac docs/news.html.in libvirt.spec.in: updated for the release
      * po/*.po*: pulled and merged a number of new localization updates
      8e20a23f
    • G
      virInitctlRequest: Don't hardcode 384 bytes size · dcf97846
      Guido Günther 提交于
      When MAXHOSTNAMELEN is set we have to take it's value into account.
      Otherwise the build fails on kFreeBSD (FreeBSD kernel and GNU userland)
      dcf97846
    • L
      pci: autolearn name of stub driver, remove from arglist · e482693b
      Laine Stump 提交于
      virPCIDeviceReattach and virPCIDeviceUnbindFromStub (called by
      virPCIDeviceReattach) had previously required the name of the stub
      driver as input. This is unnecessary, because the name of the driver
      the device is currently bound to can be found by looking at the link:
      
        /sys/bus/pci/dddd:bb:ss.ff/driver
      
      Instead of requiring that the name of the expected stub driver name
      and only unbinding if that one name is matched, we no longer take a
      driver name in the arglist for either of these
      functions. virPCIDeviceUnbindFromStub just compares the name of the
      currently bound driver to a list of "well known" stubs (right now
      contains "pci-stub" and "vfio-pci" for qemu, and "pciback" for xen),
      and only performs the unbind if it's one of those devices.
      
      This allows virsh nodedevice-reattach to work properly across a
      libvirtd restart, and fixes a couple of cases where we were
      erroneously still hard-coding "pci-stub" as the drive name.
      
      For some unknown reason, virPCIDeviceReattach had been calling
      modprobe on the stub driver prior to unbinding the device. This was
      problematic because we no longer know the name of the stub driver in
      that function. However, it is pointless to probe for the stub driver
      at that time anyway - because the device is bound to the stub driver,
      we are guaranteed that it is already loaded, and so that call to
      modprobe has been removed.
      e482693b
    • E
      spec: collect all BuildRequires into one area · e2472e69
      Eric Blake 提交于
      Conditional BuildRequires: should be at the top level, rather
      than appearing in conditional sub-package sections.  This
      appears to be the only offender.
      
      * libvirt.spec.in (BuildRequires): Move libblkid-devel into
      correct area.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e2472e69
    • C
      docs: Fix closing tag in snapshot documentation · 364554a0
      Christophe Fergeau 提交于
      Commit cc6d19f3 added text containing "<code>snapshot<code>" to
      formatsnapshot.html.in. The closing tag is missing '/' which causes
      the documentation to misrender.
      364554a0
  3. 01 5月, 2013 8 次提交
    • A
      ESX: Fix DISPATCH_FREE generation code to free all extended objects · 4e650435
      Ata E Husain Bohra 提交于
      Python code generator "generate_source" section that handles
      code generation to "free" inherited objects needs to generate
      DISPATCH_FREE calls for all extended_by objects.
      4e650435
    • V
      S390: Do not generate a default USB controller · 3a82f628
      Viktor Mihajlovski 提交于
      For s390 we don't want to have a default USB device generated even
      if QEMU is silently tolerating -usb on the command line. This may change
      in the future.
      Another reason to avoid the USB controller is that it implies a PCI
      bus which might cause a regression at some later point in time.
      The following change will set the USB controller model to 'none'
      unless a model or address has been specified, which can be the case
      if a legacy definition is loaded or the XML writer knows what
      she/he's doing.
      Requiring the user to explicitly disable USB on systems not supporting
      it seems cumbersome.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      3a82f628
    • V
      S390: Mention changed USB behavior · 3e82b5cc
      Viktor Mihajlovski 提交于
      Add a line saying that no USB controllers are generated by default
      on s390.
      3e82b5cc
    • L
      qemu: fix failure to start with spice graphics and no tls · f6966b62
      Laine Stump 提交于
      Commit eca3fdf7 inadvertantly caused a failure to start for any domain
      with the following in its config:
      
          <graphics type='spice' autoport='yes'/>
      
      The problem is that when tlsPort == 0 and defaultMode == "any" (which
      is the default for defaultMode), this would be flagged in the code as
      "needTLSPort", and if there was then no spice tls config, the new
      error+fail would happen.
      
      This patch checks for the case of defaultMode == "any", and in that
      case simply doesn't allocate a TLS port (since that's probably not
      what the user wanted, and it would have failed later anyway.). It does
      leave the error in place for cases when the user specifically asked to
      use tls in one way or another, though.
      f6966b62
    • E
      build: fix cygwin build in virnetdev · 7fecc8e3
      Eric Blake 提交于
      On cygwin, compilation failed because SIOCSIFHWADDR is undefined.
      
      * src/util/virnetdev.c (virNetDevSetMAC): Cygwin can query but not
      set mac address.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7fecc8e3
    • J
      Need to call virFreeError after virSaveLastError · c0b86c8c
      John Ferlan 提交于
      c0b86c8c
    • J
      Resolve valgrind error · d0761c18
      John Ferlan 提交于
      As a result of commit id '19c345f2', 'make -C tests valgrind' has the
      following for qemuxml2argvtest:
      
      ==22482== 197 (80 direct, 117 indirect) bytes in 1 blocks are definitely lost in loss record 101 of 120
      ==22482==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
      ==22482==    by 0x4C6F301: virAlloc (viralloc.c:124)
      ==22482==    by 0x4C840FC: virSaveLastError (virerror.c:308)
      ==22482==    by 0x431882: qemuBuildCommandLine (qemu_command.c:8204)
      ==22482==    by 0x41E8F0: testCompareXMLToArgvHelper (qemuxml2argvtest.c:155)
      ==22482==    by 0x41FE9F: virtTestRun (testutils.c:157)
      ==22482==    by 0x419DEB: mymain (qemuxml2argvtest.c:654)
      ==22482==    by 0x4204DA: virtTestMain (testutils.c:719)
      ==22482==    by 0x39D0821A04: (below main) (libc-start.c:225)
      ==22482==
      d0761c18
    • J
      libvirt-guests: status: return non-zero when stopped · 9c51de2b
      Ján Tomko 提交于
      Return 3 when the service is stopped, whether there
      are saved guests or not, to conform with the LSB standards:
      
      http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
      9c51de2b
  4. 30 4月, 2013 14 次提交
    • R
      portability: handle ifreq differences in virnetdev · 5295e35f
      Roman Bogorodskiy 提交于
      FreeBSD (and maybe other BSDs) have different member
      names in struct ifreq when compared to Linux, such as:
      
       - uses ifr_data instead of ifr_newname for setting
         interface names
       - uses ifr_index instead of ifr_ifindex for interface
         index
      
      Also, add a check for SIOCGIFHWADDR for virNetDevValidateConfig().
      
      Use AF_LOCAL if AF_PACKET is not available.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5295e35f
    • L
      security driver: eliminate memory leaks in failure paths · ed12bbee
      Laine Stump 提交于
      If virPCIDeviceGetVFIOGroupDev() failed,
      virSecurity*(Set|Restore)HostdevLabel() would fail to free a
      virPCIDevice that had been allocated.
      
      These leaks were all introduced (by me) very recently, in commit
      f0bd70a9.
      ed12bbee
    • J
      libxl: Fix double-dispose of libxl domain config · 80f01915
      Jim Fehlig 提交于
      libxlBuildDomainConfig() was disposing the libxl_domain_config object
      on error, only to have it disposed again by libxlBuildDomainConfig()'s
      caller, which resulted in a segfault.  Leave disposing of the config
      object to it's owner.
      80f01915
    • M
      esx: Support virtualHW version 9 · e0eb672e
      Martin Kletzander 提交于
      We already support ESX 5.1, but virtualHW version used by such
      hypervisor [1] wasn't taken into account.
      
      [1] http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=1003746
      e0eb672e
    • M
      Fix typo in augeas comment · a6a10a52
      Martin Kletzander 提交于
      a6a10a52
    • E
      build: mark conditionally unused variables · b376dea9
      Eric Blake 提交于
      These fixes solve a compilation failure on FreeBSD:
      
      util/virnetdevtap.c: In function 'virNetDevTapGetName':
      util/virnetdevtap.c:56: warning: unused parameter 'tapfd' [-Wunused-parameter]
      util/virnetdevtap.c:56: warning: unused parameter 'ifname' [-Wunused-parameter]
      
      * src/util/virnetdevtap.c (virNetDevTapGetName): Add attributes
      when TUNGETIFF is not present.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b376dea9
    • J
      virsh: clarify vol-{down,up}load description · ce284bb5
      Ján Tomko 提交于
      Mention file/volume contents instead of just 'file'/'volume'.
      
      Also change Download->download in vol-download help,
      to be consistent with other volume commands.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=955537
      ce284bb5
    • J
      qemu: report an error if memballoon has wrong address type · 29bd350b
      Ján Tomko 提交于
      qemuBuildMemballoonDevStr returns NULL if memballoon doesn't have
      the right address type, but it doesn't report an error, leading to:
      error: An error occurred, but the cause is unknown
      
      Report a helpful error message instead, e.g.:
      error: XML error: memballoon unsupported with address type 'usb'
      29bd350b
    • J
      qemu: assign addresses when converting xml to native · 11fc1bea
      Ján Tomko 提交于
      This adds addresses to domxml-to-native output and chooses
      the correct virtio devices for ccw and s390 machines.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=957077
      11fc1bea
    • J
      virsh: fix incorrect argument errors for long options · 53531e16
      Ján Tomko 提交于
      For long options, print:
      * the option as specified by the user if it's unknown
      * the canonical long option if its argument is not
        a number (and should be)
      
      And for missing arguments, print both the short and
      the long option name.
      (Doing only one of those would require either parsing
      argv ourselves or let getopt print the errors, since
      we can't tell long and short options apart by optopt
      or longindex)
      
      https://bugzilla.redhat.com/show_bug.cgi?id=949373
      
      Unsupported long option:
      
      $ virsh --pm
      Before:
      error: unsupported option '-
      After:
      error: unsupported option '--pm'. See --help.
      
      Missing parameter:
      
      $ virsh --deb
      Before:
      error: option '-d' requires an argument
      After:
      error: option '-d'/'--debug' requires an argument
      
      $ virsh -rd
      Before:
      error: option '-d' requires an argument
      After:
      error: option '-d'/'--debug' requires an argument
      
      Non-numeric parameter:
      
      $ virsh --deb duck
      Before:
      error: option -d takes a numeric argument
      After:
      error: option --debug takes a numeric argument
      53531e16
    • P
      qemu: Error out if spice port autoallocation is requested, but disabled · eca3fdf7
      Peter Krempa 提交于
      When a user requests auto-allocation of the spice TLS port but spice TLS
      is disabled in qemu.conf, we start the machine and let qemu fail instead
      of erroring out sooner.
      
      Add an error message so that this doesn't happen.
      eca3fdf7
    • P
      network: Don't remove transient network if creating of config file fails · 8e918900
      Peter Krempa 提交于
      On the off-chance that creation of persistent configuration file would
      fail when defining a network that is already started as transient, the
      code would remove the transient data structure and thus the network.
      
      This patch changes the code so that in such case, the network is again
      marked as transient and left behind.
      8e918900
    • L
      qemu: put usb cgroup setup in common function · 811143c0
      Laine Stump 提交于
      The USB-specific cgroup setup had been inserted inline in
      qemuDomainAttachHostUsbDevice and qemuSetupCgroup, but now there is a
      common cgroup setup function called for all hostdevs, so it makes sens
      to put the usb-specific setup there and just rely on that function
      being called.
      
      The one thing I'm uncertain of here (and a reason for not pushing
      until after release) is that previously hostdev->missing was checked
      only when starting a domain (and cgroup setup for the device skipped
      if missing was true), but with this consolidation, it is now checked
      in the case of hotplug as well. I don't know if this will have any
      practical effect (does it make sense to hotplug a "missing" usb
      device?)
      811143c0
    • L
      qemu: add vfio devices to cgroup ACL when appropriate · 6e13860c
      Laine Stump 提交于
      PCIO device assignment using VFIO requires read/write access by the
      qemu process to /dev/vfio/vfio, and /dev/vfio/nn, where "nn" is the
      VFIO group number that the assigned device belongs to (and can be
      found with the function virPCIDeviceGetVFIOGroupDev)
      
      /dev/vfio/vfio can be accessible to any guest without danger
      (according to vfio developers), so it is added to the static ACL.
      
      The group device must be dynamically added to the cgroup ACL for each
      vfio hostdev in two places:
      
      1) for any devices in the persistent config when the domain is started
         (done during qemuSetupCgroup())
      
      2) at device attach time for any hotplug devices (done in
         qemuDomainAttachHostDevice)
      
      The group device must be removed from the ACL when a device it
      "hot-unplugged" (in qemuDomainDetachHostDevice())
      
      Note that USB devices are already doing their own cgroup setup and
      teardown in the hostdev-usb specific function. I chose to make the new
      functions generic and call them in a common location though. We can
      then move the USB-specific code (which is duplicated in two locations)
      to this single location. I'll be posting a followup patch to do that.
      6e13860c
  5. 29 4月, 2013 1 次提交