1. 01 4月, 2015 2 次提交
  2. 31 3月, 2015 3 次提交
    • P
      qemu: blockjob: Synchronously update backing chain in XML on ABORT/PIVOT · 630ee5ac
      Peter Krempa 提交于
      When the synchronous pivot option is selected, libvirt would not update
      the backing chain until the job was exitted. Some applications then
      received invalid data as their job serialized first.
      
      This patch removes polling to wait for the ABORT/PIVOT job completion
      and replaces it with a condition. If a synchronous operation is
      requested the update of the XML is executed in the job of the caller of
      the synchronous request. Otherwise the monitor event callback uses a
      separate worker to update the backing chain with a new job.
      
      This is a regression since 1a92c719
      
      When the ABORT job is finished synchronously you get the following call
      stack:
       #0  qemuBlockJobEventProcess
       #1  qemuDomainBlockJobImpl
       #2  qemuDomainBlockJobAbort
       #3  virDomainBlockJobAbort
      
      While previously or while using the _ASYNC flag you'd get:
       #0  qemuBlockJobEventProcess
       #1  processBlockJobEvent
       #2  qemuProcessEventHandler
       #3  virThreadPoolWorker
      630ee5ac
    • P
      qemu: Extract internals of processBlockJobEvent into a helper · 0c4474df
      Peter Krempa 提交于
      Later on I'll be adding a condition that will allow to synchronise a
      SYNC block job abort. The approach will require this code to be called
      from two different places so it has to be extracted into a helper.
      0c4474df
    • P
      qemu: processBlockJob: Don't unlock @vm twice · 6b6c4ab8
      Peter Krempa 提交于
      Commit 1a92c719 moved code to handle block job events to a different
      function that is executed in a separate thread. The caller of
      processBlockJob handles locking and unlocking of @vm, so the we should
      not do it in the function itself.
      6b6c4ab8
  3. 30 3月, 2015 6 次提交
  4. 29 3月, 2015 1 次提交
    • E
      build: avoid variable named 'interface', for mingw · 75d56f51
      Eric Blake 提交于
      Commit 2f36e694 (re-)introduced a use of an identifier 'interface',
      which causes this build failure on mingw:
      
      ../../tools/virsh-domain-monitor.c: In function 'cmdDomIfAddr':
      ../../tools/virsh-domain-monitor.c:2233:17: error: expected identifier or '(' before 'struct'
           const char *interface = NULL;
                            ^
      
      See also commit 6512c8b4.  Sadly, I'm not quite sure how to write a
      syntax check that can poison the use of this identifier.
      
      * tools/virsh-domain-monitor.c (cmdDomIfAddr): Use ifacestr instead.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      75d56f51
  5. 28 3月, 2015 2 次提交
  6. 27 3月, 2015 11 次提交
    • P
      tests: introduce qemucaps2xmlmock · eb05cb0d
      Pavel Hrdina 提交于
      We need to mock virFileExists to return true for "/dev/kvm" because the
      test should not depend on host system.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      eb05cb0d
    • P
      Revert "qemucaps2xmltest: fix test to successfully run without kvm support" · a894d61b
      Pavel Hrdina 提交于
      This reverts commit 49bf09d1.  That
      commit is wrong and doesn't fix the issue.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      a894d61b
    • P
      virnetlink: fix build error · 0614976b
      Pavel Hrdina 提交于
      Commint 0473b45c introduced new function virNetlinkDelLink, but in
      it's counterpart for non-linux platform there should be ATTRIBUTE_UNUSED
      instead of ATTRIBUTE_UNSUPPORTED.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      0614976b
    • S
      qemu: end the job when try to blockcopy to non-file destination · c5fbad66
      Shanzhi Yu 提交于
      Blockcopy to non-file destination is not supported according the code,
      but a 'goto endjob' is missed after checking the destination.
      
      This leads to calling drive-mirror with wrong parameters.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1206406Signed-off-by: NShanzhi Yu <shyu@redhat.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      c5fbad66
    • W
      nodeinfo: Increase the num of CPU thread siblings to a larger value · c13de016
      Wei Huang 提交于
      Current libvirt can only handle up to 1023 bytes when it
      reads Linux sysfs topology/thread_siblings. This isn't enough for
      Linux distributions that support a large value. This patch fixes
      the problem by using VIR_ALLOC()/VIR_FREE(), instead of using a
      fixed-size (1024) local char array. In the meanwhile
      SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX is increased to 8192 which
      should be large enough for a foreseeable future.
      Signed-off-by: NWei Huang <wei@redhat.com>
      c13de016
    • E
      relaxng: allow : in /dev/disk/by-path names · dfc70875
      Eric Blake 提交于
      On IRC, Hydrar pointed a problem where 'virsh edit' failed on
      his domain created through an ISCSI pool managed by virt-manager,
      all because the XML included a block device with colons in the
      name.
      
      * docs/schemas/basictypes.rng (absFilePath): Add colon as safe.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml: New file.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args: Likewise.
      * tests/qemuxml2argvtest.c (mymain): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      dfc70875
    • K
      libxl: Fix memory leak if pthread_create fails. · 95003cd5
      Konrad Rzeszutek Wilk 提交于
      If we fail to create the thread we leak the shutdown_info
      structure.
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      95003cd5
    • L
      util: use netlink to create bridge devices · fc7b23db
      Laine Stump 提交于
      Just as it is possible to delete a bridge device with the netlink
      RTM_DELLINK message, one can be created with the RTM_NEWLINK
      message. Because of differences in the format of the message, it's not
      as straightforward as with virNetlinkDelLink() to create a single
      utility function that can be used to create any type of interface, so
      the new netlink version of virNetDevBridgeCreate() does its own
      construction of the netlink message and calls virNetlinkCommand()
      itself.
      
      This doesn't provide any extra functionality, just provides symmetry
      with the previous commit.
      
      NB: We *could* alter the API of virNetDevBridgeCreate() to take a MAC
      address, and directly program that mac address into the bridge (by
      adding an IFLA_ADDRESS attribute, as is done in
      virNetDevMacVLanCreate()) rather than separately creating the "dummy
      tap" (e.g. virbr0-nic) to maintain a fixed mac address on the bridge,
      but the commit history of virnetdevbridge.c shows that the presence of
      this dummy tap is essential in some older versions of the kernel
      (between 2.6.39 and 3.1 or 3.2, possibly?) to proper operation of IPv6
      DAD, and I don't want to take the chance of breaking something that I
      don't have the time/setup to test (my RHEL6 box is at kernel
      2.6.32-544, and the next lowest kernel I have is 3.17)
      fc7b23db
    • L
      util: use netlink to delete bridge devices · 09778e09
      Laine Stump 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1125755
      
      reported that a stray bridge device was left on the system when a
      libvirt network failed to start due to an illegal iptables rule caused
      by bad config. Apparently the reason this was happening was that
      NetworkManager was noticing immediately when the bridge device was
      created and automatically setting it IFF_UP. libvirt would then try to
      setup the iptables rules, get an error back, and since libvirt had
      never IFF_UPed the bridge, it didn't expect that it needed to set it
      ~IFF_UP before deleting it during the cleanup process. But the
      ioctl(SIOCBRDELBR) ioctl will fail to delete a bridge if it is IFF_UP.
      
      Since that bug was reported, NetworkManager has gotten a bit more
      polite in this respect, but just in case something similar happens in
      the future, this patch switches to using the netlink RTM_DELLINK
      message to delete the bridge - unlike SIOCBRDELBR, it will delete the
      requested bridge no matter what the setting of IFF_UP.
      09778e09
    • L
      util: replace body of virNetDevMacVLanDelete() with virNetlinkDelLink() · e849062a
      Laine Stump 提交于
      These two functions are identical, so no sense in having the
      duplication. I resisted the temptation to replace calls to
      virNetDevMacVLanDelete() with calls to virNetlinkDelLink() just in
      case some mythical future platform has macvtap devices that aren't
      managed with netlink (or in case we some day need to do more than just
      tell the kernel to delete the device).
      e849062a
    • L
      util: netlink function to delete any network device · 0473b45c
      Laine Stump 提交于
      libvirt has always used the netlink RTM_DELLINK message to delete
      macvtap/macvlan devices, but it can actually be used to delete other
      types of network devices, such as bonds and bridges. This patch makes
      virNetDevMacVLanDelete() available as a generic function so it can
      intelligibly be called to delete these other types of interfaces.
      0473b45c
  7. 26 3月, 2015 11 次提交
  8. 25 3月, 2015 4 次提交
    • P
      tests: qemuxml2xml: Test status XML formatting and parsing · 02f0f1cc
      Peter Krempa 提交于
      Recently we've fixed a bug where the status XML could not be parsed as
      the parser used absolute path XPath queries. This test enhancement tests
      all XML files used in the qemu-xml-2-xml test as a part of a status XML
      snippet to see whether they are parsed correctly. The status XML-2-XML is
      currently tested in 223 cases with this patch.
      02f0f1cc
    • P
      util: buffer: Add support for adding text blocks with indentation · 6ff59cbc
      Peter Krempa 提交于
      The current auto-indentation buffer code applies indentation only on
      complete strings. To allow adding a string containing newlines and
      having it properly indented this patch adds virBufferAddStr.
      6ff59cbc
    • G
      Don't validata filesystem target type · db1edae8
      Guido Günther 提交于
      When using QEMU's 9pfs the target "dir" element is not necessarily an
      absolute path but merely an arbitrary identifier. So validation in that
      case currently fails with the misleading
      
         $ virt-xml-validate /tmp/test.xml
         Relax-NG validity error : Extra element devices in interleave
         /tmp/test.xml:24: element devices: Relax-NG validity error : Element domain failed to validate content
         /tmp/test.xml fails to validate
      db1edae8
    • P
      rpc: Don't unref identity object while callbacks still can be executed · a98129c0
      Peter Krempa 提交于
      While this thread is cleaning up the client and connection objects:
       #2  virFileReadAll (path=0x7f28780012b0 "/proc/1319/stat", maxlen=maxlen@entry=1024, buf=buf@entry=0x7f289c60fc40) at util/virfile.c:1287
       #3  0x00007f28adbb1539 in virProcessGetStartTime (pid=<optimized out>, timestamp=timestamp@entry=0x7f289c60fc98) at util/virprocess.c:838
       #4  0x00007f28adb91981 in virIdentityGetSystem () at util/viridentity.c:151
       #5  0x00007f28ae73f17c in remoteClientFreeFunc (data=<optimized out>) at remote.c:1131
       #6  0x00007f28adcb7f33 in virNetServerClientDispose (obj=0x7f28aecad180) at rpc/virnetserverclient.c:858
       #7  0x00007f28adba8eeb in virObjectUnref (anyobj=<optimized out>) at util/virobject.c:265
       #8  0x00007f28ae74ad05 in virNetServerHandleJob (jobOpaque=<optimized out>, opaque=0x7f28aec93ff0) at rpc/virnetserver.c:205
       #9  0x00007f28adbbef4e in virThreadPoolWorker (opaque=opaque@entry=0x7f28aec88030) at util/virthreadpool.c:145
      
      In stack frame #6 the client->identity object got unref'd, but the code
      that removes the event callbacks in frame #5 did not run yet as we are
      trying to obtain the system identity (frames #4, #3, #2).
      
      In other thead:
       #0  virObjectUnref (anyobj=anyobj@entry=0x7f288c162c60) at util/virobject.c:264
              klass = 0xdeadbeef
              obj = 0x7f288c162c60
       #1  0x00007f28ae71c709 in remoteRelayDomainEventCheckACL (client=<optimized out>, conn=<optimized out>, dom=dom@entry=0x7f28aecaafc0) at remote.c:164
       #2  0x00007f28ae71fc83 in remoteRelayDomainEventTrayChange (conn=<optimized out>, dom=0x7f28aecaafc0, ... ) at remote.c:717
       #3  0x00007f28adc04e53 in virDomainEventDispatchDefaultFunc (conn=0x7f287c0009a0, event=0x7f28aecab1a0, ...) at conf/domain_event.c:1455
       #4  0x00007f28adc03831 in virObjectEventStateDispatchCallbacks (callbacks=<optimized out>, ....) at conf/object_event.c:724
       #5  virObjectEventStateQueueDispatch (callbacks=0x7f288c083730, queue=0x7fff51f90030, state=0x7f288c18da20) at conf/object_event.c:738
       #6  virObjectEventStateFlush (state=0x7f288c18da20) at conf/object_event.c:816
       #7  virObjectEventTimer (timer=<optimized out>, opaque=0x7f288c18da20) at conf/object_event.c:562
       #8  0x00007f28adb859cd in virEventPollDispatchTimeouts () at util/vireventpoll.c:459
      
      Frame #0 is unrefing an invalid identity object while frame #2 hints
      that the client is still dispatching the event.
      
      For untrimmed backtrace see the bugzilla attachment.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1203030
      a98129c0