- 13 11月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
According to comments in parsing functions, optional options should be specified *after* required ones. It makes sense and help output looks cleaner. The only exceptions are options with type == VSH_OT_ARGV. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 20 8月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
And add a syntax-check for '){$'. It's not perfect, but better than nothing. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 18 7月, 2014 1 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1087104 Commit id 'c6212539' explicitly allowed a negative value to be used for offset and length as a shorthand for the largest value after commit id 'f18c02ec' modified virStrToLong_ui() to essentially disallow a negative value. However, allowing a negative value for offset ONLY worked if the negative value was -1 since the eventual lseek() does allow a -1 to mean the end of the file. Providing other negative values resulted in errors such as: $ virsh vol-download --pool default qcow3-vol2 /home/vm-images/raw \ --offset -2 --length -1000 error: cannot download from volume qcow3-vol2 error: Unable to seek /home/vm-images/qcow3-vol2 to 18446744073709551614: Invalid argument $ Thus, it seems unreasonable to expect or allow a negative value for offset since the only benefit is to lseek() to the end of the file and then only take advantage of how the OS would handle such a seek. For the purposes of upload or download of volume data, that seems to be a no-op. Therefore, disallow a negative value for offset. Additionally, modify the man page for vol-upload and vol-download to provide more details regarding the valid values for both offset and length.
-
- 12 6月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
To follow the new semantics of the vshCommandOptToU* functions convert this one to reject negative numbers too. To allow using -1 for "maximum" semantics for the vol-*load two bandwidth functions that use this helper introduce vshCommandOptULongLongWrap.
-
- 02 6月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
When looking up storage volumes virsh uses multiple lookup steps. Some of the steps don't require a pool name specified. This resulted into a possibility that a volume would be part of a different pool than the user specified: Let's have a /var/lib/libvirt/images/test.qcow image in the 'default' pool and a second pool 'emptypool': Currently we'd return: $ virsh vol-info --pool emptypool /var/lib/libvirt/images/test.qcow Name: test.qcow Type: file Capacity: 100.00 MiB Allocation: 212.00 KiB After the fix: $ tools/virsh vol-info --pool emptypool /var/lib/libvirt/images/test.qcow error: Requested volume '/var/lib/libvirt/images/test.qcow' is not in pool 'emptypool' Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1088667
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 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.
-
- 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'
-
- 25 2月, 2014 2 次提交
-
-
由 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>
-
- 26 11月, 2013 1 次提交
-
-
由 Eric Blake 提交于
In the 'directory' and 'netfs' storage pools, a user can see both 'file' and 'dir' storage volume types, to know when they can descend into a subdirectory. But in a network-based storage pool, such as the upcoming 'gluster' pool, we use 'network' instead of 'file', and did not have any counterpart for a directory until this patch. Adding a new volume type 'network-dir' is better than reusing 'dir', because it makes it clear that the only way to access 'network' volumes within that container is through the network mounting (leaving 'dir' for something accessible in the local file system). * include/libvirt/libvirt.h.in (virStorageVolType): Expand enum. * docs/formatstorage.html.in: Document it. * docs/schemasa/storagevol.rng (vol): Allow new value. * src/conf/storage_conf.c (virStorageVol): Use new value. * src/qemu/qemu_command.c (qemuBuildVolumeString): Fix client. * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Likewise. * tools/virsh-volume.c (vshVolumeTypeToString): Likewise. * src/storage/storage_backend_fs.c (virStorageBackendFileSystemVolDelete): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 21 11月, 2013 1 次提交
-
-
由 Eric Blake 提交于
Most of our code base uses space after comma but not before; fix the remaining uses before adding a syntax check. * tests/sysinfotest.c: Consistently use commas. * tests/viratomictest.c: Likewise. * tests/vircgroupmock.c: Likewise. * tools/virsh-domain.c: Likewise. * tools/virsh-volume.c: Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 13 11月, 2013 2 次提交
-
-
由 Peter Krempa 提交于
There were two separate places with that were stringifying type of a volume. One of the places was out of sync with types implemented upstream. To avoid such problems in the future, this patch adds a common function to convert the type to string and reuses it across the two said places.
-
由 Peter Krempa 提交于
Add an extra space before the first column as we have when listing domains. Previous output: $ virsh vol-list glusterpool Name Path ----------------------------------------- asdf gluster://gluster-node-1/gv0/asdf c gluster://gluster-node-1/gv0/c cd gluster://gluster-node-1/gv0/cd $ virsh vol-list glusterpool --details Name Path Type Capacity Allocation ---------------------------------------------------------------------- asdf gluster://gluster-node-1/gv0/asdf unknown 0.00 B 0.00 B c gluster://gluster-node-1/gv0/c unknown 16.00 B 16.00 B cd gluster://gluster-node-1/gv0/cd unknown 0.00 B 0.00 B New output: $ virsh vol-list glusterpool Name Path ------------------------------------------------------------------------------ asdf gluster://gluster-node-1/gv0/asdf c gluster://gluster-node-1/gv0/c cd gluster://gluster-node-1/gv0/cd $ virsh vol-list glusterpool --details Name Path Type Capacity Allocation ------------------------------------------------------------------------ asdf gluster://gluster-node-1/gv0/asdf unknown 0.00 B 0.00 B c gluster://gluster-node-1/gv0/c unknown 16.00 B 16.00 B cd gluster://gluster-node-1/gv0/cd unknown 0.00 B 0.00 B
-
- 30 9月, 2013 1 次提交
-
-
由 Hongwei Bi 提交于
Check return value of virStreamNew when called by cmdVolUpload and cmdVolDownload.
-
- 11 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 04 6月, 2013 1 次提交
-
-
由 Jiri Denemark 提交于
Our documentation says a pool may be referenced by its name or UUID anywhere if it makes sense (pool-name and pool-uuid are the only exceptions). However, vol-create and vol-create-as commands did not obey this.
-
- 24 5月, 2013 1 次提交
-
-
由 Osier Yang 提交于
Introduced by commit 1daa4ba3. vshCommandOptStringReq returns 0 on *success* or the option is not required && not present, both are right result. Error out when returning 0 is not correct. the caller, it doesn't have to check wether it
-
- 02 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
The source code base needs to be adapted as well. Some files include virutil.h just for the string related functions (here, the include is substituted to match the new file), some include virutil.h without any need (here, the include is removed), and some require both.
-
- 30 4月, 2013 1 次提交
-
-
由 Ján Tomko 提交于
Mention file/volume contents instead of just 'file'/'volume'. Also change Download->download in vol-download help, to be consistent with other volume commands. https://bugzilla.redhat.com/show_bug.cgi?id=955537
-
- 22 3月, 2013 1 次提交
-
-
由 Ján Tomko 提交于
Don't print the pool option name if it's null. Before: virsh # vol-name vol error: failed to get vol 'vol', specifying --(null) might help error: Storage volume not found: no storage vol with matching path vol After: virsh # vol-name vol error: failed to get vol 'vol' error: Storage volume not found: no storage vol with matching path vol Bug: https://bugzilla.redhat.com/show_bug.cgi?id=924571
-
- 15 3月, 2013 1 次提交
-
-
由 Martin Kletzander 提交于
After we switched to C99 initialization, I noticed there were many places where the specification of .flags parameter differed. After going through many options and deciding whether to unify the initialization to be '.flags = 0' or '.flags = VSH_OFLAG_NONE', I realized both can be removed and it makes the code easier to go through.
-
- 13 2月, 2013 2 次提交
-
-
由 Michal Privoznik 提交于
-
由 Michal Privoznik 提交于
-
- 04 2月, 2013 2 次提交
-
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
-
- 17 1月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 21 12月, 2012 4 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 07 12月, 2012 1 次提交
-
-
由 Ján Tomko 提交于
Add --prealloc-metadata flag to these commands: vol-clone vol-create vol-create-as vol-create-from
-
- 02 11月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
The libvirt coding standard is to use 'function(...args...)' instead of 'function (...args...)'. A non-trivial number of places did not follow this rule and are fixed in this patch. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 21 9月, 2012 1 次提交
-
-
由 Eric Blake 提交于
https://www.gnu.org/licenses/gpl-howto.html recommends that the 'If not, see <url>.' phrase be a separate sentence. * tests/securityselinuxhelper.c: Remove doubled line. * tests/securityselinuxtest.c: Likewise. * globally: s/; If/. If/
-
- 13 9月, 2012 1 次提交
-
-
由 Osier Yang 提交于
And redundant error resetting. Pushed under trivial rule.
-
- 10 9月, 2012 1 次提交
-
-
由 Osier Yang 提交于
tools/virsh-volume.c: * vshStorageVolSorter to sort storage vols by name * vshStorageVolumeListFree to free the volume objects list * vshStorageVolumeListCollect to collect the volume objects, trying to use new API first, fall back to older APIs if it's not supported.
-
- 31 8月, 2012 1 次提交
-
-
由 Peter Krempa 提交于
Now that vshCommandRun() checks for the connection automaticaly, remove all of the redundant checks in the code. vshConnectionUsability() no longer needs to be exported and this patch marks it static.
-
- 21 8月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Last of the file splits. * tools/virsh-volume.h: New file. * tools/Makefile.am (virsh_SOURCES): Build it. * tools/virsh.c: Use new header. * tools/virsh-volume.c: Likewise. (vshCommandOptVolBy): Fix flag usage.
-
- 20 8月, 2012 1 次提交
-
-
由 Eric Blake 提交于
Convert the exported items in virsh.h to use a common 'vsh' prefix. * tools/virsh.h (VIRSH_MAX_XML_FILE): Rename... (VSH_MAX_XML_FILE): ...and parenthesize. (DIFF_MSEC, CTRL_CLOSE_BRACKET): Delete. (vshUsage, vshInit, vshDeinit, vshParseArgv): Remove prototype. (editWriteToTempFile, editFile, editReadBackFile, prettyCapacity) (virshReportError): Rename... (vshEditWriteToTempFile, vshEditFile, vshEditReadBackFile) (vshPrettyCapacity, vshReportError): ...into vsh namespace. (jobWatchTimeoutFunc): Move to virsh-domain.c. * tools/virsh.c (vshCommandRun): Inline former DIFF_MSEC. (main): Inline former CTRL_CLOSE_BRACKET. (vshUsage, vshInit, vshDeinit, vshParseArgv): Make static. (prettyCapacity, virshReportError, editWriteToTempFile, editFile): Fix naming, and adjust usage. (vshAskReedit, vshCommandRun, vshEventLoop, vshInit): Adjust usage. * tools/virsh-domain.c (cmdAttachDevice, cmdCPUCompare) (cmdCPUBaseline, cmdCreate, cmdDefine, cmdDetachDevice) (cmdUpdateDevice, cmdDesc, cmdUndefine, cmdStart, cmdVcpucount) (cmdAttachDevice, cmdDomjobinfo): Likewise. * tools/virsh-edit.c (do): Likewise. * tools/virsh-interface.c (cmdInterfaceDefine): Likewise. * tools/virsh-network.c (cmdNetworkCreate, cmdNetworkDefine): Likewise. * tools/virsh-nodedev.c (cmdNodeDeviceCreate): Likewise. * tools/virsh-nwfilter.c (cmdNWFilterDefine): Likewise. * tools/virsh-pool.c (cmdPoolCreate, cmdPoolDefine) (cmdPoolDiscoverSources, cmdPoolList): Likewise. * tools/virsh-secret.c (cmdSecretDefine): Likewise. * tools/virsh-snapshot.c (cmdSnapshotCreate, vshSnapshotCreate) (vshLookupSnapshot, cmdSnapshotEdit, cmdSnapshotCurrent) (vshGetSnapshotParent): Likewise. * tools/virsh-volume.c (cmdVolCreate, cmdVolCreateFrom) (cmdVolInfo, cmdVolList): Likewise.
-
- 26 7月, 2012 1 次提交
-
-
由 Osier Yang 提交于
* virsh-domain-monitor.c: Add domMonitoringCmds * virsh-domain.c: Add domManagementCmds * virsh-host.c: Add hostAndHypervisorCmds * virsh-interface.c: Add ifaceCmds * virsh-network.c: Add networkCmds * virsh-nodedev.c: Add nodedevCmds * virsh-nwfilter.c: Add nwfilterCmds * virsh-pool.c: Add storagePoolCmds * virsh-secret.c: Add secretCmds * virsh-snapshot.c: Add snapshotCmds * virsh-volume.c: Add storageVolCmds * virsh.c: Remove all the above *Cmds.
-