- 16 10月, 2015 10 次提交
-
-
由 Michal Privoznik 提交于
This is pure code adjustment. The structure is going to be needed later as it will hold a reference that will be used to talk to virtlockd. However, so far this is no functional change just code preparation. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
It's better if we stat() file that we are about to chown() at first and check if there's something we need to change. Not that it would make much difference, but for the upcoming patches we need to be doing stat() anyway. Moreover, if we do things this way, we can drop @chown_errno variable which will become redundant. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Correctly mark the places where we need to remember and recall file ownership. We don't want to mislead any potential developer. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
So we have this mechanism that on SIGUSR1 the virtlockd dumps its internal state into a JSON file, reexec itself and the reloads the internal state back. However, there's a bug in our implementation: (gdb) signal SIGUSR1 Continuing with signal SIGUSR1. [Thread 0x7fd094f7b700 (LWP 10602) exited] process 10600 is executing new program: /home/zippy/work/libvirt/libvirt.git/src/virtlockd warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7fb28bc3c700 (LWP 14501)] Program received signal SIGSEGV, Segmentation fault. 0x00007fb29133d530 in virExpandN (ptrptr=0x70, size=8, countptr=0x68, add=1, report=true, domcode=7, filename=0x7fb29138aeab "rpc/virnetserver.c", funcname=0x7fb29138b680 <__FUNCTION__.15821> "virNetServerAddProgram", linenr=661) at util/viralloc.c:288 288 if (*countptr + add < *countptr) { (gdb) bt #0 0x00007fb29133d530 in virExpandN (ptrptr=0x70, size=8, countptr=0x68, add=1, report=true, domcode=7, filename=0x7fb29138aeab "rpc/virnetserver.c", funcname=0x7fb29138b680 <__FUNCTION__.15821> "virNetServerAddProgram", linenr=661) at util/viralloc.c:288 #1 0x00007fb29132a267 in virNetServerAddProgram (srv=0x0, prog=0x7fb2915d08b0) at rpc/virnetserver.c:661 #2 0x00007fb29131f27f in main (argc=1, argv=0x7fff8f771298) at locking/lock_daemon.c:1445 Notice the NULL @srv passed to frame 2? Usually, the @srv variable is initialized on fresh start. However, in case of daemon reload, the code path that is responsible for initializing the value was not triggered and therefore we crashed immediately. Fix this by always setting the variable. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Shivaprasad G Bhat 提交于
Tunnelled migration can hang if the destination qemu exits despite all the ABI checks. This happens whenever the destination qemu exits before the complete transfer is noticed by source qemu. The savevm state checks at runtime can fail at destination and cause qemu to error out. The source qemu cant notice it as the EPIPE is not propogated to it. The qemuMigrationIOFunc() notices the stream being broken from virStreamSend() and it cleans up the stream alone. The qemuMigrationWaitForCompletion() would never get to 100% transfer completion. The qemuMigrationWaitForCompletion() never breaks out as well since the ssh connection to destination is healthy, and the source qemu also thinks the migration is ongoing as the Fd to which it transfers, is never closed or broken. So, the migration will hang forever. Even Ctrl-C on the virsh migrate wouldn't be honoured. Close the source side FD when there is an error in the stream. That way, the source qemu updates itself and qemuMigrationWaitForCompletion() notices the failure. Close the FD for all kinds of errors to be sure. The error message is not copied for EPIPE so that the destination error is copied instead later. Note: Reproducible with repeated migrations between Power hosts running in different subcores-per-core modes. Signed-off-by: NShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1264008 The existing algorithm assumed that someone was making small, incremental changes; however, it is possible to change iothreads from 0 (or relatively small number) to some really large number and the algorithm would possibly spin its wheels doing unnecessary searches. So, optimize the algorithm using a bitmap to find available iothread_id's starting at 1 that aren't already defined by a "<thread id='#'>" and filling in the iothreadids array with those iothread_id values.
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1249981 When qemuDomainPinIOThread was added in commit id 'fb562614', a check for the IOThread capability was not needed since a check for iothreadpids covered the condition where the support for IOThreads was not present. The iothreadpids array was only created if qemuProcessDetectIOThreadPIDs was able to query the monitor for IOThreads. It would only do that if the QEMU_CAPS_OBJECT_IOTHREAD capability was set. However, when iothreadids were added in commit id '8d4614a5' and the check for iothreadpids was replaced by a search through the iothreadids[] array for the matching iothread_id that left open the possibility that an iothreadids[] array was defined, but the entries essentially pointed to elements with only the 'iothread_id' defined leaving the 'thread_id' value of 0 and eventually the cpumap entry of NULL. This was because, the original IOThreads commit id '72edaae7' only checked if IOThreads were defined and if the emulator had the IOThreads capability, then IOThread objects were added at startup. The "capability failure" check was only done when a disk was assigned to an IOThread in qemuCheckIOThreads. This was because the initial implementation had no way to dynamically add IOThreads, but it was possible to dynamically add a disk to the domain. So the decision was if the domain supported it, then add the IOThread objects. Then if a disk with an IOThread defined was added, it could check the capability and fail to add if not there. This just meant the 'iothreads' value was essentially ignored. Eventually commit id 'a27ed6e7' allowed for the dynamic addition and deletion of IOThread objects. So it was no longer necessary to generate IOThread objects to dynamically attach a disk to. However, the startup and disk check code was not modified to reflect this. This patch will move the capability failure check to when IOThread objects are being added to the command line. Thus a domain that has IOThreads defined will not be started if the emulator doesn't support the capability. This means when qemuCheckIOThreads is called to add a disk, it's no longer necessary to check the capability. Instead the code can use the IOThreadFind call to indicate that the IOThread doesn't exist. Finally because it could be possible to have a domain running with the iothreadids[] defined prior to this change if libvirtd is restarted each having mostly empty elements, qemuProcessDetectIOThreadPIDs will check if there are niothreadids when the QEMU_CAPS_OBJECT_IOTHREAD capability check fails and remove the elements and array if it exists. With these changes in place, it turns out the cputune-numatune test was failing because the right bit wasn't set in the test. So used the opportunity to fix that and create a test that would expect to fail with some sort of iothreads defined and used, but not having the correct capability.
-
由 John Ferlan 提交于
If there are no IOThreads defined, no sense making other checks
-
由 John Ferlan 提交于
Although theoretically both should be the same value, the niothreadids should be used in favor of iothreads when performing comparisons. This leaves the iothreads as a purely numeric value to be saved in the config file. The one exception to the rule is virDomainIOThreadIDDefArrayInit where the iothreadids are being generated from the iothreads count since iothreadids were added after initial iothreads support.
-
由 Dominik Perpeet 提交于
Event implementations need to be registered before a connection to the Hypervisor is opened, otherwise event handling can be impaired (e.g. delayed messages). This fact is referenced in an e-mail [1], but should also be noted in the documentation of the registration functions. [1] https://www.redhat.com/archives/libvirt-users/2014-April/msg00011.html
-
- 15 10月, 2015 3 次提交
-
-
由 Wei Jiangang 提交于
Don't compare a bool variable against the literal, "true". Signed-off-by: NWei Jiangang <weijg.fnst@cn.fujitsu.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Wei Jiangang 提交于
seclets ==> selects qualfied ==> qualified Signed-off-by: NWei Jiangang <weijg.fnst@cn.fujitsu.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 John Ferlan 提交于
Create a separate local API that will fill in the iothreadid array entries that were not defined by <iothread id='#'> entries in the XML. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 14 10月, 2015 8 次提交
-
-
由 John Ferlan 提交于
Rework the code in order to use the "ret = -1;" and goto cleanup; coding style. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
After a successful creation of a directory, if some other call results in returning a failure, let's remove the directory we created to prevent another round trip or confusion in the caller. In particular, this function can be called during a storage backend buildVol, so in order to ensure that caller doesn't need to distinguish between failed create or some other failure after create, just remove the directory we created. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
After a successful creation of a file, if some other call results in returning a failure, let's unlink the file we created to prevent another round trip or confusion in the caller. In particular, this function can be called during a storage backend buildVol, so in order to ensure that caller doesn't need to distinguish between failed create or some other failure after create, just remove the volume we created. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1233003 Track when the logical volume was successfully created in order to properly handle the call to virStorageBackendLogicalDeleteVol. It's possible that the failure to create was because someone created an LV in the pool outside of libvirt's knowledge. In this case, we don't want to delete that LV. A subsequent or future refresh of the pool will find the volume and cause an earlier failure Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Commit id '1b5685da' refactored the code to move buildvoldef inside the buildVol conditional; however, the VIR_FREE of the memory was left only when 'buildret' failed, thus we're leaking memory. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
As of commit id '155ca616' a 'refreshVol' is called after a buildVol succeeds in storageVolCreateXML, thus a volStorageBackendSheepdogRefreshVolInfo call in virStorageBackendSheepdogBuildVol is no longer necessary. Additionally, the 'conn' parameter becomes unused. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
As of commit id '155ca616' a 'refreshVol' is called after the buildVol succeeds in storageVolCreateXML, thus the volStorageBackendRBDRefreshVolInfo call in virStorageBackendRBDBuildVol is no longer necessary. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Eric Blake 提交于
Without this, building on cygwin fails with: CC libvirt_admin_la-libvirt-admin.lo libvirt-admin.c:25:21: fatal error: rpc/rpc.h: No such file or directory #include <rpc/rpc.h> ^ Reported-by: NYaakov Selkowitz <yselkowi@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 12 10月, 2015 14 次提交
-
-
由 Michal Privoznik 提交于
Our apibuild.py script does not cope with ATTRIBUTE_NONNULL: Parse Error: parsing function type, ')' expected Got token ('name', 'char') Last token: ('name', 'char') Token queue: [('op', '*'), ('name', 'dconnuri'), ('sep', ')')] Line 3297 end: Makefile:2441: recipe for target '../../docs/apibuild.py.stamp' failed Let's drop it. Moreover, up until e17ae3cc where it was introduced we did not really care about NULL-ity of dconnuri. And moreover the ATTRIBUTE_NONNULL merely checks for static calls over NULL, it won't catch the dynamic ones, where a NULL is passed by a variable at runtime. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1256999 After creating a copy of the 'authdef' in a pool -> disk translation, unconditionally clear the 'authType' in the resulting disk auth def structure since that's used for a storage pool and not a disk. This ensures virStorageAuthDefFormat will properly format the <auth> XML for a <disk> (e.g. it won't have a <auth type='%s'.../>).
-
由 Nikolay Shirokovskiy 提交于
Check dconnuri is not null or we will catch nullpointer later. I hope this makes Coverity happy. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
virDomainMigrateUnmanagedParams is not a good candidate for this functionality as it is used by migrate family functions too and its have its own checks that are superset of extracted and we don't need to check twice. Actually name of the function is slightly misleading as there is also a check for consistensy of flags parameter alone. So it could be refactored further and reused by all migrate functions but for now let it be a matter of a different patchset. It is *not* a pure refactoring patch as it introduces offline check for older versions. Looks like it must be done that way and no one will be broken too. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Finally on this step we get what we were aimed for - toURI{1, 2} (and migration{*} APIs too) now can work thru V3_PARAMS protocol. Execution path goes thru unchanged virDomainMigrateUnmanaged adapter function which is called by all target places. Note that we keep the fact that direct migration never works thru V3_PARAMS proto. We can't change this aspect without further investigation. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Move virDomainMigrateUnmanagedProto* expected params list check into function itself and use common virTypedParamsCheck for this purpose. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Extract parameter adaptation and checking which is protocol dependent into designated functions. Leave only branching and common checks in virDomainMigrateUnmanagedParams. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Let's put main functionality into params version of virDomainMigrateUnmanaged as a preparation step for merging it with virDomainMigratePeer2PeerParams. virDomainMigrateUnmanaged then does nothing more then just adapting arguments. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
p2p plain and direct function are good candidates for code reuse. Their main function is same - to branch among different versions of migration protocol and implementation of this function is also same. Also they have other common functionality in lesser aspects. So let's merge them. But as they have different signatures we have to get to convention on how to pass direct migration 'uri' in 'dconnuri' and 'miguri'. Fortunately we alreay have such convention in parameters passed to toURI2 function, just let's follow it. 'uri' is passed in miguri and dconnuri is ignored. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
We use miguri name for this parameter in other places. So make naming more consitent. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Michal Privoznik 提交于
Direct migration should work if *perform3 is present but *perform is not. This is situation when driver migration is implemented after new version of driver function is introduced. We should not be forced to support old version too as its parameter space is subspace of newer one.
-
由 Nikolay Shirokovskiy 提交于
This is more structured code so it will be easier to add branch for _PARAMS protocol here. It is not a pure refactoring strictly speaking as we remove scenarios for broken cases when driver defines V3 feature and implements perform function. So it is additionally a more solid code. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
Refactor dconnuri local server URI check to common API. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
由 Nikolay Shirokovskiy 提交于
'useParams' parameter usage is an example of control coupling. Most of the work inside the function is done differently except for the uri check. Lets split this function into two, one with extensible parameters set and one with hardcoded parameter set. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
- 09 10月, 2015 3 次提交
-
-
由 Michal Privoznik 提交于
The internal representation of a JSON array counts the items in size_t. However, for some reason, when asking for the count it's reported as int. Firstly, we need the function to return a signed type as it's returning -1 on an error. But, not every system has integer the same size as size_t. Therefore, lets return ssize_t. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Andrea Bolognani 提交于
Commit 4e803227 used $(builddir) in the header search path to fix a build issue; however, $(builddir) is not defined by old autoconf versions such as the one available in CentOS 5, resulting in the following error: cc1: error: /util: No such file or directory make[3]: *** [libvirt_driver_la-fdstream.lo] Error 1 Since $(builddir) is defined to always be '.', just use that value directly instead.
-
由 Andrea Bolognani 提交于
Since a9fe6203, we are generating virkeymaps.h at build time; however, we are not including $(builddir)/util in the header search path, so when doing a VPATH build the compiler is unable to locate the file. make[2]: Entering directory `/home/jenkins/libvirt/systems/libvirt-fedora-20/build/src' GEN util/virkeymaps.h ... CC util/libvirt_util_la-virkeycode.lo CC util/libvirt_util_la-virkeyfile.lo CC util/libvirt_util_la-virlockspace.lo CC util/libvirt_util_la-virlog.lo ../../src/util/virkeycode.c:27:24: fatal error: virkeymaps.h: No such file or directory #include "virkeymaps.h" ^ compilation terminated.
-
- 08 10月, 2015 2 次提交
-
-
由 Maxim Nestratov 提交于
Remove unused definitions, functions and structure fields. Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
-
由 John Ferlan 提交于
Cleanup calls to virStorageBackendCopyToFD a bit. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-