- 18 12月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
Currently, 'vol-resize --allocate' allocates new space at the vol->capacity offset. But the vol->capacity is not necessarily the same as vol->allocation. For instance:. [root@localhost ~]# virsh vol-list --pool tmp-pool --details Name Path Type Capacity Allocation ------------------------------------------------------------- tmp-vol /root/tmp-pool/tmp-vol file 1.00 GiB 1.00 GiB [root@localhost ~]# virsh vol-resize tmp-vol --pool tmp-pool 2G [root@localhost ~]# virsh vol-list --pool tmp-pool --details Name Path Type Capacity Allocation ------------------------------------------------------------- tmp-vol /root/tmp-pool/tmp-vol file 2.00 GiB 1.00 GiB So, if we want to allocate more bytes, so the file is say 3G big, the real allocated size is 2G actually: [root@localhost ~]# virsh vol-resize tmp-vol --pool tmp-pool 3G --allocate [root@localhost ~]# virsh vol-list --pool tmp-pool --details Name Path Type Capacity Allocation ------------------------------------------------------------- tmp-vol /root/tmp-pool/tmp-vol file 3.00 GiB 2.00 GiB This commit uses the correct vol->allocation instead of incorrect vol->capacity, so the output of the commands above looks like this: [root@localhost ~]# virsh vol-resize tmp-vol --pool tmp-pool 3G --allocate [root@localhost ~]# virsh vol-list --pool tmp-pool --details Name Path Type Capacity Allocation ------------------------------------------------------------- tmp-vol /root/tmp-pool/tmp-vol file 3.00 GiB 3.00 GiB Moreover, if the '--alocate' flag was used, we must update the vol->allocation member in storageVolResize API too, not just vol->capacity. Reported-by: NWang Sen <wangsen@linux.vnet.ibm.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 04 12月, 2013 1 次提交
-
-
由 John Ferlan 提交于
The storageRegister() didn't check the return from the virRegisterStorageDriver() like other callers did, so Coverity flagged it. Just check the return and handle.
-
- 22 11月, 2013 1 次提交
-
-
由 Eric Blake 提交于
$ touch /var/lib/libvirt/images/'a<b>c' $ virsh pool-refresh default $ virsh vol-dumpxml 'a<b>c' default | head -n2 <volume> <name>a<b>c</name> Oops. That's not valid XML. And when we fix the XML generation, it fails RelaxNG validation. I'm also tired of seeing <key>(null)</key> in the example output for volume xml; while we used NULLSTR() to avoid a NULL deref rather than relying on glibc's printf extension behavior, it's even better if we avoid the issue in the first place. But this requires being careful that we don't invalidate any storage backends that were relying on key being unassigned during virStoragVolCreateXML[From]. I would have split this into two patches (one for escaping, one for avoiding <key>(null)</key>), but since they both end up touching a lot of the same test files, I ended up merging it into one. Note that this patch allows pretty much any volume name that can appear in a directory (excluding . and .. because those are special), but does nothing to change the current (unenforced) RelaxNG claim that pool names will consist only of letters, numbers, _, -, and +. Tightening the C code to match RelaxNG patterns and/or relaxing the grammar to match the C code for pool names is a task for another day (but remember, we DID recently tighten C code for domain names to exclude a leading '.'). * src/conf/storage_conf.c (virStoragePoolSourceFormat) (virStoragePoolDefFormat, virStorageVolTargetDefFormat) (virStorageVolDefFormat): Escape user-controlled strings. (virStorageVolDefParseXML): Parse key, for use in unit tests. * src/storage/storage_driver.c (storageVolCreateXML) (storageVolCreateXMLFrom): Ensure parsed key doesn't confuse volume creation. * docs/schemas/basictypes.rng (volName): Relax definition. * tests/storagepoolxml2xmltest.c (mymain): Test it. * tests/storagevolxml2xmltest.c (mymain): Likewise. * tests/storagepoolxml2xmlin/pool-dir-naming.xml: New file. * tests/storagepoolxml2xmlout/pool-dir-naming.xml: Likewise. * tests/storagevolxml2xmlin/vol-file-naming.xml: Likewise. * tests/storagevolxml2xmlout/vol-file-naming.xml: Likewise. * tests/storagevolxml2xmlout/vol-*.xml: Fix fallout. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 08 10月, 2013 2 次提交
-
-
由 Michal Privoznik 提交于
We currently have other error codes in singular form, e.g. VIR_ERR_NETWORK_EXIST. Cleanup the previous patch to match the form. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Hongwei Bi 提交于
I created a storage volume(eg: test) from a storage pool(eg:vg10) using the following command:"virsh vol-create-as --pool vg10 --name test --capacity 300M." When I re-executed the above command, the output was as the following: "error: Failed to create vol test error: Storage volume not found: storage vol 'test' already exists" I think the output "Storage volume not found" is not appropriate. Because in fact storage vol test has been found at this time. And then I think virErrorNumber should includes VIR_ERR_STORAGE_EXIST which can also be used elsewhere. So I make this patch. The result is as following: "error: Failed to create vol test error: storage volume 'test' exists already"
-
- 05 9月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
The VIR_FREE() macro will cast away any const-ness. This masked a number of places where we passed a 'const char *' string to VIR_FREE. Fortunately in all of these cases, the variable was not in fact const data, but a heap allocated string. Fix all the variable declarations to reflect this. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 21 8月, 2013 2 次提交
-
-
由 Osier Yang 提交于
Introduced by commit e0139e30. virStorageVolDefFree free'ed the pointers that are still used by the added volume object, this changes it back to VIR_FREE.
-
由 Osier Yang 提交于
Introduced by commit e0139e30: 1777 /* Updating pool metadata */ (40) Event var_deref_op: Dereferencing null pointer "newvol". Also see events: [assign_zero] 1778 pool->def->allocation += newvol->allocation; 1779 pool->def->available -= newvol->allocation;
-
- 19 8月, 2013 1 次提交
-
-
由 Osier Yang 提交于
One has to refresh the pool to get the correct pool info after adding/removing/resizing a volume, this updates the pool metadata (allocation, available) after those operation are done.
-
- 26 7月, 2013 1 次提交
-
-
由 John Ferlan 提交于
Adjust these drivers to handle their Autostart functionality after each of the drivers has gone through their Initialization functions
-
- 24 7月, 2013 1 次提交
-
-
由 John Ferlan 提交于
Add a privileged field to storageDriverState Use the privileged value in order to generate a connection which could be passed to the various storage backend drivers. In particular, the iSCSI driver will need a connect in order to perform pool authentication using the 'chap' secrets and the RBD driver utilizes the connection during pool refresh for pools using 'ceph' secrets. For now that connection will be to be to qemu driver until a mechanism is devised to get a connection to just the secret driver without qemu.
-
- 16 7月, 2013 1 次提交
-
-
由 Martin Kletzander 提交于
When using logical pools, we had to trust the target->path provided. This parameter, however, can be completely ommited and we can use '/dev/<source.name>' safely and populate it to target.path. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=952973
-
- 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>
-
- 10 7月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 04 7月, 2013 1 次提交
-
-
由 Ján Tomko 提交于
Introduced by c930410b. https://bugzilla.redhat.com/show_bug.cgi?id=980676
-
- 03 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Ensure that all APIs which list storage objects filter them against the access control system. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 24 6月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Insert calls to the ACL checking APIs in all storage driver entrypoints. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 05 6月, 2013 2 次提交
-
-
由 Osier Yang 提交于
As the document for "virsh-resize" says: <...> Attempts to shrink the volume will fail unless I<--shrink> is present; </...> This makes sense as it at least prevent the user shrinking the important data of volume without a notice.
-
由 Osier Yang 提交于
The document for "vol-resize" says the new capacity will be sparse unless "--allocate" is specified, however, the "--allocate" flag is never implemented. This implements the "--allocate" flag for fs backend's raw type volume, based on posix_fallocate and the syscall SYS_fallocate.
-
- 21 5月, 2013 1 次提交
-
-
由 Osier Yang 提交于
-
- 10 5月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
-
- 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.
-
- 24 4月, 2013 3 次提交
-
-
由 Daniel P. Berrange 提交于
Ensure that all drivers implementing public APIs use a naming convention for their implementation that matches the public API name. eg for the public API virDomainCreate make sure QEMU uses qemuDomainCreate and not qemuDomainStart Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
It will simplify later work if the sub-drivers have dedicated APIs / field names. ie virNetworkDriver should have virDrvNetworkOpen and virDrvNetworkClose methods Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Ensure that the driver struct field names match the public API names. For an API virXXXX we must have a driver struct field xXXXX. ie strip the leading 'vir' and lowercase any leading uppercase letters. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 13 4月, 2013 1 次提交
-
-
由 Osier Yang 提交于
Pushed under trivial rule
-
- 15 1月, 2013 1 次提交
-
-
由 John Ferlan 提交于
-
- 21 12月, 2012 4 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
- 07 12月, 2012 1 次提交
-
-
由 Ján Tomko 提交于
Add VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA flag to virStorageVolCreateXML and virStorageVolCreateXMLFrom. This flag requests metadata preallocation when creating/cloning qcow2 images, resulting in creating a sparse file with qcow2 metadata. It has only slightly larger disk usage compared to new image with no allocation, but offers higher performance.
-
- 04 12月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
Currently to deal with auto-shutdown libvirtd must periodically poll all stateful drivers. Thus sucks because it requires acquiring both the driver lock and locks on every single virtual machine. Instead pass in a "inhibit" callback to virStateInitialize which drivers can invoke whenever they want to inhibit shutdown due to existance of active VMs. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The only important state that should prevent libvirtd shutdown is from running VMs. Networks, host devices, network filters and storage pools are all long lived resources that have no significant in-memory state. They should not block shutdown.
-
- 30 11月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
The virStateInitialize method and several cgroups methods were using an 'int privileged' parameter or similar for dual-state values. These are better represented with the bool type. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 26 11月, 2012 1 次提交
-
-
由 Ata E Husain Bohra 提交于
This will simplify the refactoring of the ESX storage driver to support a VMFS and an iSCSI backend. One of the tasks the storage driver needs to do is to decide which backend driver needs to be invoked for a given request. This approach extends virStoragePool and virStorageVol to store extra parameters: 1. privateData: stores pointer to respective backend storage driver. 2. privateDataFreeFunc: stores cleanup function pointer. virGetStoragePool and virGetStorageVol are modfied to accept these extra parameters as user params. virStoragePoolDispose and virStorageVolDispose checks for cleanup operation if available. The private data pointer allows the ESX storage driver to store a pointer to the used backend with each storage pool and volume. This avoids the need to detect the correct backend in each storage driver function call.
-
- 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>
-
- 23 10月, 2012 1 次提交
-
-
由 Cole Robinson 提交于
virStorageVolLookupByPath is an API call that virt-manager uses quite a bit when dealing with storage. This call use BackendStablePath which has several usleep() heuristics that can be tripped up and hang virt-manager for a while. Current example: an empty mpath pool pointing to /dev/mapper makes _any_ calls to virStorageVolLookupByPath take 5 seconds. The sleep heuristics are actually only needed in certain cases when we are waiting for new storage to appear, so let's skip the timeout steps when calling from LookupByPath.
-
- 11 10月, 2012 1 次提交
-
-
由 Cole Robinson 提交于
Done with: sed -i -e "s/no pool with matching uuid/no storage pool with matching uuid/g" src/storage/storage_driver.c sed -i -e 's/"%s", _("no storage pool with matching uuid")/_("no storage pool with matching uuid %s"), obj->uuid/g' src/storage/storage_driver.c sed -i -e 's/"%s", _("storage pool is not active")/_("storage pool '%s' is not active"), pool->def->name/g' src/storage/storage_driver.c And a couple fixups before, during, and after, and a manual inspection pass to make sure nothing was wonky.
-
- 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/
-