1. 13 8月, 2012 20 次提交
    • T
      S390: Fixed Parser for /proc/cpuinfo needs to be adapted for your architecture · d838a6bc
      Thang Pham 提交于
      Minimal CPU "parser" for s390 to avoid compile time warning.
      Signed-off-by: NThang Pham <thang.pham@us.ibm.com>
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      (cherry picked from commit bf2e40fa)
      
      (crobinso: Add Thang to AUTHORS)
      d838a6bc
    • V
      S390: Override QEMU_CAPS_NO_ACPI for s390x · 2a6cfe8e
      Viktor Mihajlovski 提交于
      Starting a KVM guest on s390 fails immediately. This is because
      "qemu --help" reports -no-acpi even for the s390(x) architecture but
      -no-acpi isn't supported there.
      Workaround is to remove QEMU_CAPS_NO_ACPI from the capability set
      after the version/capability extraction.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      (cherry picked from commit 6a6c3471)
      
      (crobinso: add Viktor to AUTHORS)
      2a6cfe8e
    • O
      qemu: Improve error if setmem fails for lacking of balloon support · 9fc5b7da
      Osier Yang 提交于
      "cannot set memory of an active domain" is misleading, it sounds
      like setting memory of active domain is not supported.
      (cherry picked from commit 968b6c60)
      9fc5b7da
    • P
      virsh: Improve error when trying to change vm's cpu count 0 · cba21fd9
      Peter Krempa 提交于
      This patch adds a check for the count of processors the user requests
      for the guest machine so that invalid values produce a more helpful
      error message.
      (cherry picked from commit de924ca9)
      cba21fd9
    • J
      Initialize random generator in lxc controller · d020d73f
      Jim Fehlig 提交于
      The lxc contoller eventually makes use of virRandomBits(), which was
      segfaulting since virRandomInitialize() is never invoked.
      
      Program received signal SIGSEGV, Segmentation fault.
      0x00007ffff554d560 in random_r () from /lib64/libc.so.6
      (gdb) bt
      0  0x00007ffff554d560 in random_r () from /lib64/libc.so.6
      1  0x0000000000469eaa in virRandomBits (nbits=32) at util/virrandom.c:80
      2  0x000000000045bf69 in virHashCreateFull (size=256,
          dataFree=0x4aa2a2 <hashDataFree>, keyCode=0x45bd40 <virHashStrCode>,
          keyEqual=0x45bdad <virHashStrEqual>, keyCopy=0x45bdfa <virHashStrCopy>,
          keyFree=0x45be37 <virHashStrFree>) at util/virhash.c:134
      3  0x000000000045c069 in virHashCreate (size=0, dataFree=0x4aa2a2 <hashDataFree>)
          at util/virhash.c:164
      4  0x00000000004aa562 in virNWFilterHashTableCreate (n=0)
          at conf/nwfilter_params.c:686
      5  0x00000000004aa95b in virNWFilterParseParamAttributes (cur=0x711d30)
          at conf/nwfilter_params.c:793
      6  0x0000000000481a7f in virDomainNetDefParseXML (caps=0x702c90, node=0x7116b0,
          ctxt=0x7101b0, bootMap=0x0, flags=0) at conf/domain_conf.c:4589
      7  0x000000000048cc36 in virDomainDefParseXML (caps=0x702c90, xml=0x710040,
          root=0x7103b0, ctxt=0x7101b0, expectedVirtTypes=16, flags=0)
          at conf/domain_conf.c:8658
      8  0x000000000048f011 in virDomainDefParseNode (caps=0x702c90, xml=0x710040,
          root=0x7103b0, expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9360
      9  0x000000000048ee30 in virDomainDefParse (xmlStr=0x0,
          filename=0x702ae0 "/var/run/libvirt/lxc/x.xml", caps=0x702c90,
          expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9310
      10 0x000000000048ef00 in virDomainDefParseFile (caps=0x702c90,
          filename=0x702ae0 "/var/run/libvirt/lxc/x.xml", expectedVirtTypes=16, flags=0)
          at conf/domain_conf.c:9332
      11 0x0000000000425053 in main (argc=5, argv=0x7fffffffe2b8)
          at lxc/lxc_controller.c:1773
      (cherry picked from commit 57349ffc)
      d020d73f
    • G
      openvz: check pointer size instead of int · 66d095e6
      Guido Günther 提交于
      since int is 4 bytes on both i386 and amd64.
      (cherry picked from commit 229773fc)
      66d095e6
    • D
      Fix default USB controller for ppc64 · 340ab1c9
      Dipankar Sarma 提交于
      Fix the default usb controller for pseries systems if none
      specified.
      Signed-off-by: NDipankar Sarma <dipankar@in.ibm.com>
      (cherry picked from commit d1778b71)
      340ab1c9
    • M
      virsh: fix few typos on desc command · 91b4315b
      Martin Kletzander 提交于
      virsh help fix:
       - <--title> can also /get/ the title
      
      virsh man page:
       - missing <domain-id>
       - <new_desc> should be <new-desc>
      (cherry picked from commit 3dc733bb)
      91b4315b
    • M
      domain_conf: fix possible memory leak · 49cb53fa
      Martin Kletzander 提交于
      Until now, it was possible to crash libvirtd when defining domain with
      channel device with missing source element.
      
      When creating new virDomainChrDef, target.port is set to -1, but
      unfortunately it is an union with addresses that virDomainChrDefFree
      tries to free in case the deviceType is channel. Having the port set
      to -1 is intended, however the cleanest way to get around the problems
      with the crash seems to be renumbering the VIR_DOMAIN_CHR_CHANNEL_
      target types to cover new NONE type (with value 0) being the default
      (no target type yet).
      (cherry picked from commit 830d035f)
      49cb53fa
    • M
      virsh: make domiftune interface help string consistent · 855d8612
      Martin Kletzander 提交于
      Append '(MAC Address)' after the help string of domiftune virsh
      command as it takes the same type of argument as domif-{get,set}link
      which have it specified.
      (cherry picked from commit 4b227307)
      855d8612
    • G
      openvz: Fix wordsize on 64 bit architectures · e858eda3
      Guido Günther 提交于
      The word size there is 64 bit not 8.
      (cherry picked from commit 7dcee3f9)
      e858eda3
    • G
      LXC: fix memory leak in lxcContainerMountFSBlockHelper · bba793dc
      Gao feng 提交于
      we alloc the memory for format in lxcContainerMountDetectFilesystem
      but without free it in lxcContainerMountFSBlockHelper.
      
      this patch just call VIR_FREE to free it.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      (cherry picked from commit 73e2d646)
      bba793dc
    • M
      qemu_agent: Wait for events instead of agent response · e8603e5f
      Michal Privoznik 提交于
      With latest changes to qemu-ga success on some commands is not reported
      anymore, e.g. guest-shutdown or guest-suspend-*. However, errors are
      still being reported. Therefore, we need to find different source of
      indication if operation was successful. Events.
      (cherry picked from commit d97a234c)
      e8603e5f
    • E
      build: hoist qemu dependence on yajl to configure · 4cb2da8c
      Eric Blake 提交于
      Commit 6e769eba made it a runtime error if libvirt was compiled
      without yajl support but targets a new enough qemu.  But enough
      users are hitting this on self-compiled libvirt that it is worth
      erroring out at compilation time, rather than an obscure failure
      when trying to use the built executable.
      
      * configure.ac: If qemu is requested and -version works, require
      yajl when qemu version is new enough.
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Add
      comment.
      (cherry picked from commit 350583c8)
      4cb2da8c
    • C
      autogen: Always abide --system · 9373f0b7
      Cole Robinson 提交于
      If we do ./autogen.sh && ./configure, then later try ./autogen.sh --system,
      configure isn't invoked with the requested params. Instead
      config.status --recheck is run.
      (cherry picked from commit 2cd29c31)
      9373f0b7
    • J
      Check for errors when parsing bridge interface XML · d3121936
      Jim Fehlig 提交于
      The return status of virInterfaceDefParseBridge() was not being
      checked, potentially resulting in the creation of a broken
      interface.
      (cherry picked from commit cc004a66)
      d3121936
    • O
      schema: Update domain XML schema · 5814e39b
      Osier Yang 提交于
      'boot' tag shouldn't be exclusive with 'kernel', 'initrd', and 'cmdline',
      though the boot sequence doesn't make sense when the guest boots from
      kernel directly. But it's useful if booting from kernel is to install
      a newguest, even if it's not to install a guest, there is no hurt. And
      on the other hand, we allow 'boot' and the kernel tags when parsing.
      (cherry picked from commit b34324fb)
      5814e39b
    • W
      qemu: fix potential dead lock · d2c5e42f
      Wen Congyang 提交于
      If we lock the qemu_driver, we should call qemuDomainObjBeginJobWithDriver()
      not qemuDomainObjBeginJob().
      (cherry picked from commit 5136c579)
      d2c5e42f
    • O
      virsh: Null terminated the string memcpy from buffer explicitly · 72237660
      Osier Yang 提交于
      Detected by valgrind:
      
      ==16217== 1 errors in context 1 of 12:
      ==16217== Invalid read of size 1
      ==16217==    at 0x4A07804: __GI_strlen (mc_replace_strmem.c:284)
      ==16217==    by 0x3019F167F6: xdr_string (in /lib64/libc-2.12.so)
      ==16217==    by 0x3033709E8D: xdr_remote_nonnull_string (remote_protocol.c:31)
      ==16217==    by 0x303370E5CB: xdr_remote_domain_update_device_flags_args (remote_protocol.c:2028)
      ==16217==    by 0x30337197D1: virNetMessageEncodePayload (virnetmessage.c:341)
      ==16217==    by 0x30337135E1: virNetClientProgramCall (virnetclientprogram.c:327)
      ==16217==    by 0x30336F1EFD: callWithFD (remote_driver.c:4586)
      ==16217==    by 0x30336F1F7B: call (remote_driver.c:4607)
      ==16217==    by 0x30336F42F2: remoteDomainUpdateDeviceFlags (remote_client_bodies.h:2865)
      ==16217==    by 0x30336D46E5: virDomainUpdateDeviceFlags (libvirt.c:9457)
      ==16217==    by 0x41AEE8: cmdChangeMedia (virsh.c:15249)
      ==16217==    by 0x413CB4: vshCommandRun (virsh.c:18669)
      ==16217==  Address 0x4ec5e25 is 0 bytes after a block of size 293 alloc'd
      ==16217==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
      ==16217==    by 0x303364F1DB: virAllocN (memory.c:129)
      ==16217==    by 0x41A844: vshPrepareDiskXML (virsh.c:15043)
      ==16217==    by 0x41AECC: cmdChangeMedia (virsh.c:15246)
      ==16217==    by 0x413CB4: vshCommandRun (virsh.c:18669)
      ==16217==    by 0x423973: main (virsh.c:20261)
      (cherry picked from commit e3843d7f)
      72237660
    • L
      docs: small typo in formatdomain.html · 762fcc77
      Laine Stump 提交于
      (cherry picked from commit 8b36e32c)
      762fcc77
  2. 12 8月, 2012 2 次提交
  3. 02 8月, 2012 1 次提交
    • J
      daemon: Fix crash in virTypedParameterArrayClear · 45d6729f
      Jiri Denemark 提交于
      CVE-2012-3445, https://bugzilla.redhat.com/show_bug.cgi?id=844745
      
      Daemon uses the following pattern when dispatching APIs with typed
      parameters:
      
          VIR_ALLOC_N(params, nparams);
          virDomain*(dom, params, &nparams, flags);
          virTypedParameterArrayClear(params, nparams);
      
      In case nparams was originally set to 0, virDomain* API would fill it
      with the number of typed parameters it can provide and we would use this
      number (rather than zero) to clear params. Because VIR_ALLOC* returns
      non-NULL pointer even if size is 0, the code would end up walking
      through random memory. If we were lucky enough and the memory contained
      7 (VIR_TYPED_PARAM_STRING) at the right place, we would try to free a
      random pointer and crash.
      
      Let's make sure params stays NULL when nparams is 0.
      (cherry picked from commit 6039a2cb)
      45d6729f
  4. 28 7月, 2012 4 次提交
    • G
      libvirt-guests: systemd host shutdown does not work · 56f97e14
      Gerd v. Egidy 提交于
      I originally postet this into the Fedora bugzilla
      https://bugzilla.redhat.com/show_bug.cgi?id=843836
      
      Currently gracefully shutting down guest vms on host shutdown does not work on
      Fedora 17, the guests are killed hard on system shutdown.
      
      The reason is systemd considers libvirt-guests.service to be stopped when the
      system is running:
      
      $ systemctl status libvirt-guests.service
      libvirt-guests.service - Suspend Active Libvirt Guests
                Loaded: loaded (/usr/lib/systemd/system/libvirt-guests.service;
      enabled)
                Active: deactivating (stop) since Fri, 27 Jul 2012 15:47:31 +0200;
      2min 48s ago
               Process: 1085 ExecStart=/etc/init.d/libvirt-guests start
      (code=exited, status=0/SUCCESS)
               Control: 1150 (libvirt-guests)
                CGroup: name=systemd:/system/libvirt-guests.service
                        └ control
                          ├ 1150 /bin/sh /etc/init.d/libvirt-guests stop
                          └ 2257 sleep 1
      
      libvirt-guests.service is defined as type "simple" in systemd (the default).
      That means systemd will shut down the service when the start executable is
      terminated after starting is done. Systemd will not call stop again on system
      shutdown because it thinks it is already stopped.
      
      The solution is to define it as type "oneshot" and set the flag
      "RemainAfterExit". Then systemd will consider the service as active after
      startup and will call the stop function on host shutdown.
      (cherry picked from commit 79ca7e4e)
      56f97e14
    • E
      build: update to latest gnulib, for secure tarball · 96aedd9a
      Eric Blake 提交于
      Pick up some build fixes in the latest gnulib.  In particular,
      we want to ensure that official tarballs are secure, but don't
      want to penalize people who don't run 'make dist', since fixed
      automake still hasn't hit common platforms like Fedora 17.
      
      * .gnulib: Update to latest, for Automake CVE-2012-3386 detection.
      * bootstrap: Resync from gnulib.
      * bootstrap.conf (gnulib_extra_files): Drop missing, since gnulib
      has dropped it in favor of Automake's version.
      * cfg.mk (local-checks-to-skip): Conditionally skip the security
      check in cases where it doesn't matter.
      (cherry picked from commit f12e1396)
      96aedd9a
    • D
      Update to latest GNULIB to fix compat with Mingw64 toolchain · 27e6e9f2
      Daniel P. Berrange 提交于
      On both x86_64-w64-mingw32 and i686-w64-mingw32 there were
      the following warnings/errors:
      
        CC     fstat.lo
      ../../../gnulib/lib/fstat.c:27:0: warning: "stat" redefined [enabled by default]
      In file included from ./sys/stat.h:32:0,
                       from ../../../gnulib/lib/fstat.c:25:
      /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:258:0: note: this is the location of the previous definition
      ../../../gnulib/lib/fstat.c:28:0: warning: "fstat" redefined [enabled by default]
      In file included from ./sys/stat.h:32:0,
                       from ../../../gnulib/lib/fstat.c:25:
      /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:259:0: note: this is the location of the previous definition
      
        CC     stat.lo
      ../../../gnulib/lib/stat.c:32:0: warning: "stat" redefined [enabled by default]
      In file included from ./sys/stat.h:32:0,
                       from ../../../gnulib/lib/stat.c:27:
      /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:258:0: note: this is the location of the previous definition
      
        CC     stdio-read.lo
      ../../../gnulib/lib/stdio-read.c:102:1: error: redefinition of 'vscanf'
      In file included from ./stdio.h:43:0,
                       from ../../../gnulib/lib/stdio-read.c:21:
      /usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:397:7: note: previous definition of 'vscanf' was here
      ../../../gnulib/lib/stdio-read.c:108:1: error: redefinition of 'vfscanf'
      In file included from ./stdio.h:43:0,
                       from ../../../gnulib/lib/stdio-read.c:21:
      /usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:384:7: note: previous definition of 'vfscanf' was here
      make[3]: *** [stdio-read.lo] Error 1
      make[3]: Leaving directory `/home/berrange/src/virt/libvirt/build/gnulib/lib'
      
      While on x86_64-w64-mingw32 only there was:
      
      In file included from ../../../gnulib/lib/regex.c:69:0:
      ../../../gnulib/lib/regcomp.c: In function 'parse_dup_op':
      ../../../gnulib/lib/regcomp.c:2624:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      ../../../gnulib/lib/regcomp.c: In function 'mark_opt_subexp':
      ../../../gnulib/lib/regcomp.c:3859:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit db835b7b)
      27e6e9f2
    • E
      build: update to latest gnulib · d66fa967
      Eric Blake 提交于
      Gnulib finally relaxed the isatty license, needed as first mentioned here:
      https://www.redhat.com/archives/libvir-list/2012-February/msg01022.html
      
      Other improvements include better syntax-check rules (we can delete one
      of ours now that it is a duplicate) and better compiler warning usage.
      
      * .gnulib: Update to latest, for isatty.
      * cfg.mk (sc_prohibit_strncpy): Drop a now-redundant rule.
      * bootstrap.conf (gnulib_modules): Add isatty.
      * bootstrap: Resync from gnulib.
      (cherry picked from commit e925ea31)
      d66fa967
  5. 16 6月, 2012 2 次提交
    • C
      Stable release 0.9.11.4 · 89a3feb8
      Cole Robinson 提交于
      89a3feb8
    • E
      build: fix build of fresh checkout · 04d64691
      Eric Blake 提交于
      Commit 7bff56a0 worked in an incremental build, but fails for a
      fresh clone; apparently, if make sees both an actual file
      spelling and an inference rule, only the exact spelling is used.
      
        CCLD   libvirt_driver_test.la
        CC     libvirt_driver_remote_la-remote_driver.lo
      remote/remote_driver.c:4707:34: fatal error: remote_client_bodies.h: No such file or directory
      compilation terminated.
      
      BUILT_SOURCES to the rescue, instead of trying to mess with .lo
      dependencies directly.
      
      * src/Makefile.am (REMOTE_DRIVER_PREREQS, %remote_driver.lo): Drop...
      (BUILT_SOURCES): ...and add here instead.
      (cherry picked from commit ca02b101)
      
      Conflicts:
      
      	src/Makefile.am
      04d64691
  6. 15 6月, 2012 11 次提交
    • E
      build: fix 'make distcheck' issues · 3c3aaaf9
      Eric Blake 提交于
      We had a distributed file (remote_protocol.h, which in turn was
      a prereq to remote_driver.c) depending on a generated file
      (libvirt_probes.h), which is a no-no for a VPATH build from a
      read-only source tree (no wonder 'make distcheck' tests precisely
      that situation):
      
           File `libvirt_driver_remote.la' does not exist.
             File `libvirt_driver_remote_la-remote_driver.lo' does not exist.
                   Prerequisite `libvirt_probes.h' is newer than target `../../src/remote/remote_protocol.h'.
                  Must remake target `../../src/remote/remote_protocol.h'.
      Invoking recipe from Makefile:7464 to update target `../../src/remote/remote_protocol.h'.
      make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/libvirt-0.9.12/_build/src'
        GEN    ../../src/remote/remote_protocol.h
      cannot create ../../src/remote/remote_protocol.h: Permission denied at ../../src/rpc/genprotocol.pl line 31.
      make[3]: *** [../../src/remote/remote_protocol.h] Error 13
      
      Rather than making distributed .c files depend on generated files, we
      really want to ensure that compilation into .lo files is not attempted
      until the generated files are present, done by this patch.  Since there
      were two different sets of conditionally generated files that both
      feed the .lo file, I had to introduce a new variable REMOTE_DRIVER_PREREQS
      to keep automake happy.
      
      After that fix, the next issue was that make treats './foo' and 'foo'
      differently in determining whether an implicit %foo rule is applicable,
      with the result that locking/qemu-sanlock.conf wasn't properly being
      built at the right times.  Also, the output for using the .aug test
      files was a bit verbose.
      
      After fixing the src directory, the next error is related to the docs
      directory, where the tarball is missing a stamp file and thus tries to
      regenerate files that are already present:
      
        GEN    ../../docs/apibuild.py.stamp
      Traceback (most recent call last):
        File "../../docs/apibuild.py", line 2511, in <module>
          rebuild("libvirt")
        File "../../docs/apibuild.py", line 2495, in rebuild
          builder.serialize()
        File "../../docs/apibuild.py", line 2424, in serialize
          output = open(filename, "w")
      IOError: [Errno 13] Permission denied: '../../docs/libvirt-api.xml'
      make[5]: *** [../../docs/apibuild.py.stamp] Error 1
      
      and fixing that exposed another case of a distributed file (generated
      html) depending on a built file (libvirt.h), but only when doing an
      in-tree build, because of a file glob.
      
      * src/Makefile.am ($(srcdir)/remote/remote_driver.c): Change...
      (libvirt_driver_remote_la-remote_driver.lo): ...to the real
      dependency.
      ($(builddir)/locking/%-sanlock.conf): Drop $(builddir), so that
      rule gets run in time for test_libvirt_sanlock.aug.
      (test_libvir*.aug): Cater to silent build.
      (conf_DATA): Don't ship qemu-sanlock.conf in the tarball, since it
      is trivial to regenerate.
      * docs/Makefile.am (EXTRA_DIST): Ship our stamp file.
      ($(APIBUILD_STAMP)): Don't depend on generated file.
      (cherry picked from commit 7bff56a0)
      
      Conflicts:
      
      	src/Makefile.am
      3c3aaaf9
    • E
      build: fix 'make dist' on virgin checkout · e570f87a
      Eric Blake 提交于
      'make dist' was depending on *protocol-structs files, which are
      stored in git but in turn depended on generated files.  We still
      want to ship the protocol-structs files, but by renaming the
      tests to something not matching a file name, we separate 'make
      check' (which depends on the generated file) from 'make dist'
      (which only depends on the git files).  After all, the tarball
      should never depend on a generated file not stored in git.
      
      I found one more case of a git file depending on a generated
      file, in a bogus virkeycode.c listing; but at least this one
      had no associated rules so it never broke 'make dist'.
      
      Reported by Wen Congyang.  Latent bug has been present since
      commit 62dee6fa, but only recently exposed by commit 7bff56a0.
      
      * src/Makefile.am ($(srcdir)/util/virkeycode.c): Drop useless
      dependency.
      (BUILT_SOURCES): ...and build virkeymaps.h sooner.
      (PROTOCOL_STRUCTS): Rather than depend on the struct file...
      (check-local): ...convert things into a phony target of...
      (check-protocol): ...a new check.
      ($(srcdir)/remote_protocol-struct): Rename to isolate the distributed
      file from the conditional test.
      (PDWTAGS): Deal with rename.  Swap to compare 'expected actual'.
      (cherry picked from commit 9b5970c6)
      e570f87a
    • D
      Improve error message diagnosing incorrect XML CPU mode · 52c4d49c
      Daniel P. Berrange 提交于
      Tell the user what CPU mode value is wrong
      (cherry picked from commit 92cbe7ae)
      52c4d49c
    • P
      qemu: Enable disconnecting SPICE clients without changing password · e6c5ae46
      Peter Krempa 提交于
      Libvirt updates the configuration of SPICE server only when something
      changes. This is unfortunate when the user wants to disconnect a
      existing spice session when the connected attribute is already
      "disconnect".
      
      This patch modifies the conditions for calling the password updater to
      be called when nothing changes, but the connected attribute is already
      "disconnect".
      (cherry picked from commit e0f0131d)
      e6c5ae46
    • P
      qemu: Fix off-by-one error while unescaping monitor strings · 0889bdb8
      Peter Krempa 提交于
      While unescaping the commands the commands passed through to the monitor
      function qemuMonitorUnescapeArg() initialized lenght of the input string
      to strlen()+1 which is fine for alloc but not for iteration of the
      string.
      
      This patch fixes the off-by-one error and drops the pointless check for
      a single trailing slash that is automaticaly handled by the default
      branch of switch.
      (cherry picked from commit 0f4660c8)
      0889bdb8
    • P
      virsh: Don't generate invalid XML in attach-disk command · 73908b1d
      Peter Krempa 提交于
      The attach-disk command used with parameter --cache created an invalid
      XML snippet as the beginning of the <driver> element was not printed
      when used solely with --cache and no other attribute to driver.
      (cherry picked from commit 5b474026)
      73908b1d
    • D
      Fix typo in RPM specfile · 661a2e83
      Daniel P. Berrange 提交于
      libvirt.spec.in: s/{?rhel}/%{?rhel}/
      (cherry picked from commit 48939a4a)
      661a2e83
    • E
      python: fix snapshot listing bugs · 934e7c22
      Eric Blake 提交于
      Python exceptions are different than libvirt errors, and we had
      some corner case bugs on OOM situations.
      
      * python/libvirt-override.c (libvirt_virDomainSnapshotListNames)
      (libvirt_virDomainSnapshotListChildrenNames): Use correct error
      returns, avoid segv on OOM, and avoid memory leaks on error.
      (cherry picked from commit a0de5d78)
      934e7c22
    • E
      python: use simpler methods · a570ecd6
      Eric Blake 提交于
      * python/libvirt-override.c (libvirt_virDomainGetVcpus)
      (libvirt_virDomainGetVcpuPinInfo): Use Py_XDECREF instead of
      open-coding it.
      (cherry picked from commit 8566618f)
      a570ecd6
    • M
      qemu: Don't overwrite security labels · dd85b621
      Michal Privoznik 提交于
      Currently, if qemuProcessStart fail at some point, e.g. because
      domain being started wants a PCI/USB device already assigned to
      a different domain, we jump to cleanup label where qemuProcessStop
      is performed. This unconditionally calls virSecurityManagerRestoreAllLabel
      which is wrong because the other domain is still using those devices.
      
      However, once we successfully label all devices/paths in
      qemuProcessStart() from that point on, we have to perform a rollback
      on failure - that is - we have to virSecurityManagerRestoreAllLabel.
      (cherry picked from commit 86032b22)
      
      Conflicts:
      
      	src/qemu/qemu_process.c
      dd85b621
    • M
      qemuProcessStop: Switch to flags · 9225f9e1
      Michal Privoznik 提交于
      Currently, we are passing only one boolean (migrated) so there is
      no real profit in this. But it creates starting position for
      next patch.
      (cherry picked from commit 69dd7714)
      
      Conflicts:
      
      	src/qemu/qemu_process.c
      9225f9e1