1. 05 9月, 2013 22 次提交
    • J
      Add '<nat>' element to '<forward>' network schemas · 437b7944
      Ján Tomko 提交于
      Commits 905629f4 and 1716e7a6 have added support for specifying
      an IPv4 range and a port range to be used by NAT:
      <forward mode='nat'>
        <nat>
          <address start='10.20.30.40' end='10.20.30.44'/>
          <port start='60000' end='65432'/>
        </nat>
      </forward>
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1004364
      437b7944
    • L
      cpu: Add cpu test cases for PPC CPU driver. · ceb2cec9
      Li Zhang 提交于
      This patch is to add cpu test casses for PPC CPU driver.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      ceb2cec9
    • L
      cpu: Implement guestData and update for PPC · b2a68c99
      Li Zhang 提交于
      On Power platform, Power7+ can support Power7 guest.
      It needs to define XML configuration to specify guest's CPU model.
      
      For exmaple:
        <cpu match='exact'>
          <model>POWER7_v2.1</model>
          <vendor>IBM</vendor>
        </cpu>
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      b2a68c99
    • L
      qemu: Remove CPU features functions calling for non-x86 platform. · adf0d770
      Li Zhang 提交于
      CPU features are not supported on non-x86 and hasFeatures will be NULL.
      
      This patch is to remove CPU features functions calling to avoid errors.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      adf0d770
    • I
      Use loop-control to allocate loop device. · 9ba230d4
      Ian Main 提交于
      This patch changes virFileLoopDeviceOpen() to use the new loop-control
      device to allocate a new loop device.  If this behavior is unsupported
      we fall back to the previous method of searching /dev for a free device.
      
      With this patch you can start as many image based LXC domains as you
      like (well almost).
      
      Fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=995543
      9ba230d4
    • G
      LXC: Don't mount securityfs when user namespace enabled · 1583dfda
      Gao feng 提交于
      Right now, securityfs is disallowed to be mounted in non-initial
      user namespace, so we must avoid trying to mount securityfs in
      a container which has user namespace enabled.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      1583dfda
    • D
      Stop calling virAllocN directly from ESX code · 393cf4d6
      Daniel P. Berrange 提交于
      The ESX code has a method esxVI_Alloc which would call
      virAllocN directly, instead of using the VIR_ALLOC_N
      macro. Remove this method and make the callers just
      use VIR_ALLOC as is normal practice.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      393cf4d6
    • L
      virDomainDeviceIsUSB: Drop check for USB controller · ce78098e
      Liuji (Jeremy) 提交于
      Delete the USB controller check from the USB Device checklist in
      virDomainDeviceIsUSB as USB controller is a PCI device rather than
      a USB one.
      Signed-off-by: NLiu Ji <jeremy.liu@huawei.com>
      ce78098e
    • D
      Ensure 'arch' is always set in cpuArchNodeData · 66ec11ad
      Daniel P. Berrange 提交于
      The s390, ppc and arm CPU drivers never set the 'arch' field
      in their impl of cpuArchNodeData. This leads to error messages
      being reported from cpuDataFree later, due to trying to use
      VIR_ARCH_NONE.
      
       #0  virRaiseErrorFull (filename=filename@entry=0x76f94434 "cpu/cpu.c", funcname=funcname@entry=0x76f942dc <__FUNCTION__.18096> "cpuGetSubDriver", linenr=linenr@entry=58,
           domain=domain@entry=31, code=code@entry=1, level=level@entry=VIR_ERR_ERROR, str1=0x76f70e18 "internal error: %s",
           str2=str2@entry=0x7155f2ec "undefined hardware architecture", str3=str3@entry=0x0, int1=int1@entry=-1, int2=int2@entry=-1, fmt=0x76f70e18 "internal error: %s")
           at util/virerror.c:646
       #1  0x76e682ea in virReportErrorHelper (domcode=domcode@entry=31, errorcode=errorcode@entry=1, filename=0x76f94434 "cpu/cpu.c",
           funcname=0x76f942dc <__FUNCTION__.18096> "cpuGetSubDriver", linenr=linenr@entry=58, fmt=0x76f7e7e4 "%s") at util/virerror.c:1292
       #2  0x76ed82d4 in cpuGetSubDriver (arch=<optimized out>) at cpu/cpu.c:57
       #3  cpuGetSubDriver (arch=VIR_ARCH_NONE) at cpu/cpu.c:51
       #4  0x76ed8818 in cpuDataFree (data=data@entry=0x70c22d78) at cpu/cpu.c:216
       #5  0x716aaec0 in virQEMUCapsInitCPU (arch=VIR_ARCH_ARMV7L, caps=0x70c29a08) at qemu/qemu_capabilities.c:867
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      66ec11ad
    • D
      Stop free'ing 'const char *' strings · bbcdd9b5
      Daniel P. Berrange 提交于
      The VIR_FREE() macro will cast away any const-ness. This masked a
      number of places where we passed a 'const char *' string to
      VIR_FREE. Fortunately in all of these cases, the variable was not
      in fact const data, but a heap allocated string. Fix all the
      variable declarations to reflect this.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      bbcdd9b5
    • E
      qemu: simplify list cleanup · 41b55056
      Eric Blake 提交于
      No need to open code now that we have a nice function.
      
      Interestingly, our virStringFreeList function is typed correctly
      (a malloc'd list of malloc'd strings is NOT const, whether at the
      point where it is created, or at the point where it is cleand up),
      so using it with a 'const char **' argument would require a cast
      to keep the compiler.  I chose instead to remove const from code
      even where we don't modify the argument, just to avoid the need
      to cast.
      
      * src/qemu/qemu_command.h (qemuParseCommandLine): Drop declaration.
      * src/qemu/qemu_command.c (qemuParseProcFileStrings)
      (qemuStringToArgvEnv): Don't force malloc'd result to be const.
      (qemuParseCommandLinePid, qemuParseCommandLineString): Simplify
      cleanup.
      (qemuParseCommandLine, qemuFindEnv): Drop const-correctness to
      avoid the need to cast in callers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      41b55056
    • P
      conf: Don't deref NULL actual network in virDomainNetGetActualHostdev() · a3d24862
      Peter Krempa 提交于
      In commit 991270db I've used virDomainNetGetActualHostdev() to get
      the actual hostdev from a network when removing the network from the
      list to avoid leaving the hostdev in the list. I didn't notice that this
      function doesn't check if the actual network is allocated and
      dereferences it. This crashes the daemon when cleaning up a domain
      object in early startup phases when the actual network definition isn't
      allocated. When the actual definition isn't present, the hostdev that
      might correspond to it won't be present anyways so it's safe to return
      NULL.
      
      Thanks to Cole Robinson for noticing this problem.
      a3d24862
    • J
      libxl: Unconditionally call virSysinfoRead() on driver init · b78e8cb2
      Jim Fehlig 提交于
      No need to check if privileged when reading hostsysinfo, since
      that check was already done in libxlDriverShouldLoad().  The
      libxl driver fails to load if not privileged.
      b78e8cb2
    • J
      libxl: Check for regcomp failure · 3fed82da
      Jim Fehlig 提交于
      Change libxlGetAutoballoonConf() function to return an int
      for success/failure, and fail if regcomp fails.
      3fed82da
    • E
      virsh: fix build on mingw, which lacks termios stuff · 7e1cbd14
      Eric Blake 提交于
      Recent patches to fix handling of Ctrl-C when interacting with
      ssh are not portable to mingw, which lacks termios handling.
      The simplest solution is to just compile that code out, and
      if someone ever appears that has a serious interest in getting
      virsh fully functional even with ssh connections, they can
      provide patches at that time.
      
      * tools/virsh.h (_vshControl): Make termattr conditional.
      * tools/virsh.c (vshTTYIsInterruptCharacter)
      (vshTTYDisableInterrupt, vshTTYRestore, cfmakeraw, vshTTYMakeRaw)
      (main): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7e1cbd14
    • J
      libxl: Fix Coverity warning · 5236aed8
      Jim Fehlig 提交于
      John Ferlan reported the following Coverity warning:
      
      In libxlDomainCoreDump() Coverity has noted a FORWARD_NULL reference:
      
      2004 	    if ((flags & VIR_DUMP_CRASH) && !vm->persistent) {
      2005 	        virDomainObjListRemove(driver->domains, vm);
      
      (20) Event assign_zero: 	Assigning: "vm" = "NULL".
      Also see events: 	[var_deref_model]
      
      2006 	        vm = NULL;
      2007 	    }
      2008
      2009 	    ret = 0;
      2010
      2011 	cleanup_unpause:
      
      (21) Event var_deref_model: 	Passing null pointer "vm" to function
           "virDomainObjIsActive(virDomainObjPtr)", which dereferences it. [details]
      Also see events: 	[assign_zero]
      
      2012 	    if (virDomainObjIsActive(vm) && paused) {
      2013 	        if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
      2014 	            virReportError(VIR_ERR_INTERNAL_ERROR,
      
      Removing the vm from domain obj list and setting it to NULL can be
      done in the previous 'if (flags & VIR_DUMP_CRASH)' conditional.  Fix
      the Coverity warning by ensuring vm is not NULL before testing if it
      is still active.
      5236aed8
    • E
      spec: default vbox according to libvirtd build · c021f5ce
      Eric Blake 提交于
      Commit ba5f3c7c moved virtualBox support into libvirtd, but the spec
      file was still unconditionally requesting it even when not building
      the server side.  Thankfully there were no ill effects for a
      client_only build, as most uses of %{with_vbox} were guarded by
      %{with_libvirtd}; but we might as well avoid confusion by more
      closely matching the makefile.
      
      * libvirt.spec.in (with_vbox): Hoist to server conditionals.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c021f5ce
    • E
      build: avoid stranded polkit file in client-only build · bf3d9811
      Eric Blake 提交于
      daemon/Makefile.am installs a .policy file if WITH_LIBVIRTD and
      WITH_POLKIT are both set.  src/Makefile.am, on the other hand,
      installs a .policy file if WITH_POLKIT1 is set, but without checking
      WITH_LIBVIRTD.  When running 'make rpm' with client_only manually
      set, on a Fedora 19 box, that leads to a failure:
      
      RPM build errors:
          Installed (but unpackaged) file(s) found:
         /usr/share/polkit-1/actions/org.libvirt.api.policy
      
      Fix it by adding another conditional.
      
      * src/Makefile.am (polkitaction_DATA): Make conditional.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bf3d9811
    • E
      build: only install nwfilter examples when building nwfilter · b420df72
      Eric Blake 提交于
      'make rpm' with client_local set to 1 (by manual modification,
      or with RHEL 5 on s390) warns:
      
      RPM build errors:
          Installed (but unpackaged) file(s) found:
         /etc/libvirt/nwfilter/allow-arp.xml
         /etc/libvirt/nwfilter/allow-dhcp-server.xml
         /etc/libvirt/nwfilter/allow-dhcp.xml
         /etc/libvirt/nwfilter/allow-incoming-ipv4.xml
         /etc/libvirt/nwfilter/allow-ipv4.xml
         /etc/libvirt/nwfilter/clean-traffic.xml
         /etc/libvirt/nwfilter/no-arp-ip-spoofing.xml
         /etc/libvirt/nwfilter/no-arp-mac-spoofing.xml
         /etc/libvirt/nwfilter/no-arp-spoofing.xml
         /etc/libvirt/nwfilter/no-ip-multicast.xml
         /etc/libvirt/nwfilter/no-ip-spoofing.xml
         /etc/libvirt/nwfilter/no-mac-broadcast.xml
         /etc/libvirt/nwfilter/no-mac-spoofing.xml
         /etc/libvirt/nwfilter/no-other-l2-traffic.xml
         /etc/libvirt/nwfilter/no-other-rarp-traffic.xml
         /etc/libvirt/nwfilter/qemu-announce-self-rarp.xml
         /etc/libvirt/nwfilter/qemu-announce-self.xml
         /usr/share/polkit-1/actions/org.libvirt.api.policy
      
      The bulk of these are fixed with this patch.
      
      * examples/xml/nwfilter/Makefile.am (install-data-local)
      (uninstall-local): Make conditional.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b420df72
    • E
      build: only run fdstreamtest when libvirtd is built · adf335f0
      Eric Blake 提交于
      An rpm build with client_only set to 1 (for example, RHEL 5 on
      s390, or by modifying libvirt.spec.in) failed with
      
      TEST: fdstreamtest
       1) Stream read blocking                                              ... OK
       2) Stream read non-blocking                                          ... Unexpected EOF block 0 want 128
      FAILED
       3) Stream write blocking                                             ... OK
       4) Stream write non-blocking                                         ... Failed to finish stream: internal error: libvirt:  error : cannot execute binary /home/eblake/rpmbuild/BUILD/libvirt-1.1.1/tests/../src/libvirt_iohelper: No such file or directory
      
      Since the test depends on something that was only built for
      WITH_LIBVIRTD (see src/Makefile.am), we must do the same for
      the test.
      
      * tests/Makefile.am (test_programs): Make fdstreamtest conditional.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      adf335f0
    • E
      spec: fix rpm build when lxc disabled · d42906fd
      Eric Blake 提交于
      'make rpm' failed if ~/.rpmmacros contains '%_without_lxc 1',
      which simulates the case of not having lxc available.
      
      RPM build errors:
          File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/etc/libvirt/virt-login-shell.conf
          File not found by glob: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/share/man/man1/virt-login-shell.1*
          File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/bin/virt-login-shell
      make: *** [rpm] Error 1
      
      Reported by Dan Berrange.
      
      * libvirt.spec.in: Mark virt-login-shell as conditional on lxc.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d42906fd
    • D
      virGet{User,Group}Ent() don't say success on fail · 4c7d1eab
      Doug Goldstein 提交于
      When virGetUserEnt() and virGetGroupEnt() fail due to the uid or gid not
      existing on the machine they'll print a message like:
      
      $ virsh -c vbox:///session list
      error: failed to connect to the hypervisor
      error: Failed to find user record for uid '32655': Success
      
      The success at the end is a bit confusing. This changes it to:
      
      $ virsh -c vbox:///session list
      error: failed to connect to the hypervisor
      error: Failed to find user record for uid '32655'
      4c7d1eab
  2. 04 9月, 2013 18 次提交