1. 07 5月, 2012 3 次提交
    • C
      f4345ac2
    • C
      0cb72f25
    • J
      qemu: Emit compatible XML when migrating a domain · 409b5f54
      Jiri Denemark 提交于
      When we added the default USB controller into domain XML, we efficiently
      broke migration to older versions of libvirt that didn't support USB
      controllers at all (0.9.4 and earlier) even for domains that don't use
      anything that the older libvirt can't provide. We still want to present
      the default USB controller in any XML seen by a user/app but we can
      safely remove it from the domain XML used during migration. If we are
      migrating to a new enough libvirt, it will add the controller XML back,
      while older libvirt won't be confused with it although it will still
      tell qemu to create the controller.
      
      Similar approach can be used in the future whenever we find out we
      always enabled some kind of device without properly advertising it in
      domain XML.
      409b5f54
  2. 05 5月, 2012 6 次提交
    • J
      qemu: Don't use virDomainDefFormat* directly · cd603008
      Jiri Denemark 提交于
      Always use appropriate qemuDomain{,Def}Format wrapper since it may do
      some additional magic based on the flags.
      cd603008
    • E
      qemu: reject blockiotune if qemu too old · 13f9a193
      Eric Blake 提交于
      Commit 4c82f09e added a capability check for qemu per-device io
      throttling, but only applied it to domain startup.  As mentioned
      in the previous commit (98cec052), the user can still get an 'internal
      error' message during a hotplug attempt, when the monitor command
      doesn't exist.  It is confusing to allow tuning on inactive domains
      only to then be rejected when starting the domain.
      
      * src/qemu/qemu_driver.c (qemuDomainSetBlockIoTune): Reject
      offline tuning if online can't match it.
      13f9a193
    • E
      qemu: don't modify domain on failed blockiotune · 98cec052
      Eric Blake 提交于
      If you have a qemu build that lacks the blockio tune monitor command,
      then this command:
      
      $ virsh blkdeviotune rhel6u2 hda --total_bytes_sec 1000
      error: Unable to change block I/O throttle
      error: internal error Unexpected error
      
      fails as expected (well, the error message is lousy), but the next
      dumpxml shows that the domain was modified anyway.  Worse, that means
      if you save the domain then restore it, the restore will likely fail
      due to throttling being unsupported, even though no throttling should
      even be active because the monitor command failed in the first place.
      
      * src/qemu/qemu_driver.c (qemuDomainSetBlockIoTune): Check for
      error before making modification permanent.
      98cec052
    • L
      util: remove error log from stubs of virNetlinkEventServiceStart|Stop · bae4ff28
      Laine Stump 提交于
      These two functions are called from main() on all platforms, and
      always return success on platforms that don't support libnl. They
      still log an error message, though, which doesn't make sense - they
      should just be NOPs on those platforms. (Per a suggestion during
      review, I've turned the logs into debug messages rather than removing
      them completely).
      bae4ff28
    • S
      node_device: fix possible non-terminated string · 43d1616f
      Stefan Berger 提交于
      Error: STRING_NULL:
      /libvirt/src/node_device/node_device_linux_sysfs.c:80:
      string_null_argument: Function "saferead" does not terminate string "*buf".
      /libvirt/src/util/util.c:101:
      string_null_argument: Function "read" fills array "*buf" with a non-terminated string.
      /libvirt/src/node_device/node_device_linux_sysfs.c:87:
      string_null: Passing unterminated string "buf" to a function expecting a null-terminated string.
      43d1616f
    • S
      uuid: fix possible non-terminated string · b4586051
      Stefan Berger 提交于
      Error: STRING_NULL:
      /libvirt/src/util/uuid.c:273:
      string_null_argument: Function "getDMISystemUUID" does not terminate string "*dmiuuid".
      /libvirt/src/util/uuid.c:241:
      string_null_argument: Function "saferead" fills array "*uuid" with a non-terminated string.
      /libvirt/src/util/util.c:101:
      string_null_argument: Function "read" fills array "*buf" with a non-terminated string.
      /libvirt/src/util/uuid.c:274:
      string_null: Passing unterminated string "dmiuuid" to a function expecting a null-terminated string.
      /libvirt/src/util/uuid.c:138:
      var_assign_parm: Assigning: "cur" = "uuidstr". They now point to the same thing.
      /libvirt/src/util/uuid.c:164:
      string_null_sink_loop: Searching for null termination in an unterminated array "cur".
      b4586051
  3. 04 5月, 2012 13 次提交
    • S
      tests: fix resource leak · a01e6721
      Stefan Berger 提交于
      Error: RESOURCE_LEAK:
      /libvirt/tests/qemuxml2argvtest.c:47:
      alloc_arg: Calling allocation function "virAlloc" on "ret".
      /libvirt/src/util/memory.c:101:
      alloc_fn: Storage is returned from allocation function "calloc".
      /libvirt/src/util/memory.c:101:
      var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
      /libvirt/tests/qemuxml2argvtest.c:54:
      leaked_storage: Variable "ret" going out of scope leaks the storage it points to.
      a01e6721
    • S
      qemu: fix resource leak · c0774482
      Stefan Berger 提交于
      Error: RESOURCE_LEAK:
      /libvirt/src/qemu/qemu_driver.c:6968:
      alloc_fn: Calling allocation function "calloc".
      /libvirt/src/qemu/qemu_driver.c:6968:
      var_assign: Assigning: "nodeset" =  storage returned from "calloc(1UL, 1UL)".
      /libvirt/src/qemu/qemu_driver.c:6977:
      noescape: Variable "nodeset" is not freed or pointed-to in function "virTypedParameterAssign".
      /libvirt/src/qemu/qemu_driver.c:6997:
      leaked_storage: Variable "nodeset" going out of scope leaks the storage it points to.
      c0774482
    • S
      vmx: fix resource leak · 409a637e
      Stefan Berger 提交于
      Error: RESOURCE_LEAK:
      /libvirt/src/vmx/vmx.c:2431:
      alloc_fn: Calling allocation function "calloc".
      /libvirt/src/vmx/vmx.c:2431:
      var_assign: Assigning: "networkName" =  storage returned from "calloc(1UL, 1UL)".
      /libvirt/src/vmx/vmx.c:2495:
      leaked_storage: Variable "networkName" going out of scope leaks the storage it points to.
      409a637e
    • G
      1cbe658b
    • O
      Coverity: Fix resource leak in virnetlink.c · fd2b4157
      Osier Yang 提交于
      fd2b4157
    • O
      Coverity: Fix resource leak in nodeinfo.c · 739cfc31
      Osier Yang 提交于
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/nodeinfo.c:629: alloc_fn: Calling allocation function "fopen".
      /builddir/build/BUILD/libvirt-0.9.10/src/nodeinfo.c:629: var_assign: Assigning: "cpuinfo" =  storage returned from "fopen("/proc/cpuinfo", "r")".
      /builddir/build/BUILD/libvirt-0.9.10/src/nodeinfo.c:638: leaked_storage: Variable "cpuinfo" going out of scope leaks the storage it points to.
      739cfc31
    • O
      Coverity: Fix resource leak in test driver · ad4d4ad0
      Osier Yang 提交于
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/test/test_driver.c:1041: alloc_arg: Calling allocation function "virXPathNodeSet" on "devs".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/xml.c:621: alloc_arg: "virAllocN" allocates memory that is stored into "*list".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:129: alloc_fn: Storage is returned from allocation function "calloc".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:129: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(count, size)".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/xml.c:625: noescape: Variable "*list" is not freed or pointed-to in function "memcpy".
      /builddir/build/BUILD/libvirt-0.9.10/src/test/test_driver.c:1098: leaked_storage: Variable "devs" going out of scope leaks the storage it points to.
      ad4d4ad0
    • O
      Coverity: Fix resource leak in xen driver · e91e0ab6
      Osier Yang 提交于
      Coverity logs:
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:103: alloc_fn: Calling allocation function "xenDaemonLookupByUUID".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2534: alloc_fn: Storage is returned from allocation function "virGetDomain".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:191: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:210: return_alloc: Returning allocated memory "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2534: var_assign: Assigning: "ret" = "virGetDomain(conn, name, uuid)".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2541: return_alloc: Returning allocated memory "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:103: var_assign: Assigning: "dom" =  storage returned from "xenDaemonLookupByUUID(conn, rawuuid)".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:126: leaked_storage: Variable "dom" going out of scope leaks the storage it points to.
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2742: alloc_fn: Calling allocation function "fopen".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2742: var_assign: Assigning: "cpuinfo" =  storage returned from "fopen("/proc/cpuinfo", "r")".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2763: noescape: Variable "cpuinfo" is not freed or pointed-to in function "xenHypervisorMakeCapabilitiesInternal".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2574:45: noescape: "xenHypervisorMakeCapabilitiesInternal" does not free or save its pointer parameter "cpuinfo".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2768: leaked_storage: Variable "cpuinfo" going out of scope leaks the storage it points to.
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2752: alloc_fn: Calling allocation function "fopen".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2752: var_assign: Assigning: "capabilities" =  storage returned from "fopen("/sys/hypervisor/properties/capabilities", "r")".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2763: noescape: Variable "capabilities" is not freed or pointed-to in function "xenHypervisorMakeCapabilitiesInternal".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2574:60: noescape: "xenHypervisorMakeCapabilitiesInternal" does not free or save its pointer parameter "capabilities".
      /builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2768: leaked_storage: Variable "capabilities" going out of scope leaks the storage it points to.
      e91e0ab6
    • O
      Coverity: Fix resource leaks in phyp driver · cff0d342
      Osier Yang 提交于
      Coverity logs:
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:523: alloc_fn: Calling allocation function "fopen".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:523: var_assign: Assigning: "fd" =  storage returned from "fopen(local_file, "rb")".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:540: noescape: Variable "fd" is not freed or pointed-to in function "fread".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:542: noescape: Variable "fd" is not freed or pointed-to in function "feof".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:575: leaked_storage: Variable "fd" going out of scope leaks the storage it points to.
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:585: leaked_storage: Variable "fd" going out of scope leaks the storage it points to.
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2088: alloc_fn: Calling allocation function "phypVolumeLookupByName".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2026: alloc_fn: Storage is returned from allocation function "virGetStorageVol".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:724: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:753: return_alloc: Returning allocated memory "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2026: var_assign: Assigning: "vol" = "virGetStorageVol(pool->conn, pool->name, volname, key)".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2030: return_alloc: Returning allocated memory "vol".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2088: leaked_storage: Failing to save storage allocated by "phypVolumeLookupByName(pool, voldef->name)" leaks it.
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2725: alloc_fn: Calling allocation function "phypGetStoragePoolLookUpByUUID".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2689: alloc_fn: Storage is returned from allocation function "virGetStoragePool".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:592: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:610: return_alloc: Returning allocated memory "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2689: var_assign: Assigning: "sp" = "virGetStoragePool(conn, pools[i], uuid)".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2694: return_alloc: Returning allocated memory "sp".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2725: leaked_storage: Failing to save storage allocated by "phypGetStoragePoolLookUpByUUID(conn, def->uuid)" leaks it.
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2719: alloc_fn: Calling allocation function "phypStoragePoolLookupByName".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2254: alloc_fn: Storage is returned from allocation function "virGetStoragePool".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:592: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:610: return_alloc: Returning allocated memory "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2254: return_alloc_fn: Directly returning storage allocated by "virGetStoragePool".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2719: leaked_storage: Failing to save storage allocated by "phypStoragePoolLookupByName(conn, def->name)" leaks it.
      
      Error: RESOURCE_LEAK:
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2270: alloc_fn: Calling allocation function "phypStoragePoolLookupByName".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2254: alloc_fn: Storage is returned from allocation function "virGetStoragePool".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:592: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
      /builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
      /builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:610: return_alloc: Returning allocated memory "ret".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2254: return_alloc_fn: Directly returning storage allocated by "virGetStoragePool".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2270: var_assign: Assigning: "sp" =  storage returned from "phypStoragePoolLookupByName(vol->conn, vol->pool)".
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2324: leaked_storage: Variable "sp" going out of scope leaks the storage it points to.
      /builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2327: leaked_storage: Variable "sp" going out of scope leaks the storage it points t
      cff0d342
    • O
      Coverity: Fix the forward_null error in Python binding codes · b80f4db9
      Osier Yang 提交于
      Related coverity log:
      
      Error: FORWARD_NULL:
      /builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:355:
      assign_zero: Assigning: "params" = 0.
      /builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:458:
      var_deref_model: Passing null variable "params" to function
      "getPyVirTypedParameter", which dereferences it. (The dereference is assumed on
      the basis of the 'nonnull' parameter attribute.)
      b80f4db9
    • E
      qemu: avoid 32-bit compiler warning · cdce2f42
      Eric Blake 提交于
      On 32-bit platforms, gcc warns that the comparison between a long
      and (ULLONG_MAX/1024/1024) is always false; throwing in a type
      conversion shuts up the warning.
      
      * src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Shut gcc up.
      cdce2f42
    • S
      build: support libnl-3 · 60fb8a22
      Serge Hallyn 提交于
      configure.ac: check for libnl-3 in addition to libnl-1
      
      src/Makefile.am: link against libnl when needed
      
      src/util/virnetlink.c:
      support libnl3 api.  To minimize impact on code flow, wrap the
      differences under the virNetlink* namespace.
      
      Unfortunately libnl3 moves netlink/msg.h to
      /usr/include/libnl3/netlink/msg.h, so the LIBNL_CFLAGS need to be added
      to a bunch of places where they weren't needed with libnl1.
      Signed-off-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      60fb8a22
    • E
      build: fix build on cygwin · c8982638
      Eric Blake 提交于
      On cygwin, <rpc/rpc.h> lives in a different directory than
      /usr/include, so anything that uses it must modify CFLAGS.  This
      previously tripped up just 'make check', but now that we build
      all test programs unconditionally, it also trips up 'make'.
      
      * tests/Makefile.am (virnetmessagetest_CFLAGS): Find rpc headers.
      c8982638
  4. 03 5月, 2012 5 次提交
  5. 02 5月, 2012 3 次提交
    • E
      virsh: output scaled values with correct units · 706aa7c5
      Eric Blake 提交于
      The recent push to use correct scaling terms (kB for 1000, KiB for
      1024 - such as commit 9dfdeadc) missed some places in virsh.
      
      * tools/virsh.c (prettyCapacity, cmdDominfo, cmdFreecell)
      (cmdNodeinfo, cmdNodeMemStats, cmdMigrateSetMaxSpeed)
      (cmdBlockCopy, cmdBlockPull, cmdBlockJob): Use KiB, not kB, when
      referring to multiples of 1024.
      * tests/virshtest.c: Update expected output to match.
      706aa7c5
    • E
      virsh: make -h always give help · 46e5d36b
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=817244 mentions that
      unlike most other tools, where --help or --version prevent all
      further parsing of all later options, virsh was strange in that
      --version stopped parsing but --help tried to plow on to the end.
      There was no rationale for this original implementation (since
      2005!), so I think we can safely conform to common usage patterns.
      
      * tools/virsh.c (main): Drop useless 'help' variable.
      46e5d36b
    • L
      build: make ATTRIBUTE_NONNULL() a NOP unless STATIC_ANALYSIS is on · eefb881d
      Laine Stump 提交于
      The ATTRIBUTE_NONNULL(m) macro normally resolves to the gcc builtin
      __attribute__((__nonnull__(m))). The effect of this in gcc is
      unfortunately only to make gcc believe that "m" can never possibly be
      NULL, *not* to add in any checks to guarantee that it isn't ever NULL
      (i.e. it is an optimization aid, *not* something to verify code
      correctness.) - see the following gcc bug report for more details:
      
        http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308
      
      Static source analyzers such as clang and coverity apparently can use
      ATTRIBUTE_NONNULL(), though, to detect dead code (in the case that the
      arg really is guaranteed non-NULL), as well as situations where an
      obviously NULL arg is given to the function.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=815270 is a good example
      of a bug caused by erroneous application of ATTRIBUTE_NONNULL().
      Several people spent a long time staring at this code and not finding
      the problem, because the problem wasn't in the function itself, but in
      the prototype that specified ATTRIBUTE_NONNULL() for an arg that
      actually *wasn't* always non-NULL, and caused a segv when dereferenced
      (even though the code that dereferenced the pointer was inside an if()
      that checked for a NULL pointer, that code was optimized out by gcc).
      
      There may be some very small gain to be had from the optimizations
      that can be inferred from ATTRIBUTE_NONNULL(), but it seems safer to
      err on the side of generating code that behaves as expected, while
      turning on the attribute for static analyzers.
      eefb881d
  6. 01 5月, 2012 9 次提交
    • D
      Make lxcContainerSetStdio the last thing to be called in container startup · 07cf96ec
      Daniel P. Berrange 提交于
      Once lxcContainerSetStdio is invoked, logging will not work as
      expected in libvirt_lxc. So make sure this is the last thing to
      be called, in particular after setting the security process label
      07cf96ec
    • D
      Ensure logging is initialized early in libvirt_lxc · 43ee9873
      Daniel P. Berrange 提交于
      The virLogSetFromEnv call was done too late in startup to
      catch many log messages (eg from security driver initialization).
      To assist debugging also explicitly log the security details
      at startup
      43ee9873
    • D
      Ensure LXC security driver is set unconditonally · 3746b070
      Daniel P. Berrange 提交于
      The driver->securityDriverName field may be NULL, if automatic
      probing is used to determine security driver. This meant that
      unless selinux was explicitly requested in lxc.conf, it was
      not being sent to the libvirt_lxc process.
      
      The driver->securityManager field is guaranteed non-NULL, since
      there will always be the 'none' security driver present if
      nothing else exists. So use that to set the driver name for
      libvirt_lxc
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3746b070
    • D
      Ensure libvirt_lxc process loads the live XML config · eb06375a
      Daniel P. Berrange 提交于
      Currently the libvirt_lxc process uses VIR_DOMAIN_XML_INACTIVE
      when loading the XML for the container. This means it loses
      any dynamic data such as the, just allocated, SELinux label.
      
      Further there is an inconsistency in the libvirt LXC driver
      whereby it saves the live config XML and then later overwrites
      the file with the live status XML instead. Add a comment about
      this for future reference.
      
      * src/lxc/lxc_controller.c: Remove VIR_DOMAIN_XML_INACTIVE
        when loading XML
      * src/lxc/lxc_driver.c: Add comment about inconsistent
        config file formats
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      eb06375a
    • E
      maint: avoid false positives on unmarked diagnostics · 8f3728f8
      Eric Blake 提交于
      Otherwise, a string such as _("Don't use \"" VAR "\".") would
      complain about unmarked diagnostics.
      
      * cfg.mk (sc_libvirt_unmarked_diagnostics): Handle \" in message.
      8f3728f8
    • J
      b57e0153
    • J
      qemu: change rbd auth_supported separation character to ; · d50cae33
      Josh Durgin 提交于
      This works with newer qemu that doesn't allow escaping spaces.
      It's backwards compatible as well.
      Signed-off-by: NJosh Durgin <josh.durgin@dreamhost.com>
      d50cae33
    • A
      util: Avoid libvirtd crash in virNetDevTapCreate · 5ee18aaa
      Alex Jia 提交于
      In fact, the 'tapfd' is always NULL, the function 'virNetDevTapCreate()' hasn't
      assign 'fd' to 'tapfd', when the function 'virNetDevSetMAC()' is failed then
      goto 'error' label, finally, the VIR_FORCE_CLOSE() will deref a NULL 'tapfd'.
      
      * util/virnetdevtap.c (virNetDevTapCreateInBridgePort): fix a NULL pointer derefing.
      
      * How to reproduce?
      
      $ cat > /tmp/net.xml <<EOF
      <network>
        <name>test</name>
        <forward mode='nat'/>
        <bridge name='br1' stp='off' delay='1' />
        <mac address='00:00:00:00:00:00'/>
        <ip address='192.168.100.1' netmask='255.255.255.0'>
          <dhcp>
            <range start='192.168.100.2' end='192.168.100.254' />
          </dhcp>
        </ip>
      </network>
      EOF
      
      $ virsh net-define /tmp/net.xml
      
      $ virsh net-start test
      error: Failed to start network brTest
      error: End of file while reading data: Input/output error
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      5ee18aaa
    • E
      storage: fix build with iscsi · 29e702e5
      Eric Blake 提交于
      The previous storage patch missed an instance affected by the struct
      member rename.  It also had some botched whitespace detected by
      'make check'.
      
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Adjust to new struct.
      * src/conf/storage_conf.c (virStoragePoolSourceFormat): Fix
      indentation.
      29e702e5
  7. 30 4月, 2012 1 次提交