- 02 4月, 2014 1 次提交
-
-
由 Eric Blake 提交于
With this patch, all information related to a host resource in a storage file backing chain now lives in util/virstoragefile.h. The next step will be to consolidate various places that have been tracking backing chain details to all use a common struct. The changes to tools/Makefile.am were made necessary by the fact that virstorageencryption includes uses of libxml, and is now pulled in by inclusion from virstoragefile.h. No additional libraries are linked into the final image, and in comparison, the build of the setuid library in src/Makefile.am already was using LIBXML_CFLAGS via AM_CFLAGS. * src/conf/domain_conf.h (virDomainDiskSourceDef): Move... * src/util/virstoragefile.h (virStorageSource): ...and rename. * src/conf/domain_conf.c (virDomainDiskSourceDefClear) (virDomainDiskAuthClear): Adjust clients. * tools/Makefile.am (virt_login_shell_CFLAGS) (virt_host_validate_CFLAGS): Add libxml headers. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 31 3月, 2014 2 次提交
-
-
由 Eric Blake 提交于
'virsh help event' included a summary line "event - (null)" due to a misnamed info field. * tools/virsh-domain.c (info_event): Use correct name. * tools/virsh-network.c (info_network_event): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Shanzhi Yu 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1080859 Snapshot type should be no, internal, or external.
-
- 27 3月, 2014 1 次提交
-
-
由 Li Yang 提交于
Use 'virsh list domain --title' option can get domain's title, not description, the original help information 'show short domain description' will confuse users, so modify it to 'show domain title' Signed-off-by: NLi Yang <liyang.fnst@cn.fujitsu.com>
-
- 25 3月, 2014 2 次提交
-
-
由 Ján Tomko 提交于
-
由 Qiao Nuohan 提交于
This patch adds "[--format] <string>" to "virsh dump --memory-only", which is changed to use the new virDomainCoreDumpWithFormat API. Signed-off-by: NQiao Nuohan <qiaonuohan@cn.fujitsu.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 21 3月, 2014 3 次提交
-
-
由 Chegu Vinod 提交于
Busy enterprise workloads hosted on large sized VM's tend to dirty memory faster than the transfer rate achieved via live guest migration. Despite some good recent improvements (& using dedicated 10Gig NICs between hosts) the live migration may NOT converge. Recently support was added in qemu (version 1.6) to allow a user to choose if they wish to force convergence of their migration via a new migration capability : "auto-converge". This feature allows for qemu to auto-detect lack of convergence and trigger a throttle-down of the VCPUs. This patch includes the libvirt support needed to trigger this feature. (Testing is in progress) Signed-off-by: NChegu Vinod <chegu_vinod@hp.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Eric Blake 提交于
When listening for a subset of monitor events, it can be tedious to register for each event name in series; nicer is to register for multiple events in one go. Implement a flag to use regex interpretation of the event filter. While at it, prove how much I hate the shift key, by adding a way to filter for 'shutdown' instead of 'SHUTDOWN'. :) * include/libvirt/libvirt-qemu.h (virConnectDomainQemuMonitorEventRegisterFlags): New enum. * src/libvirt-qemu.c (virConnectDomainQemuMonitorEventRegister): Document flags. * tools/virsh-domain.c (cmdQemuMonitorEvent): Expose them. * tools/virsh.pod (qemu-monitor-event): Document this. * src/conf/domain_event.c (virDomainQemuMonitorEventStateRegisterID): Add flags. (virDomainQemuMonitorEventFilter): Handle regex, and optimize client side. (virDomainQemuMonitorEventCleanup): Clean up regex. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Any new API deserves a good virsh wrapper :) qemu-monitor-event [<domain>] [<event>] [--pretty] [--loop] [--timeout <number>] Very similar to the previous work on 'virsh event'. For an example session: $ virsh -c qemu:///system qemu-monitor-event --event SHUTDOWN& $ virsh -c qemu:///system start f18-live Domain f18-live started $ virsh -c qemu:///system destroy f18-live Domain f18-live destroyed event SHUTDOWN at 1391212552.026544 for domain f18-live: (null) events received: 1 [1]+ Done virsh -c qemu:///system qemu-monitor-event --event SHUTDOWN $ * tools/virsh-domain.c (cmdQemuMonitorEvent): New command. * tools/virsh.pod (qemu-monitor-event): Document it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 19 3月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
s/of value/value of/ Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 18 3月, 2014 4 次提交
-
-
由 Daniel P. Berrange 提交于
Any source file which calls the logging APIs now needs to have a VIR_LOG_INIT("source.name") declaration at the start of the file. This provides a static variable of the virLogSource type. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Michal Privoznik 提交于
We allow translation from no_bandwidth to has_bandwidth for a vnic. However, going in the opposite direction is not implemented. It's not limitation of the API rather than internal implementation. The problem is, we correctly detect that user hasn't specified any outbound (say he wants to clear out outbound). However, this gets overwritten by current vnic outbound settings. Then, virNetDevBandwidthSet doesn't change anything. We need to stop overwriting the outbound if users don't want us to. Same applies for inbound. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Martin Kletzander 提交于
Commit a1cbe4b5 added a check for spaces around assignments and this patch extends it to checks for spaces around '=='. One exception is virAssertCmpInt where comma after '==' is acceptable (since it is a macro and '==' is its argument). Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
Introducing keepalive similarly to Guannan around 2 years ago. Since we want to introduce keepalive for every connection, it makes sense to wrap the connecting function into new virsh one that can deal keepalive as well. Function vshConnect() is now used for connecting and keepalive added in that function (if possible) helps preventing long waits e.g. while nework goes down during migration. This patch also adds the options for keepalive tuning into virsh and fails connecting only when keepalives are explicitly requested and cannot be set (whether it is due to missing support in connected driver or remote server). If not explicitely requested, a debug message is printed (hence the addition to virsh-optparse test). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1073506 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=822839Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 14 3月, 2014 1 次提交
-
-
由 Laine Stump 提交于
These are never seen externally, only passed into libvirt APIs, so in practice this makes no real difference, but it's good to be consistent.
-
- 10 3月, 2014 3 次提交
-
-
由 Ján Tomko 提交于
Some of these are leftovers from renaming the files, others are just typos. Also introduce an ugly awk script to enforce this.
-
由 Roman Bogorodskiy 提交于
vshRunConsole() uses virCondWait() which is a wrapper around pthread_cond_wait(). On FreeBSD, pthread_cond_wait needs mutex to be locked, otherwise it immediately fails with EPERM. On Linux, the behaviour in this case is undefined. So lock the mutex before calling virCondWait().
-
由 Martin Kletzander 提交于
Man page, help output and also parsing is sorted in order to find options smoothly. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 06 3月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Coverity spotted that 'nfdlist' (ssize_t) could be -1, but that we were using 'i' (size_t) to iterate over the list at cleanup, with crashing results because it promotes to a really big unsigned number. * tools/virt-login-shell.c (main): Avoid treating -1 as unsigned. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 05 3月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
If a user specifies the pool explicitly, we should make sure to point out that it's inactive instead of falling back to lookup by key/path and failing at the end. Also if the pool isn't found there's no use in continuing the lookup. This changes the error in case the user-selected pool is inactive from: $ virsh vol-upload --pool inactivepool --vol somevolname volcontents error: failed to get vol 'somevolname' error: Storage volume not found: no storage vol with matching path somevolname To a more descriptive: $ virsh vol-upload --pool inactivepool --vol somevolname volcontents error: pool 'inactivepool' is not active And in case a user specifies an invalid pool from: $ virsh vol-upload --pool invalidpool --vol somevolname volcontents error: failed to get pool 'invalidpool' error: failed to get vol 'somevolname', specifying --pool might help error: Storage volume not found: no storage vol with matching path somevolname To something less confusing: $ virsh vol-upload --pool invalidpool --vol somevolname volcontents error: failed to get pool 'invalidpool' error: Storage pool not found: no storage pool with matching name 'invalidpool'
-
- 04 3月, 2014 5 次提交
-
-
由 Eric Blake 提交于
'virsh lxc-enter-namespace' does not have a way to reflect exit status to the caller in single-command mode, but we might as well at least report the exit status. Prior to this patch, $ virsh -c lxc:/// lxc-enter-namespace shell /bin/sh 'exit 3'; echo $? 1 now it gives some details: $ virsh -c lxc:/// lxc-enter-namespace shell /bin/sh -c 'exit 3'; echo $? error: internal error: Child process (31557) unexpected exit status 3 1 Also useful: $ virsh -c lxc:/// lxc-enter-namespace shell /bin/sh -c 'kill $$'; echo $? error: internal error: Child process (31585) unexpected fatal signal 15 1 * tools/virsh-domain.c (cmdLxcEnterNamespace): Avoid magic numbers. Dispatch any error. * tools/virsh.pod: Document that non-zero exit status is collapsed. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
virt-login-shell was exiting with status 0, regardless of what the wrapped shell returned. This is unkind to users; we should behave more like env(1), nice(1), su(1), and other wrapper programs, by preserving the invoked application's status (which includes the distinction between death due to signal vs. normal death). * tools/virt-login-shell.c (main): Pass through child exit status. * tools/virt-login-shell.pod: Document exit status. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Note that 'virsh lxc-enter-namespace' must double-fork, for two reasons: some namespaces can only be done from a single thread, while virsh is multithreaded; and because virsh can be run in batch mode where we must not corrupt the namespace of that execution upon return from the subsidiary command. When virt-login-shell was first written, it blindly copied from 'virsh lxc-enter-namespace', including the double-fork. But neither of the reasons for double forking apply to virt-login-shell (we are single-threaded, and we have nothing to do after the child completes that would require us to preserve a namespace), so we can simplify life by using a single fork. In turn, this will make it easier for a future patch to pass the child's exit status on to the invoking shell. In flattening to a single fork, note that closing the fds must be done after fork, because the parent process still needs to use fds to control the virConnectPtr; meanwhile, chdir can be done prior to forking (in fact, it's easier to report errors on anything attempted before forking). * tools/virt-login-shell.c (main): Single rather than double fork. (virLoginShellFini): Delete, by inlining actions instead. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
The old semantics of virFork() violates the priciple of good usability: it requires the caller to check the pid argument after use, *even when virFork returned -1*, in order to properly abort a child process that failed setup done immediately after fork() - that is, the caller must call _exit() in the child. While uses in virfile.c did this correctly, uses in 'virsh lxc-enter-namespace' and 'virt-login-shell' would happily return from the calling function in both the child and the parent, leading to very confusing results. [Thankfully, I found the problem by inspection, and can't actually trigger the double return on error without an LD_PRELOAD library.] It is much better if the semantics of virFork are impossible to abuse. Looking at virFork(), the parent could only ever return -1 with a non-negative pid if it misused pthread_sigmask, but this never happens. Up until this patch series, the child could return -1 with non-negative pid if it fails to set up signals correctly, but we recently fixed that to make the child call _exit() at that point instead of forcing the caller to do it. Thus, the return value and contents of the pid argument are now redundant (a -1 return now happens only for failure to fork, a child 0 return only happens for a successful 0 pid, and a parent 0 return only happens for a successful non-zero pid), so we might as well return the pid directly rather than an integer of whether it succeeded or failed; this is also good from the interface design perspective as users are already familiar with fork() semantics. One last change in this patch: before returning the pid directly, I found cases where using virProcessWait unconditionally on a cleanup path of a virFork's -1 pid return would be nicer if there were a way to avoid it overwriting an earlier message. While such paths are a bit harder to come by with my change to a direct pid return, I decided to keep the virProcessWait change in this patch. * src/util/vircommand.h (virFork): Change signature. * src/util/vircommand.c (virFork): Guarantee that child will only return on success, to simplify callers. Return pid rather than status, now that the situations are always the same. (virExec): Adjust caller, also avoid open-coding process death. * src/util/virprocess.c (virProcessWait): Tweak semantics when pid is -1. (virProcessRunInMountNamespace): Adjust caller. * src/util/virfile.c (virFileAccessibleAs, virFileOpenForked) (virDirCreate): Likewise. * tools/virt-login-shell.c (main): Likewise. * tools/virsh-domain.c (cmdLxcEnterNamespace): Likewise. * tests/commandtest.c (test23): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Right now, a caller waiting for a child process either requires the child to have status 0, or must use WIFEXITED() and friends itself. But in many cases, we want the middle ground of treating fatal signals as an error, and directly accessing the normal exit value without having to use WEXITSTATUS(), in order to easily detect an expected non-zero exit status. This adds the middle ground to the low-level virProcessWait; the next patch will add it to virCommand. * src/util/virprocess.h (virProcessWait): Alter signature. * src/util/virprocess.c (virProcessWait): Add parameter. (virProcessRunInMountNamespace): Adjust caller. * src/util/vircommand.c (virCommandWait): Likewise. * src/util/virfile.c (virFileAccessibleAs): Likewise. * src/lxc/lxc_container.c (lxcContainerHasReboot) (lxcContainerAvailable): Likewise. * daemon/libvirtd.c (daemonForkIntoBackground): Likewise. * tools/virt-login-shell.c (main): Likewise. * tools/virsh-domain.c (cmdLxcEnterNamespace): Likewise. * tests/testutils.c (virtTestCaptureProgramOutput): Likewise. * tests/commandtest.c (test23): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 01 3月, 2014 2 次提交
-
-
由 Eric Blake 提交于
Similar to our event-test demo program, it's nice to be able to have a mode where we can sniff all events at once, rather than having to spawn multiple virsh in parallel with one for each event type. (Can I just say our RegisterAny design is lousy? The fact that the majority of our callback pointers have a function signature with the opaque data in a different position, and that we have to cast the function signature before registering it, makes it hard to write a generic callback function; we have to write one for every type of event id. Life would have been easier if we had designed the callback as a fixed signature with a void* and size parameter, and then allowed the caller to downcast the void* to a particular struct for data specific to their callback id, where we could have then had a single function with a switch statement for each event id, and register that one function for all types of events. It would also be nicer if the callback functions knew which callbackID was being used when invoking that callback, so that I could use a common data structure among all registrations instead of having to create an array of one data per callback. But I really don't want to go add yet another event API design.) * tools/virsh-domain.c (cmdEvent): Add --all parameter; convert all callbacks to support shared counter. * tools/virsh.pod (event): Document it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Earlier, I added 'virsh event' for lifecycle events, to get the concept approved; this patch finishes the support for all other events, although the user still has to register for one event type at a time. A future patch may add an --all parameter to make it possible to register for all events through a single call. * tools/virsh-domain.c (vshDomainEventWatchdogToString) (vshDomainEventIOErrorToString, vshGraphicsPhaseToString) (vshGraphicsAddressToString, vshDomainBlockJobStatusToString) (vshDomainEventDiskChangeToString) (vshDomainEventTrayChangeToString, vshEventGenericPrint) (vshEventRTCChangePrint, vshEventWatchdogPrint) (vshEventIOErrorPrint, vshEventGraphicsPrint) (vshEventIOErrorReasonPrint, vshEventBlockJobPrint) (vshEventDiskChangePrint, vshEventTrayChangePrint) (vshEventPMChangePrint, vshEventBalloonChangePrint) (vshEventDeviceRemovedPrint): New helper routines. (cmdEvent): Support full array of event callbacks. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 28 2月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
Compare: # virsh domblkstat freebsd hdd error: Failed to get block stats freebsd hdd error: invalid argument: invalid path: hdd with: # virsh domblkstat freebsd hdd error: Failed to get block stats for domain 'freebsd' device 'hdd' error: invalid argument: invalid path: hdd Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 27 2月, 2014 1 次提交
-
-
由 Yuri Chornoivan 提交于
Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 26 2月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
If user wants to grep some info from domain, e.g. disk paths: # virsh -q domblklist win7 | awk '{print $2}' Source /var/lib/libvirt/images/windows.qcow2 /home/zippy/work/tmp/en_windows_7_professional_x64_dvd_X15-65805.iso while with my change: # virsh -q domblklist win7 | awk '{print $2}' /var/lib/libvirt/images/windows.qcow2 /home/zippy/work/tmp/en_windows_7_professional_x64_dvd_X15-65805.iso We don't print table header in other commands, like list. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 25 2月, 2014 5 次提交
-
-
由 Chen Hanxiao 提交于
Fix a -Werror=maybe-uninitialized issue. Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Eric Blake 提交于
I noticed this while shortening switch statements via VIR_ENUM. Basically, the only ways virAsprintf can fail are if we pass a bogus format string (but we're not THAT bad) or if we run out of memory (but it already warns on our behalf in that case). Throw away the cruft that tries too hard to diagnose a printf failure. * tools/virsh-volume.c (cmdVolList): Simplify. * tools/virsh-pool.c (cmdPoolList): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Dan Berrange suggested that using VIR_ENUM_IMPL is more compact than open-coding switch statements, and still just as forceful at making us remember to update lists if we add enum values in the future. Make this change throughout virsh. Sure enough, doing this change caught that we missed at least VIR_STORAGE_VOL_NETDIR. * tools/virsh-domain-monitor.c (vshDomainIOErrorToString) (vshDomainControlStateToString, vshDomainStateToString) (vshDomainStateReasonToString): Change switch to enum lookup. (cmdDomControl, cmdDominfo): Update caller. * tools/virsh-domain.c (vshDomainVcpuStateToString) (vshDomainEventToString, vshDomainEventDetailToString): Change switch to enum lookup. (vshDomainBlockJobToString, vshDomainJobToString): New functions. (cmdVcpuinfo, cmdBlockJob, cmdDomjobinfo, cmdEvent): Update callers. * tools/virsh-network.c (vshNetworkEventToString): Change switch to enum lookup. * tools/virsh-pool.c (vshStoragePoolStateToString): New function. (cmdPoolList, cmdPoolInfo): Update callers. * tools/virsh-volume.c (vshVolumeTypeToString): Change switch to enum lookup. (cmdVolInfo, cmdVolList): Update callers. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Ján Tomko 提交于
Change the logic of the function to return false by default and move the freeing of the buffer to the cleanup section. https://bugzilla.redhat.com/show_bug.cgi?id=1067338
- 24 2月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
I've noticed that in some cases systemd was quick enough and even if libvirt-guests.service is marked to be started after the libvirtd.service my guests were not resumed as libvirt-guests.sh failed to connect. This is because of a simple fact: systemd correctly starts libvirt-guests after it execs libvirtd. However, the daemon is not able to accept connections right from the start. It's doing some initialization which may take ages. This problem is not limited to systemd only, indeed. Any init system that is able to startup services in parallel (e.g. OpenRC) may run into this situation. The fix is to try connecting not only once, but continuously a few times with a small sleep in between tries. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 21 2月, 2014 4 次提交
-
-
由 Eric Blake 提交于
Add 'virsh net-event --list' and 'virsh net-event [net] --event=name [--loop] [--timeout]'. Very similar to 'virsh event'. * tools/virsh.pod (net-event): Document new command. * tools/virsh-network.c (vshNetworkEventToString, vshNetEventData) (vshEventLifecyclePrint, cmdNetworkEvent): New struct and functions. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Add 'virsh event --list' and 'virsh event [dom] --event=name [--loop] [--timeout]'. Borrows somewhat from event-test.c, but defaults to a one-shot notification, and takes advantage of the event loop integration to allow Ctrl-C to interrupt the wait for an event. For now, this just does lifecycle events. * tools/virsh.pod (event): Document new command. * tools/virsh-domain.c (vshDomainEventToString) (vshDomainEventDetailToString, vshDomEventData) (vshEventLifecyclePrint, cmdEvent): New struct and functions. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
I plan to add 'virsh event' to virsh-domain.c and 'virsh net-event' to virsh-network.c; but as they will share quite a bit of common boilerplate, it's better to set that up now in virsh.c. * tools/virsh.h (_vshControl): Add fields. (vshEventStart, vshEventWait, vshEventDone, vshEventCleanup): New prototypes. * tools/virsh.c (vshEventFd, vshEventOldAction, vshEventInt) (vshEventTimeout): New helper variables and functions. (vshEventStart, vshEventWait, vshEventDone, vshEventCleanup): Implement new functions. (vshInit, vshDeinit, main): Manage event timeout. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Several virsh commands ask for a --timeout parameter in seconds, then use it to control interfaces that operate on millisecond limits; I also plan on adding a 'virsh event' command that also does this. Factor this into a common function. * tools/virsh.h (vshCommandOptTimeoutToMs): New prototype. * tools/virsh.c (vshCommandOptTimeoutToMs): New function. * tools/virsh-domain.c (cmdBlockCommit, cmdBlockCopy) (cmdBlockPull, cmdMigrate): Use it. (vshWatchJob): Adjust timeout scale. Signed-off-by: NEric Blake <eblake@redhat.com>
-