1. 10 9月, 2013 4 次提交
    • E
      tests: check remaining .x files · e561951d
      Eric Blake 提交于
      We have been adding new .x files without keeping the list of
      *-structs files up-to-date.  This adds the support for the
      recent additions.
      
      In the process of testing this, I also noticed that Fedora 19's
      use of dwarves-1.10 (providing pdwtags version 1.9) was producing
      a single line on stderr but still giving enough useful info on
      stdout that we could check structs; the real goal of checking
      stderr separately from stdout was to avoid the bug in dwarves-1.9
      where stdout was empty (see bug http://bugzilla.redhat.com/772358).
      
      * src/Makefile.am (struct_prefix, PROTOCOL_STRUCTS): Add missing
      struct tests.
      (PDWTAGS): Work with Fedora 19 pdwtags.
      (lxc_monitor_protocol-struct, lock_protocol-struct): New rules.
      * src/lxc_monitor_protocol-structs: New file.
      * src/lock_protocol-structs): Likewise.
      * cfg.mk (generated_files): Enlarge list.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e561951d
    • E
      build: use library rather than cross-directory compilation · 012c25e8
      Eric Blake 提交于
      If we use subdir-objects with automake, any reference to a
      cross-directory .c file will result in automake creating
      rules that track dependency in the cross directory.  But this
      presents a problem during 'make distclean' - if the cross
      directory is cleaned up first, then the daemon directory will
      be left with dangling references to .Po dependency files that
      no longer exist.
      
      Meanwhile, referring to the cross-directory .c file means
      that we are compiling the file twice - once in src, and once
      in daemon.  Better is to compile just once in src into a
      convenience library, and then use that library from daemon.
      
      The tests directory had a similar situation of a cross-directory
      .c file; to solve that, we actually need a convenience library.
      
      * daemon/Makefile.am (DAEMON_SOURCES): Drop .c files...
      (libvirtd_LDADD): ...and instead use library.
      (libvirtd_conf_la_SOURCES): Declare a new convenience library.
      (libvirtd_LDFLAGS): Drop duplicate flag.
      * tests/Makefile.am (libvirtdconftest_SOURCES): Drop .c file...
      (libvirtdconftest_LDADD): ..and instead use library.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      012c25e8
    • E
      build: avoid $(srcdir) in *_SOURCES · 073e1575
      Eric Blake 提交于
      Trying to enable automake's subdir-objects option resulted in
      the creation of literal directories such as src/$(srcdir)/remote/.
      I traced this to the fact that we had used a literal $(srcdir)
      in a location that later fed an automake *_SOURCES variable.
      This has also been reported as an automake bug:
      http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928
      but it's better to fix our code than to wait for an automake fix.
      
      Some things to remember that affect VPATH builds, and where an
      in-tree build is blissfully unaware of the issues: if a VPATH
      build fails to find a file that was used as a prereq of any
      other target, then the rule for that file will expand $@ to
      prefer the current build dir (bad because a VPATH build on a
      fresh checkout will then stick $@ in the current directory
      instead of the desired srcdir); conversely, if a VPATH build
      finds the file in srcdir but decides it needs to be rebuilt,
      then the rule for that file will expand $@ to include the
      directory where it was found out-of-date (bad for an explicit
      listing of $(srcdir)/$@ because an incremental VPATH build will
      then expand srcdir twice).  As we want these files to go into
      srcdir unconditionally, we have to massage or avoid $@ for any
      recipe that involves one of these files.
      
      Therefore, this patch removes all uses of $(srcdir) from any
      generated file name that later feeds a *_SOURCES variable, and
      then rewrites all the recipes to generate those files to
      hard-code their creation into srcdir without the use of $@.
      
      * src/Makefile.am (REMOTE_DRIVER_GENERATED): Drop $(srcdir); VPATH
      builds know how to find the files, and automake subdir-objects
      fails with it in place.
      (LXC_MONITOR_PROTOCOL_GENERATED, (LXC_MONITOR_GENERATED)
      (ACCESS_DRIVER_GENERATED, LOCK_PROTOCOL_GENERATED): Likewise.
      (*_client_bodies.h): Hard-code rules to write into srcdir, as
      VPATH tries to build $@ locally if missing.
      (util/virkeymaps.h): Likewise.
      (lxc/lxc_monitor_dispatch.h): Likewise.
      (access/viraccessapi*): Likewise.
      (locking/lock_daemon_dispatch_stubs.h): Likewise.
      * daemon/Makeflie.am (DAEMON_GENERATED, remote_dispatch.h):
      Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      
      fixup DAEMON_GENERATED
      073e1575
    • L
      cpu: Cleanup ppcCompute to avoid memory leak · 76fb8ccd
      Li Zhang 提交于
      This patch is to Cleanup ppcCompute to avoid memory leak to make
      the code better.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      76fb8ccd
  2. 09 9月, 2013 4 次提交
    • E
      qemu: don't leak vm on failure · d047b2d9
      Eric Blake 提交于
      Failure to attach to a domain during 'virsh qemu-attach' left
      the list of domains in an odd state:
      
      $ virsh qemu-attach 4176
      error: An error occurred, but the cause is unknown
      
      $ virsh list --all
       Id    Name                           State
      ----------------------------------------------------
       2     foo                            shut off
      
      $ virsh qemu-attach 4176
      error: Requested operation is not valid: domain is already active as 'foo'
      
      $ virsh undefine foo
      error: Failed to undefine domain foo
      error: Requested operation is not valid: cannot undefine transient domain
      
      $ virsh shutdown foo
      error: Failed to shutdown domain foo
      error: invalid argument: monitor must not be NULL
      
      It all stems from leaving the list of domains unmodified on
      the initial failure; we should follow the lead of createXML
      which removes vm on failure (the actual initial failure still
      needs to be fixed in a later patch, but at least this patch
      gets us to the point where we aren't getting stuck with an
      unremovable "shut off" transient domain).
      
      While investigating, I also found a leak in qemuDomainCreateXML;
      the two functions should behave similarly.  Note that there are
      still two unusual paths: if dom is not allocated, the user will
      see an OOM error even though the vm remains registered (but oom
      errors already indicate tricky cleanup); and if the vm starts
      and then quits again all before the job ends, it is possible
      to return a non-NULL dom even though the dom will no longer be
      useful for anything (but this at least lets the user know their
      short-lived vm ran).
      
      * src/qemu/qemu_driver.c (qemuDomainCreateXML): Don't leak vm on
      failure to obtain job.
      (qemuDomainQemuAttach): Match cleanup of qemuDomainCreateXML.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d047b2d9
    • Y
      Add ARM v7 big-endian architecture (armv7b) · ea3534fc
      Yogesh Tillu 提交于
      ARM v7 can operate in either little or big endian modes. Add
      support for the big-endian version known as armv7b from uname.
      Signed-off-by: NYogesh Tillu <tillu.yogesh@gmail.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ea3534fc
    • L
      qemu: avoid users specifying CPU features for non-x86 plaftorm. · 7b0ce42c
      Li Zhang 提交于
      Currently, only X86 provides users CPU features with CPUID instruction.
      If users specify the features for non-x86, it should tell users to
      remove them.
      
      This patch is to report one error if features are specified by
      users for non-x86 platform.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      7b0ce42c
    • H
      LXC: Free variable vroot in lxcDomainDetachDeviceHostdevUSBLive() · 46c9bce4
      Hongwei Bi 提交于
      The variable vroot should be freed in label cleanup.
      46c9bce4
  3. 07 9月, 2013 1 次提交
    • E
      qemu: don't leave shutdown inhibited on attach failure · 93e59975
      Eric Blake 提交于
      While debugging a failure of 'virsh qemu-attach', I noticed that
      we were leaking the count of active domains on failure.  This
      means that a libvirtd session that is supposed to quit after
      active domains disappear will hang around forever.
      
      * src/qemu/qemu_process.c (qemuProcessAttach): Undo count of
      active domains on failure.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      93e59975
  4. 06 9月, 2013 6 次提交
    • E
      qemu: recognize -machine accel=kvm when parsing native · 2b1ef11c
      Eric Blake 提交于
      In Fedora 19, 'qemu-kvm' is a simple wrapper that calls
      'qemu-system-x86_64 -machine accel=kvm'.  Attempting
      to use 'virsh qemu-attach $pid' to a machine started as:
      
      qemu-kvm -cdrom /var/lib/libvirt/images/foo.img \
       -monitor unix:/tmp/demo,server,nowait -name foo \
       --uuid cece4f9f-dff0-575d-0e8e-01fe380f12ea
      
      was failing with:
      error: XML error: No PCI buses available
      
      because we did not see 'kvm' in the executable name read from
      /proc/$pid/cmdline, and tried to assign os.machine as
      "accel=kvm" instead of "pc"; this in turn led to refusal to
      recognize the pci bus.
      
      Noticed while investigating https://bugzilla.redhat.com/995312
      although there are still other issues to fix before that bug
      will be completely solved.
      
      I've concluded that the existing parser code for native-to-xml
      is a horrendous hodge-podge of ad-hoc approaches; I basically
      rewrote the -machine section to be a bit saner.
      
      * src/qemu/qemu_command.c (qemuParseCommandLine): Don't assume
      -machine argument is always appropriate for os.machine; set
      virtType if accel is present.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2b1ef11c
    • E
      qemu: only parse basename when determining emulator properties · 6a373fb2
      Eric Blake 提交于
      'virsh domxml-from-native' and 'virsh qemu-attach' could misbehave
      for an emulator installed in (a somewhat unlikely) location
      such as /usr/local/qemu-1.6/qemu-system-x86_64 or (an even less
      likely) /opt/notxen/qemu-system-x86_64.  Limit the strstr seach
      to just the basename of the file where we are assuming details
      about the binary based on its name.
      
      While testing, I accidentally triggered a core dump during strcmp
      when I forgot to set os.type on one of my code paths; this patch
      changes such a coding error to raise a nicer internal error instead.
      
      * src/qemu/qemu_command.c (qemuParseCommandLine): Compute basename
      earlier.
      * src/conf/domain_conf.c (virDomainDefPostParseInternal): Avoid
      NULL deref.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6a373fb2
    • C
      LXC: fix typos in lxc_container.c · 744fb508
      Chen Hanxiao 提交于
      Fix docs and error message typos in lxc_container.c
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      744fb508
    • A
      Docs: fix a typo in virt-login-shell.pod · 55fbbd49
      Alex Jia 提交于
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      55fbbd49
    • J
      libxl: Compile regular expression where it is used · 4e0ba0bd
      Jim Fehlig 提交于
      The regular expression used to determine guest capabilities
      was compiled in libxlCapsInitHost() but used in libxlCapsInitGuests().
      Move compilation to libxlCapsInitGuests() where it is used, and free
      the compiled regex after use.  Ensure not to free the regex if
      compilation fails.
      4e0ba0bd
    • J
      Don't call regfree() if regcomp() fails · 88183768
      Jim Fehlig 提交于
      POSIX states that the preg parameter to regcomp() is undefined on
      failure, so no need to call regfree() in these cases.
      
      http://pubs.opengroup.org/onlinepubs/009695399/functions/regcomp.html
      
      See also a discussion on the libvirt dev list
      
      https://www.redhat.com/archives/libvir-list/2013-September/msg00262.html
      88183768
  5. 05 9月, 2013 25 次提交
    • E
      spec: make client-only testing easier · 12509c79
      Eric Blake 提交于
      Several recent patches cleaned up 'make rpm' for the situation
      when client_only is true; these were done by manual spec file
      editing (since it's relatively hard to come by a RHEL 5 s390
      box).  Make it easier to do in the future via a simpler command
      line override.
      
      * libvirt.spec.in (client_only): Allow for override.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      12509c79
    • E
      build: shut up automake warnings · 1ac24b3b
      Eric Blake 提交于
      I'm tired of seeing screenfuls of messages like these when using
      automake 1.13 (Fedora 19):
      
      configure.ac:2121: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
      configure.ac:2121: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
      configure.ac:2121: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
      daemon/Makefile.am:19: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
      
      seeing as how we MUST use those constructs for the benefit of
      automake 1.9 (RHEL 5).  Conversely, RHEL 5 automake complained:
      
      aclocal:configure.ac:36: warning: macro `AM_SILENT_RULES' not found in library
      
      Obviously, I tested this patch on both Fedora 19 and RHEL 5.
      
      * configure.ac (AM_INIT_AUTOMAKE): Avoid obsoletion warnings.
      (AM_SILENT_RULES): Avoid unknown macro warning.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1ac24b3b
    • J
      Fix a typo in network XML docs · 75ad8b67
      Ján Tomko 提交于
      75ad8b67
    • J
      Change 'shortforward' to bool. · 90e2d8d0
      Ján Tomko 提交于
      90e2d8d0
    • 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