- 17 6月, 2014 5 次提交
-
-
由 Peter Krempa 提交于
Use consistent formatting of function headers: - two newlines separating functions - function return type on separate line - one argument per line
-
由 Eric Blake 提交于
Commit 7c6fc394 introduced a regression in the XML produced for older clients. The argument at the time was that clients shouldn't be depending on output-only data for something that is only going to be triggered for a transient guest; but John Ferlan reported that the automated testsuite was such a client. It's better to be safe than sorry by guaranteeing back-compat cruft. Note that later patches will be using <mirror> for active block commit, but there we don't have to worry about back-compat. * src/conf/domain_conf.c (virDomainDiskDefFormat): Restore old style output when necessary. * docs/schemas/domaincommon.rng: Validate back-compat style. * docs/formatdomain.html.in: Update the documentation. * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml: Update tests. * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
We have a policy of avoiding enum types in structs in our public API, because it is possible for a client to choose compiler options that can change the in-memory ABI of that struct based on whether the enum value occupies an int or a minimal size. But we missed this for virDomainBlockJobInfo. We got lucky on little-endian machines - if the enum fits minimal size (a char), we still end up padding to the next long before the next field; but on big-endian, a client interpreting the enum as a char would always see 0 when the server supplies contents as an int. * include/libvirt/libvirt.h.in (virDomainBlockJobInfo): Enforce particular sizing. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
I noticed that the web page lacked documentation on block jobs: http://libvirt.org/html/libvirt-libvirt.html#virDomainBlockJobType not only for the recently added active commit, but also for all the other job types. * include/libvirt/libvirt.h.in (virDomainBlockJobType): Document recent addition. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Shivaprasad G Bhat 提交于
During guest migration, if the domain xml is bigger than 16384 which is easily possible for a guest with good number of disks, message encode fails for xdr_remote_domain_migrate_perform3_ret(). So, Increase the COOKIE_MAX to STRING_MAX value. Signed-off-by: NShivaprasad G Bhat <shivaprasadbhat@gmail.com>
-
- 16 6月, 2014 8 次提交
-
-
由 Michal Privoznik 提交于
This new element is there to represent PCI-Express capabilities of a PCI devices, like link speed, number of lanes, etc. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
These functions will handle PCIe devices and their link capabilities to query some info about it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Eric Blake 提交于
The block commit code looks for an explicit base file relative to the discovered top file; so for a chain of: base <- snap1 <- snap2 <- snap3 and a command of: virsh blockcommit $dom vda --base snap2 --top snap1 we got a sane message (here from libvirt 1.0.5): error: invalid argument: could not find base 'snap2' below 'snap1' in chain for 'vda' Meanwhile, recent refactoring has slightly reduced the quality of the libvirt error messages, by losing the phrase 'below xyz': error: invalid argument: could not find image 'snap2' in chain for 'snap3' But we had a one-off, where we were not excluding the top file itself in searching for the base; thankfully qemu still reports the error, but the quality is worse: virsh blockcommit $dom vda --base snap2 --top snap2 error: internal error unable to execute QEMU command 'block-commit': Base '/snap2' not found Fix the one-off in blockcommit by changing the semantics of name lookup - if a starting point is specified, then the result must be below that point, rather than including that point. The only other call to chain lookup was blockpull code, which was already forcing the lookup to omit the active layer and only needs a tweak to use the new semantics. This also fixes the bug exposed in the testsuite, where when doing a lookup pinned to an intermediate point in the chain, we were unable to return the name of the parent also in the chain. * src/util/virstoragefile.c (virStorageFileChainLookup): Change semantics for non-NULL startFrom. * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Adjust caller, to keep existing semantics. * tests/virstoragetest.c (mymain): Adjust to expose new semantics. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Add some more tests of what happens when we restrict a lookup to begin at a point in the middle of a chain. In particular, we want to ensure that a parent is not found when starting at the child. This commit also demonstrates that we have a slight difference in behavior on what parent we report when filtering is in effect; as the determination of the parent affects the code in block commit, exposing this in the testsuite will help justify changes in future patches that tweak the semantics of what lookups are allowed. * tests/virstoragetest.c (testStorageLookup): Test user input. (TEST_LOOKUP_TARGET): Add parameter. (mymain): Add lookup tests. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
The next patch will be adding tests, including adding a parameter for testing more conditions. For ease of review of that patch, I want to create common context lines that don't change when the new tests are added (it's easier to visually review additions than it is to review an entire chunk of tests rewritten into another larger chunk of tests). * tests/virstoragetest.c (mymain): Add a parameter and renumber the lookup tests. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Typing chain->backingStore->backingStore gets old after a while; introduce some alias variables to make the test more compact. * tests/virstoragetest.c (mymain): Introduce some shorthand. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Peter Krempa 提交于
For block devices used as snapshot source the new snapshot code would set the reuse flag. This inhibits to take snapshot without specially preparing the block image before taking the snapshot. Fortunately this is not a regression as only the new way of specifying snapshot source is affected. For the followin snapshot XML: <domainsnapshot> <disks> <disk name='vda' type='block'> <driver type='qcow2'/> <source dev="/dev/andariel/testsnap" /> </disk> </disks> </domainsnapshot> You'd get: error: internal error: unable to execute QEMU command 'transaction': Image is not in qcow2 format After this patch the snapshot is created successfully.
-
由 Pavel Hrdina 提交于
We create a 'lease_new' when we are adding new lease entry, then later in the code we add the 'lease_new' into a 'leases_array_new' which leads into the crash because we double free the 'lease_new'. To prevent the double free we set the 'lease_new' to NULL after successful append into the 'leases_array_new'. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 14 6月, 2014 4 次提交
-
-
由 Roman Bogorodskiy 提交于
When virBhyveProcessStart() fails, it tries to unload a guest that could have been already loaded using bhyveload(8) to make sure not to leave it hanging in memory. However, we could fail before loading a VM into memory, so 'bhyvectl --destroy' command will fail and print an error message that looks confusing to users. So ignore errors when running this in cleanup.
-
由 Roman Bogorodskiy 提交于
virBhyveProcessStart() calls bhyveNetCleanup() if it fails. However, it might fail earlier than networks are allocated, so modify bhyveNetCleanup() to check if net->ifname is not NULL before going further with the cleanup.
-
由 Roman Bogorodskiy 提交于
bhyveBuildNetArgStr() calls virNetDevTapCreateInBridgePort() and passes tapfd = NULL, but tapfdSize = 1. That is wrong, because if virNetDevTapCreateInBridgePort() crashes after successfully creating a TAP device, it'll jump to 'error' label, that loops over tapfd and calls VIR_FORCE_CLOSE: for (i = 0; i < tapfdSize && tapfd[i] >= 0; i++) In that case we get a segfault. As the bhyve code doesn't use tapfd, pass NULL and set tapfdSize to 0.
-
由 Giuseppe Scrivano 提交于
Report VIR_ERR_NO_STORAGE_VOL instead of a system error when lstat fails because the file doesn't exist. Fixes this problem in virt-install: https://bugzilla.redhat.com/show_bug.cgi?id=1108922Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
-
- 13 6月, 2014 5 次提交
-
-
由 Roman Bogorodskiy 提交于
Automatically allocate PCI addresses for devices instead of hardcoding them in the driver code. The current allocation schema is to dedicate an entire slot for each devices. Also, allow having arbitrary number of devices.
-
由 Michal Privoznik 提交于
The kernel's more broken than one would think. Various drivers report various (usually spurious) values if the interface is in other state than 'up' . While on some we experience -EINVAL when read()-ing the speed sysfs file, with other drivers we might get anything from 0 to UINT_MAX. If that's the case it's better to not report link speed. Well, the interface is not up anyway. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
When the test is failing but the debug output isn't enabled the resulting line would look ugly like and would not contain the actual difference. TEST: virstoragetest .................chain member 1!chain member 1!chain member 1! Store the member index in the actual checked string to hide this problem
-
由 Eric Blake 提交于
A future patch will add two-phase block commit jobs; as the mechanism for managing them is similar to managing a block copy job, existing errors should be made generic enough to occur for either job type. * src/conf/domain_conf.c (virDomainHasDiskMirror): Update comment. * src/qemu/qemu_driver.c (qemuDomainDefineXML) (qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot) (qemuDomainBlockJobImpl, qemuDomainBlockCopy): Update error message. * src/qemu/qemu_hotplug.c (qemuDomainDetachDiskDevice): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Peter's review of an early version of my addition of active block commit pointed out some issues that I was copying from the block copy code; fix them up now before perpetuating them. For virsh commands that manage a single API call, it's nice to have a 1:1 mapping of options to flags, so that we can test that lower-layer software handles flag combinations correctly. But where virsh is introducing syntactic sugar to combine multiple API calls into a single user interface, we might as well make that interface compact. That is, we should allow the shorter command-line of 'blockcopy $dom $disk --pivot' without having to explicitly specify --wait, because this isn't directly a flag passed to a single underlying API call. Also, my use of embedded ?: ternaries bordered on unreadable. * tools/virsh-domain.c (cmdBlockCopy): Make --pivot, --finish, and --timeout imply --wait. Drop excess ?: operators. * tools/virsh.pod (blockcopy): Update documentation. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 12 6月, 2014 18 次提交
-
-
由 Michal Privoznik 提交于
With one of my recent patches (1c702778) libvirt's capable of reporting NUMA node locality for PCI devices. The node ID is stored in pci_dev.numa_node variable. However, since zero is valid NUMA node ID, the default is -1 as it is in kernel too. So, if the PCI device is not tied to any specific NUMA node, the default is then NOT printed into XML. Therefore, when parsing node device XML, the <node/> element is optional. But currently, if it's not there, we must set sane default, otherwise after parsing in the memory representation doesn't match the XML. We are already doing this in other place: udevProcessPCI(). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Eric Blake 提交于
Commit f5869657 accidentally changed the semantics of the virDomainBlockCommit command; where it previously looked for an explicit top argument from the top of the chain, it now starts from the backing file of the top. Of course, until we allow active commits, the only difference it makes is in the quality of the error message, but with code for active commit coming soon, we need to support an explicit mention of the active layer. * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Start looking from top of chain. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Jincheng Miao 提交于
The vcpupin command allowed specifying a negative number for the --vcpu argument. This would the overflow when the underlying virDomainPinVcpu API was called. $ virsh vcpupin r7 -1 0 error: numerical overflow: input too large: 4294967295 Switch the vCPU variable to a unsigned int and parse it using the corresponding function. Also improve the vcpupin test to cover all the defects. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1101059Signed-off-by: NJincheng Miao <jmiao@redhat.com> Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
由 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.
-
由 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 two bandwidth functions that use this helper introduce vshCommandOptULWrap. Although currently the migrate-setspeed function for the qemu driver will reject -1 as maximum.
-
由 Peter Krempa 提交于
Use virStrToLong_uip instead of virStrToLong_ui to reject negative numbers in the helper. None of the callers expects the wraparound "feature" for negative numbers. Also add a function that allows wrapping of negative numbers as it might be used in the future and be explicit about the new semantics in the function docs.
-
由 Ján Tomko 提交于
qemuDomainGetImageIds did not check if there was a label in the seclabel, thus crashing on <seclabel type='none' model='dac'/> https://bugzilla.redhat.com/show_bug.cgi?id=1108590
-
由 John Ferlan 提交于
Clean up some Coverity warnings from commit id '4dc5d8f1'
-
由 John Ferlan 提交于
Clean up code to resolve Coverity RESOURCE_LEAK's from commit id's '632b9600' and 'b739f807'.
-
由 Peter Krempa 提交于
A network disk might actually be backed by local storage. Also the path iterator actually handles networked disks well now so remove the code that skips the labelling in dac and selinux security driver.
-
由 Peter Krempa 提交于
Add a helper to do all the lookup steps and remove a ton of duplicated code.
-
由 Peter Krempa 提交于
Most of the APIs now don't reach the cleanup section when the pool object wasn't found and thus don't need to check before unlocking it.
-
由 Peter Krempa 提交于
Rework internal pool lookup code to avoid printing the raw UUID buffer in the case a storage pool can't be found: $ virsh pool-name e012ace0-0460-5810-39ef-1bce5fa5a4dd error: failed to get pool 'e012ace0-0460-5810-39ef-1bce5fa5a4dd' error: Storage pool not found: no storage pool with matching uuid à¬à`X9ï_¥¤Ý The rework is mostly done by switching the lookup code to the newly introduced helper virStoragePoolObjFromStoragePool Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1104993
-
由 Ján Tomko 提交于
Try -fstack-protector-strong first on Linux. If that fails, fall back to -fstack-protector-all.
-
由 Ján Tomko 提交于
This option only makes sense for -fstack-protector. With -fstack-protector-all or -fstack-protector-strong, functions are protected regardless of buffer size. https://bugzilla.redhat.com/show_bug.cgi?id=1105456
-
由 Ján Tomko 提交于
These warnings have already been added to $dontwarn.
-
由 John Ferlan 提交于
Resolve two Coverity issues introduced by commit id '9b8d6e1e' Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Roman Bogorodskiy 提交于
Add 'Bhyve' in hypervisor list reported by 'virsh -V' if it's compiled it.
-