You need to sign in or sign up before continuing.
- 27 7月, 2010 4 次提交
-
-
由 Chris Wright 提交于
When doing a PCI secondary bus reset, we must be sure that there are no active devices on the same bus segment. The active device tracking is designed to only track host devices that are active in use by guests. This ignores host devices that are actively in use by the host. So the current logic will reset host devices. Switch this logic around and allow sbus reset when we are assigning all devices behind a bridge to the same guest at guest startup or as a result of a single attach-device command. * src/util/pci.h: change signature of pciResetDevice to add an inactive devices list * src/qemu/qemu_driver.c src/xen/xen_driver.c: use (or not) the new functionality of pciResetDevice() depending on the place of use * src/util/pci.c: implement the interface and logic changes
-
由 Chris Wright 提交于
- src/qemu/qemu_driver.c: Eliminate code duplication by using the new helpers qemuPrepareHostdevPCIDevices and qemuDomainReAttachHostdevDevices. This reduces the number of open coded calls to pciResetDevice.
-
由 Chris Wright 提交于
- src/qemu/qemu_driver.c: These new helpers take hostdev list and count directly rather than getting them indirectly from domain definition. This will allow reuse for the attach-device case.
-
由 Chris Wright 提交于
- src/qemu/qemu_driver.c: Update qemuGetPciHostDeviceList to take a hostdev list and count directly, rather than getting this indirectly from domain definition. This will allow reuse for the attach-device case.
-
- 24 7月, 2010 5 次提交
-
-
由 Chris Lalancette 提交于
Thanks to DV for knocking together the Relax-NG changes quickly for me. Changes since v1: - Change the domain.rng to correspond to the new schema - Don't allocate caps->ns in testQemuCapsInit since it is a static table Changes since v2: - Change domain.rng to add restrictions on allowed environment names Changes since v3: - Remove a bogus comment in the tests Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Chris Lalancette 提交于
Implement the qemu driver's virDomainQemuMonitorCommand and hook it into the API entry point. Changes since v1: - Rename the (external) qemuMonitorCommand to qemuDomainMonitorCommand - Add virCheckFlags to qemuDomainMonitorCommand Changes since v2: - Drop ATTRIBUTE_UNUSED from the flags Changes since v3: - Add a flag to priv so we only print out monitor command warning once. Note that this has not been plumbed into qemuDomainObjPrivateXMLFormat or qemuDomainObjPrivateXMLParse, which means that if you run a monitor command, restart libvirtd, and then run another monitor command, you may get an an erroneous VIR_INFO. It's a pretty minor matter, and I didn't think it warranted the additional code. - Add BeginJob/EndJob calls around EnterMonitor/ExitMonitor Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Chris Lalancette 提交于
Add the library entry point for the new virDomainQemuMonitorCommand() entry point. Because this is not part of the "normal" libvirt API, it gets its own header file, library file, and will eventually get its own over-the-wire protocol later in the series. Changes since v1: - Go back to using the virDriver table for qemuDomainMonitorCommand, due to linking issues - Added versioning information to the libvirt-qemu.so Changes since v2: - None Changes since v3: - Add LGPL header to libvirt-qemu.c - Make virLibConnError and virLibDomainError macros instead of function calls Changes since v4: - Move exported symbols to libvirt_qemu.syms Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Chris Lalancette 提交于
Now that we have the ability to specify arbitrary qemu command-line parameters in the XML, use it to handle unknown command-line parameters when doing a native-to-xml conversion. Changes since v1: - Rename num_extra to num_args - Fix up a memory leak on an error path Changes since v2: - Add a VIR_WARN when adding the argument via qemu:arg Changes since v3: - None Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Chris Lalancette 提交于
Implement the qemu hooks for XML namespace data. This allows us to specify a qemu XML namespace, and then specify: <qemu:commandline> <qemu:arg value='arg'/> <qemu:env name='name' value='value'/> </qemu:commandline> In the domain XML. Changes since v1: - Change the <qemu:arg>arg</qemu:arg> XML to <qemu:arg value='arg'/> XML - Fix up some memory leaks in qemuDomainDefNamespaceParse - Rename num_extra and extra to num_args and args, respectively - Fixed up some error messages - Make sure to escape user-provided data in qemuDomainDefNamespaceFormatXML Changes since v2: - Add checking to ensure environment variable names are valid - Invert the logic in qemuDomainDefNamespaceFormatXML to return early Changes since v3: - Change strspn() to c_isalpha() check of first letter of environment variable Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
- 23 7月, 2010 2 次提交
-
-
由 Daniel P. Berrange 提交于
A Linux software bridge will assume the MAC address of the enslaved interface with the numerically lowest MAC addr. When the bridge changes MAC address there is a period of network blackout, so a change should be avoided. The kernel gives TAP devices a completely random MAC address. Occassionally the random TAP device MAC is lower than that of the physical interface (eth0, eth1etc) that is enslaved, causing the bridge to change its MAC. This change sets an explicit MAC address for all TAP devices created using the configured MAC from the XML, but with the high byte set to 0xFE. This should ensure TAP device MACs are higher than any physical interface MAC. * src/qemu/qemu_conf.c, src/uml/uml_conf.c: Pass in a MAC addr for the TAP device with high byte set to 0xFE * src/util/bridge.c, src/util/bridge.h: Set a MAC when creating the TAP device to override random MAC
-
由 Daniel P. Berrange 提交于
The PCI slot 1 must be reserved at all times, since PIIX3 is always present, even if no IDE device is in use for guest disks * src/qemu/qemu_conf.c: Always reserve slot 1 for PIIX3
-
- 22 7月, 2010 1 次提交
-
-
由 Laine Stump 提交于
virFileOperation previously returned 0 on success, or the value of errno on failure. Although there are other functions in libvirt that use this convention, the preferred (and more common) convention is to return 0 on success and -errno (or simply -1 in some cases) on failure. This way the check for failure is always (ret < 0). * src/util/util.c - change virFileOperation and virFileOperationNoFork to return -errno on failure. * src/storage/storage_backend.c, src/qemu/qemu_driver.c - change the hook functions passed to virFileOperation to return -errno on failure.
-
- 21 7月, 2010 4 次提交
-
-
由 Daniel P. Berrange 提交于
To try and ensure that people upgrading from old QEMU get guests with the same PCI device ordering, change the way we assign addrs to match QEMU's default order. This should make Windows less annoyed. * src/qemu/qemu_conf.c: Follow QEMU's default PCI ordering logic when assigning addresses * tests/*.args: Update for changed PCI addresses
-
由 Daniel P. Berrange 提交于
To allow compatibility with older QEMU PCI device slot assignment it is necessary to explicitly track the balloon device in the XML. This introduces a new device <memballoon model='virtio|xen'/> It can also have a PCI address, auto-assigned if necessary. The memballoon will be automatically added to all Xen and QEMU guests by default. * docs/schemas/domain.rng: Add <memballoon> element * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and formatting for memballoon device. Always add a memory balloon device to Xen/QEMU if none exists in XML * src/libvirt_private.syms: Export memballoon model APIs * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Honour the PCI device address in memory balloon device * tests/*: Update to test new functionality
-
由 Daniel P. Berrange 提交于
The first VGA and IDE devices need to have fixed PCI address reservations. Currently this is handled inline with the other non-primary VGA/IDE devices. The fixed virtio balloon device at slot 3, ensures auto-assignment skips the slots 1/2. The virtio address will shortly become configurable though. This means the reservation of fixed slots needs to be done upfront to ensure that they don't get re-used for other devices. This is more or less reverting the previous changeset: commit 83acdeaf Author: Daniel P. Berrange <berrange@redhat.com> Date: Wed Feb 3 16:11:29 2010 +0000 Fix restore of QEMU guests with PCI device reservation The difference is that this time, instead of unconditionally reserving the address, we only reserve the address if it was initially type=none. Addresses of type=pci were handled earlier in process by qemuDomainPCIAddressSetCreate(). This ensures restore step doesn't have problems * src/qemu/qemu_conf.c: Reserve first VGA + IDE address upfront
-
由 Daniel P. Berrange 提交于
The VIR_ERR_NO_SUPPORT refers to an API which is not implemented. There is a separate VIR_ERR_CONFIG_UNSUPPORTED for XML config options that are not available with the current hypervisor. * src/qemu/qemu_conf.c, src/qemu/qemu_driver.c: Remove many VIR_ERR_NO_SUPPORT replace with VIR_ERR_CONFIG_UNSUPPORTED
-
- 20 7月, 2010 6 次提交
-
-
由 Chris Lalancette 提交于
If you try to execute two concurrent migrations p2p from A->B and B->A, the two libvirtd's will deadlock trying to perform the migrations. The reason for this is that in p2p migration, the libvirtd's are responsible for making the RPC Prepare, Migrate, and Finish calls. However, they are currently holding the driver lock while doing so, which basically guarantees deadlock in this scenario. This patch fixes the situation by adding qemuDomainObjEnterRemoteWithDriver and qemuDomainObjExitRemoteWithDriver helper methods. The Enter take an additional object reference, then drops both the domain object lock and the driver lock. The Exit takes both the driver and domain object lock, then drops the reference. Adding calls to these Enter and Exit helpers around remote calls in the various migration methods seems to fix the problem for me in testing. This should make the situation safe. The additional domain object reference ensures that the domain object won't disappear while this operation is happening. The BeginJob that is called inside of qemudDomainMigratePerform ensures that we can't execute a second migrate (or shutdown, or save, etc) job while the migration is active. Finally, the additional check on the state of the vm after we reacquire the locks ensures that we can't be surprised by an external event (domain crash, etc). Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Daniel P. Berrange 提交于
Record a default driver name/type in capabilities struct. Use this when parsing disks if value is not set in XML config. * src/conf/capabilities.h: Record default driver name/type for disks * src/conf/domain_conf.c: Fallback to default driver name/type when parsing disks * src/qemu/qemu_driver.c: Set default driver name/type to raw
-
由 Daniel P. Berrange 提交于
Disk format probing is now disabled by default. A new config option in /etc/qemu/qemu.conf will re-enable it for existing deployments where this causes trouble
-
由 Daniel P. Berrange 提交于
The implementation of security driver callbacks often needs to access the security driver object. Currently only a handful of callbacks include the driver object as a parameter. Later patches require this is many more places. * src/qemu/qemu_driver.c: Pass in the security driver object to all callbacks * src/qemu/qemu_security_dac.c, src/qemu/qemu_security_stacked.c, src/security/security_apparmor.c, src/security/security_driver.h, src/security/security_selinux.c: Add a virSecurityDriverPtr param to all security callbacks
-
由 Daniel P. Berrange 提交于
Update the QEMU cgroups code, QEMU DAC security driver, SELinux and AppArmour security drivers over to use the shared helper API virDomainDiskDefForeachPath(). * src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c, src/security/security_selinux.c, src/security/virt-aa-helper.c: Convert over to use virDomainDiskDefForeachPath()
-
由 Daniel P. Berrange 提交于
Require the disk image to be passed into virStorageFileGetMetadata. If this is set to VIR_STORAGE_FILE_AUTO, then the format will be resolved using probing. This makes it easier to control when probing will be used * src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c, src/security/security_selinux.c, src/security/virt-aa-helper.c: Set VIR_STORAGE_FILE_AUTO when calling virStorageFileGetMetadata. * src/storage/storage_backend_fs.c: Probe for disk format before calling virStorageFileGetMetadata. * src/util/storage_file.h, src/util/storage_file.c: Remove format from virStorageFileMeta struct & require it to be passed into method.
-
- 15 7月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* src/qemu/qemu_driver.c (qemuConnectMonitor): Correct erroneous parenthesization in two expressions. Without this fix, failure to set or clear SELinux security context in the monitor would go undiagnosed. Also correct a diagnostic and split some long lines.
-
- 13 7月, 2010 2 次提交
-
-
由 Jiri Denemark 提交于
In case qemu supports -nodefconfig, libvirt adds uses it when launching new guests. Since this option may affect CPU models supported by qemu, we need to use it when probing for available models.
-
由 Daniel P. Berrange 提交于
An indentation mistake meant that a check for return status was not properly performed in all cases. This could result in a crash on NULL pointer in a following line. * src/qemu/qemu_monitor_json.c: Fix check for return status when processing JSON for blockstats
-
- 02 7月, 2010 1 次提交
-
-
由 Cole Robinson 提交于
Log some info if we can't find a config file. Make parse failures fatal, and actually raise an error message.
-
- 30 6月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
Some, but not all, codepaths in the qemuMonitorOpen() method would trigger the destroy callback. The caller does not expect this to be invoked if construction fails, only during normal release of the monitor. This resulted in a possible double-unref of the virDomainObjPtr, because the caller explicitly unrefs the virDomainObjPtr if qemuMonitorOpen() fails * src/qemu/qemu_monitor.c: Don't invoke destroy callback from qemuMonitorOpen() failure paths
-
- 29 6月, 2010 3 次提交
-
-
由 Chris Lalancette 提交于
Make sure to *not* call qemuDomainPCIAddressReleaseAddr if QEMUD_CMD_FLAG_DEVICE is *not* set (for older qemu). This prevents a crash when trying to do device detachment from a qemu guest. Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Chris Lalancette 提交于
In the current libvirt PCI code, there is no checking whether a PCI device is in use by a guest when doing node device detach or reattach. This causes problems when a device is assigned to a guest, and the administrator starts issuing nodedevice commands. Make it so that we check the list of active devices when trying to detach/reattach, and only allow the operation if the device is not assigned to a guest. Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Laine Stump 提交于
This code was just recently added (by me) and didn't account for the fact that stdin_path is sometimes NULL. If it's NULL, and SetSecurityAllLabel fails, a segfault would result.
-
- 28 6月, 2010 3 次提交
-
-
由 Laine Stump 提交于
When the saved domain image is on an NFS share, at least some part of domainSetSecurityAllLabel will fail (for example, selinux labels can't be modified). To allow domain restore to still work in this case, just ignore the errors.
-
由 Laine Stump 提交于
Previously, this function had it's own bit of code performing the same function. Since there's now an equivalent utility function, let's use it.
-
由 Laine Stump 提交于
Also restore the label to its original value after qemu is finished with the file. Prior to this patch, qemu domain restore did not function properly if selinux was set to enforce.
-
- 25 6月, 2010 5 次提交
-
-
由 Daniel P. Berrange 提交于
If an active migration operation fails, or is cancelled by the admin, the QEMU on the destination is shutdown and the one on the source continues running. It is important in shutting down the QEMU on the destination, the security drivers don't reset the file labelling/permissions. * src/qemu/qemu_driver.c: Don't reset labelling/permissions on migration abort
-
由 Daniel P. Berrange 提交于
The patches for shared storage migration were not correctly written for json mode. Thus the 'blk' and 'inc' parameters were never being set. In addition they didn't set the QEMU_MONITOR_MIGRATE_BACKGROUND so migration was synchronous. Due to multiple bugs in QEMU's JSON impl this wasn't noticed because it treated the sync migration requst as asynchronous anyway. Finally 'background' parameter was converted to take arbitrary flags but not renamed, and not all uses were changed to unsigned int. * src/qemu/qemu_driver.c: Set QEMU_MONITOR_MIGRATE_BACKGROUND in doNativeMigrate * src/qemu/qemu_monitor_json.c: Process QEMU_MONITOR_MIGRATE_NON_SHARED_DISK and QEMU_MONITOR_MIGRATE_NON_SHARED_INC flags * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.h, src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: change 'int background' to 'unsigned int flags' in migration APIs. Add logging of flags parameter
-
由 Daniel P. Berrange 提交于
During incoming migration the QEMU monitor is not able to be used. The incoming migration code did not keep hold of the job lock because migration is split across multiple API calls. This meant that further monitor commands on the guest would hang until migration finished with no timeout. In this change the qemuDomainMigratePrepare method sets the job flag just before it returns. The qemuDomainMigrateFinish method checks for this job flag & clears it once done. This prevents any use of the monitor between prepare+finish steps. The qemuDomainGetJobInfo method is also updated to refresh the job elapsed time. This means that virsh domjobinfo can return time data during incoming migration * src/qemu/qemu_driver.c: Keep a job active during incoming migration. Refresh job elapsed time when returning job info
-
由 Daniel P. Berrange 提交于
When configuring serial, parallel, console or channel devices with a file, dev or pipe backend type, it is necessary to label the file path in the security drivers. For char devices of type file, it is neccessary to pre-create (touch) the file if it does not already exist since QEMU won't be allowed todo so itself. dev/pipe configs already require the admin to pre-create before starting the guest. * src/qemu/qemu_security_dac.c: set file ownership for character devices * src/security/security_selinux.c: Set file labeling for character devices * src/qemu/qemu_driver.c: Add character devices to cgroup ACL
-
由 Laine Stump 提交于
We previously assumed that if the -device option existed in qemu, that -nodefconfig would also exist. It turns out that isn't the case, as demonstrated by qemu-kvm-0.12.3 in Fedora 13. */src/qemu/qemu_conf.[hc] - add a new QEMUD_CMD_FLAG, set it via the help output, and check it before adding -nodefconfig to the qemu commandline.
-
- 24 6月, 2010 2 次提交
-
-
由 Matthias Bolte 提交于
This is a step towards controller support for the ESX driver.
-
由 Matthias Bolte 提交于
The domain XML parsing code autogenerates disk address and controller elements when they are not explicitly specified. The code assumes a narrow SCSI bus (7 units per bus). ESX uses a wide SCSI bus (16 units per bus). This is a step towards controller support for the ESX driver.
-