- 12 2月, 2019 2 次提交
-
-
由 John Ferlan 提交于
Rather than having an error path, let's rework the code to allocate and fill into an @authdef variable and then steal that into @ret when we are successful leaving just a cleanup: path. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 John Ferlan 提交于
Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 04 2月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
Missing semicolon at the end of macros can confuse some analyzers (like cppcheck <filename>), and we have a mix of semicolon and non-semicolon usage through the code. Let's standardize on using a semicolon for VIR_ENUM_IMPL calls. Move the verify() statement to the end of the macro and drop the semicolon, so the compiler will require callers to add a semicolon. While we are touching these call sites, standardize on putting the closing parenth on its own line, as discussed here: https://www.redhat.com/archives/libvir-list/2019-January/msg00750.htmlReviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 02 2月, 2019 1 次提交
-
-
由 John Ferlan 提交于
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 01 2月, 2019 3 次提交
-
-
由 John Ferlan 提交于
The vHBA/NPIV LUNs created via the udev processing of the VPORT_CREATE command end up using the same serial value as seen/generated by the /lib/udev/scsi_id as returned during virStorageFileGetSCSIKey. Therefore, in order to generate a unique enough key to be used when adding the LUN as a volume during virStoragePoolObjAddVol a more unique key needs to be generated for an NPIV volume. The problem is illustrated by the following example, where scsi_host5 is a vHBA used with the following LUNs: $ lsscsi -tg ... [5:0:4:0] disk fc:0x5006016844602198,0x101f00 /dev/sdh /dev/sg23 [5:0:5:0] disk fc:0x5006016044602198,0x102000 /dev/sdi /dev/sg24 ... Calling virStorageFileGetSCSIKey would return: /lib/udev/scsi_id --device /dev/sdh --whitelisted --replace-whitespace /dev/sdh 350060160c460219850060160c4602198 /lib/udev/scsi_id --device /dev/sdh --whitelisted --replace-whitespace /dev/sdi 350060160c460219850060160c4602198 Note that althrough /dev/sdh and /dev/sdi are separate LUNs, they end up with the same serial number used for the vol->key value. When virStoragePoolFCRefreshThread calls virStoragePoolObjAddVol the second LUN fails to be added with the following message getting logged: virHashAddOrUpdateEntry:341 : internal error: Duplicate key To resolve this, virStorageFileGetNPIVKey will use a similar call sequence as virStorageFileGetSCSIKey, except that it will add the "--export" option to the call. This results in more detailed output which needs to be parsed in order to formulate a unique enough key to be used. In order to be unique enough, the returned value will concatenate the target port as returned in the "ID_TARGET_PORT" field from the command to the "ID_SERIAL" value. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 John Ferlan 提交于
Alter the code to use the virStorageFileGetSCSIKey helper to fetch the unique key for the SCSI disk. Alter the logic to follow the former code which would return a duplicate of @dev when either the virCommandRun succeeded, but returned an empty string or when WITH_UDEV was not true. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 John Ferlan 提交于
Alter the "real" code to return -2 on virCommandRun failure. Alter the comments and function header to describe the function and its returns. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 28 1月, 2019 2 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1665553 Ceph can be mounted just like any other filesystem and in fact is a shared and cluster filesystem. The filesystem magic constant was taken from kernel sources as it is not in magic.h yet. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
We have this very handy macro called VIR_STEAL_PTR() which steals one pointer into the other and sets the other to NULL. The following coccinelle patch was used to create this commit: @ rule1 @ identifier a, b; @@ - b = a; ... - a = NULL; + VIR_STEAL_PTR(b, a); Some places were clean up afterwards to make syntax-check happy (e.g. some curly braces were removed where the body become a one liner). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 14 12月, 2018 1 次提交
-
-
由 Daniel P. Berrangé 提交于
In many files there are header comments that contain an Author: statement, supposedly reflecting who originally wrote the code. In a large collaborative project like libvirt, any non-trivial file will have been modified by a large number of different contributors. IOW, the Author: comments are quickly out of date, omitting people who have made significant contribitions. In some places Author: lines have been added despite the person merely being responsible for creating the file by moving existing code out of another file. IOW, the Author: lines give an incorrect record of authorship. With this all in mind, the comments are useless as a means to identify who to talk to about code in a particular file. Contributors will always be better off using 'git log' and 'git blame' if they need to find the author of a particular bit of code. This commit thus deletes all Author: comments from the source and adds a rule to prevent them reappearing. The Copyright headers are similarly misleading and inaccurate, however, we cannot delete these as they have legal meaning, despite being largely inaccurate. In addition only the copyright holder is permitted to change their respective copyright statement. Reviewed-by: NErik Skultety <eskultet@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 12 10月, 2018 2 次提交
-
-
由 Peter Krempa 提交于
The URI parser used by libvirt does not populate uri->path if the trailing slash is missing. The code virStorageSourceParseBackingURI would then not populate src->path. As only NBD network disks are allowed to have the 'name' field in the XML defining the disk source omitted we'd generate an invalid XML which we'd not parse again. Fix it by populating src->path with an empty string if the uri is lacking slash. As pointed out above NBD is special in this case since we actually allow it being NULL. The URI path is used as export name. Since an empty export does not make sense the new approach clears the src->path if the trailing slash is present but nothing else. Add test cases now to cover all the various cases for NBD and non-NBD uris as there was to time only 1 test abusing the quirk witout slash for NBD and all other URIs contained the slash or in case of NBD also the export name. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
The name is misleading. Change it to 'uristr' so that 'path' can be reused in the proper context later. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 24 9月, 2018 1 次提交
-
-
由 Shi Lei 提交于
This patch just fixes misaligned arguments and misaligned conditions of src/util/*.c. Signed-off-by: NShi Lei <shi_lei@massclouds.com>
-
- 20 9月, 2018 1 次提交
-
-
由 Erik Skultety 提交于
All of the ones being removed are pulled in by internal.h. The only exception is sanlock which expects the application to include <stdint.h> before sanlock's headers, because sanlock prototypes use fixed width int, but they don't include stdint.h themselves, so we have to leave that one in place. Signed-off-by: NErik Skultety <eskultet@redhat.com> Acked-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 17 9月, 2018 1 次提交
-
-
由 Shi Lei 提交于
Signed-off-by: NShi Lei <shi_lei@massclouds.com>
-
- 08 8月, 2018 2 次提交
-
-
由 Pavel Hrdina 提交于
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
The same code would be used for storage pools and domain disks. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 20 7月, 2018 2 次提交
-
-
由 Peter Krempa 提交于
To allow checking whether a storage source points to the same location add a helper which checks the relevant fields. This will allow replacing a similar check done by formatting the command line arguments for qemu-like syntax. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Despite the warning that virStorageSourceCopy needs to be populated on additions to the structure commit 68773054 neglected to implement the copy function. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 10 7月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
If there are managed reservations for a disk source, the path to the pr-helper socket is generated automatically by libvirt when needed and points somewhere under priv->libDir. Therefore it is very unlikely that the path will work even on migration destination (the libDir is derived from domain short name and its ID). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 08 6月, 2018 1 次提交
-
-
由 Peter Krempa 提交于
All callers pass 'false' now so it's no longer needed. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 05 6月, 2018 2 次提交
-
-
由 Peter Krempa 提交于
With blockdev support we will need to introspect whether any of the backing chain members requires PR rather just one of them. Add a helper and reuse it in virDomainDefHasManagedPR. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Disks are client-only so we don't need to have this variable. We also always pass false for 'isListen' to qemuBuildTLSx509BackendProps for all disk-related code-paths so the 'tlsVerify' is ignored anyways. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 16 5月, 2018 4 次提交
-
-
由 Peter Krempa 提交于
Rather than always re-generating the alias store it in the definition and in the status XML. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
To allow storing status information in the XML move the validation that the 'path' is not valid for managed PR daemon case into qemuDomainValidateStorageSource and allow parsing of the data even in case when managed='yes'. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
The function now does not do anything useful. Replace it by the pointer check. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
Everything can be disabled by not using the parent element. There's no need to store this explicitly. Additionally it does not add any value since any configuration is dropped if enabled='no' is configured. Drop the attribute and adjust the code accordingly. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 11 5月, 2018 4 次提交
-
-
由 Michal Privoznik 提交于
For command line we need two things: 1) -object pr-manager-helper,id=$alias,path=$socketPath 2) -drive file.pr-manager=$alias In -object pr-manager-helper we tell qemu which socket to connect to, then in -drive file-pr-manager we just reference the object the drive in question should use. For managed PR helper the alias is always "pr-helper0" and socket path "${vm->priv->libDir}/pr-helper0.sock". Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
Couple of reasons for that: a) there's no monitor command to change path where the pr-helper connects to, or b) there's no monitor command to introduce a new pr-helper for a disk that already exists. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
This is a definition that holds information on SCSI persistent reservation settings. The XML part looks like this: <reservations enabled='yes' managed='no'> <source type='unix' path='/path/to/qemu-pr-helper.sock' mode='client'/> </reservations> If @managed is set to 'yes' then the <source/> is not parsed. This design was agreed on here: https://www.redhat.com/archives/libvir-list/2017-November/msg01005.htmlSigned-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than have virJSONValueArraySize return a -1 when the input is not an array and then splat an error message, let's check for an array before calling and then change the return to be a size_t instead of ssize_t. That means using the helper virJSONValueIsArray as well as using a more generic error message such as "Malformed <something> array". In some cases we can remove stack variables and when we cannot, those variables should be size_t not ssize_t. Alter a few references of if (!value) to be if (value == 0) instead as well. Some callers can already assume an array is being worked on based on the previous call, so there's less to do. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 07 5月, 2018 2 次提交
-
-
由 Peter Krempa 提交于
Few things which are currently stored the virDomainDiskDef structure are actually relevant for the storage source as well. Add the fields with a note that they are just mirror of the values from the disk. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Peter Krempa 提交于
Everything besides the top of the chain is readonly. Track this when parsing the XML and detecting the chain from the disk. Also fix the state when taking snapshots. All other cases where the top image is changed already preserve the readonly state from the original image. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 03 5月, 2018 3 次提交
-
-
由 Daniel P. Berrangé 提交于
The storage file drivers are currently loaded as a side effect of loading the storage driver. This is a bogus dependancy because the storage file code has no interaction with the storage drivers, and even ultimately be running in a completely separate daemon. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The virStorageFileSupportsSecurityDriver and virStorageFileSupportsAccess currently just return a boolean value. This is ok because they don't have any failure scenarios but a subsequent patch is going to introduce potential failure scenario. This changes their return type from a boolean to an int with values -1, 0, 1. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The virStorageFileGetBackingStoreStr method has overloaded the NULL return value to indicate both no backing available and a fatal error dealing with it. The caller is thus not able to correctly propagate the error messages. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 18 4月, 2018 1 次提交
-
-
由 Peter Krempa 提交于
Currently it is not used in backing chains and does not seem that we will need to use it so return it back to the disk definition. Thankfully most accesses are done via the accessors. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 08 3月, 2018 2 次提交
-
-
由 Peter Krempa 提交于
Pass in the XPath context as we do in all other places rather than allocating a new one. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Peter Krempa 提交于
Unify the cleanup and error paths and simplify the code flow by removing some unnecessary variables. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 20 2月, 2018 1 次提交
-
-
由 Michal Privoznik 提交于
This function returns nothing but zero. Therefore it makes no sense to have it returning an integer. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-