- 03 4月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Every caller checked the return value and logged an error - one if no device with the specified MAC was found, other if there were multiple devices matching the MAC address (except for qemuDomainUpdateDeviceConfig which logged the same message in both cases). Move the error reporting into virDomainNetFindIdx, since in both cases, we couldn't find one single match - it's just the error messages that differ.
-
- 02 4月, 2014 1 次提交
-
-
由 Eric Blake 提交于
A continuation of the migration of disk details to virstoragefile. This patch moves a single enum, but converting the name has quite a bit of fallout. * src/conf/domain_conf.h (virDomainDiskType): Move... * src/util/virstoragefile.h (virStorageType): ...and rename. * src/bhyve/bhyve_command.c (bhyveBuildDiskArgStr) (virBhyveProcessBuildLoadCmd): Update clients. * src/conf/domain_conf.c (virDomainDiskSourceDefParse) (virDomainDiskDefParseXML, virDomainDiskSourceDefFormatInternal) (virDomainDiskDefFormat, virDomainDiskGetActualType) (virDomainDiskDefForeachPath, virDomainDiskSourceIsBlockType): Likewise. * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Likewise. * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML) (virDomainSnapshotAlignDisks, virDomainSnapshotDiskDefFormat): Likewise. * src/esx/esx_driver.c (esxAutodetectSCSIControllerModel) (esxDomainDefineXML): Likewise. * src/locking/domain_lock.c (virDomainLockManagerAddDisk): Likewise. * src/lxc/lxc_controller.c (virLXCControllerSetupLoopDeviceDisk) (virLXCControllerSetupNBDDeviceDisk) (virLXCControllerSetupLoopDevices, virLXCControllerSetupDisk): Likewise. * src/parallels/parallels_driver.c (parallelsGetHddInfo): Likewise. * src/phyp/phyp_driver.c (phypDiskType): Likewise. * src/qemu/qemu_command.c (qemuGetDriveSourceString) (qemuDomainDiskGetSourceString, qemuBuildDriveStr) (qemuBuildCommandLine, qemuParseCommandLineDisk) (qemuParseCommandLine): Likewise. * src/qemu/qemu_conf.c (qemuCheckSharedDevice) (qemuTranslateDiskSourcePool) (qemuTranslateSnapshotDiskSourcePool): Likewise. * src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse) (qemuDomainDetermineDiskChain): Likewise. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo) (qemuDomainSnapshotPrepareDiskExternalBackingInactive) (qemuDomainSnapshotPrepareDiskExternalBackingActive) (qemuDomainSnapshotPrepareDiskExternalOverlayActive) (qemuDomainSnapshotPrepareDiskExternalOverlayInactive) (qemuDomainSnapshotPrepareDiskInternal) (qemuDomainSnapshotPrepare) (qemuDomainSnapshotCreateSingleDiskActive): Likewise. * src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia): Likewise. * src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise. * src/security/security_apparmor.c (AppArmorRestoreSecurityImageLabel) (AppArmorSetSecurityImageLabel): Likewise. * src/security/security_dac.c (virSecurityDACSetSecurityImageLabel) (virSecurityDACRestoreSecurityImageLabelInt) (virSecurityDACSetSecurityAllLabel): Likewise. * src/security/security_selinux.c (virSecuritySELinuxRestoreSecurityImageLabelInt) (virSecuritySELinuxSetSecurityImageLabel) (virSecuritySELinuxSetSecurityAllLabel): Likewise. * src/storage/storage_backend.c (virStorageFileBackendForType): Likewise. * src/storage/storage_backend_fs.c (virStorageFileBackendFile) (virStorageFileBackendBlock): Likewise. * src/storage/storage_backend_gluster.c (virStorageFileBackendGluster): Likewise. * src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc, vboxAttachDrives) (vboxDomainAttachDeviceImpl, vboxDomainDetachDevice): Likewise. * src/vmware/vmware_conf.c (vmwareVmxPath): Likewise. * src/vmx/vmx.c (virVMXParseDisk, virVMXFormatDisk) (virVMXFormatFloppy): Likewise. * src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenParseSxpr) (xenFormatSxprDisk): Likewise. * src/xenxs/xen_xm.c (xenParseXM, xenFormatXMDisk): Likewise. * tests/securityselinuxlabeltest.c (testSELinuxLoadDef): Likewise. * src/libvirt_private.syms (domain_conf.h): Move symbols... (virstoragefile.h): ...as appropriate. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 25 3月, 2014 2 次提交
-
-
由 Ján Tomko 提交于
-
由 Eric Blake 提交于
Part of a series of cleanups to use new accessor methods. * src/qemu/qemu_conf.c (qemuCheckSharedDevice) (qemuAddSharedDevice, qemuRemoveSharedDevice, qemuSetUnprivSGIO): Use accessors. * src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse) (qemuDomainObjCheckDiskTaint, qemuDomainSnapshotForEachQcow2Raw) (qemuDomainCheckRemoveOptionalDisk, qemuDomainCheckDiskPresence) (qemuDiskChainCheckBroken, qemuDomainDetermineDiskChain): Likewise. * src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia) (qemuDomainCheckEjectableMedia) (qemuDomainAttachVirtioDiskDevice, qemuDomainAttachSCSIDisk) (qemuDomainAttachUSBMassstorageDevice) (qemuDomainAttachDeviceDiskLive, qemuDomainRemoveDiskDevice) (qemuDomainDetachVirtioDiskDevice, qemuDomainDetachDiskDevice): Likewise. * src/qemu/qemu_migration.c (qemuMigrationStartNBDServer) (qemuMigrationDriveMirror, qemuMigrationCancelDriveMirror) (qemuMigrationIsSafe): Likewise. * src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase) (qemuProcessHandleIOError, qemuProcessHandleBlockJob) (qemuProcessInitPasswords): Likewise. * src/qemu/qemu_driver.c (qemuDomainChangeDiskMediaLive) (qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 18 3月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Any source file which calls the logging APIs now needs to have a VIR_LOG_INIT("source.name") declaration at the start of the file. This provides a static variable of the virLogSource type. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 13 3月, 2014 4 次提交
-
-
由 Chunyan Liu 提交于
Add VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN. For legacy xen, it will use "pciback" as stub driver.
-
由 Chunyan Liu 提交于
Change any method names with Usb, Pci or Scsi to use USB, PCI and SCSI since they are abbreviations. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Chunyan Liu 提交于
For extracting hostdev codes from qemu_hostdev.c to common library, change qemu specific cfg->relaxedACS handling to be a flag, and pass it to hostdev functions.
-
由 Chunyan Liu 提交于
Same logic of preparing/reattaching hostdevs could be used in attach/detach hotplug places, so reuse hostdev interfaces to avoid duplicate, also for later extracting general code to common library.
-
- 11 3月, 2014 2 次提交
-
-
由 Daniel P. Berrange 提交于
The qemu_bridge_filter.c file had some helpers for calling the ebtablesXXX functions todo bridge filtering. The only thing these helpers did was to overwrite the original error message from the ebtables code. For added fun, the callers of these helpers overwrote the errors yet again. For even more fun, one of the helpers called another helper and overwrite its errors too. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Stefan Berger 提交于
Avoid the freeing of an array of zero file descriptors in case of error. Initialize the array to -1 using memset. Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
-
- 10 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Some of these are leftovers from renaming the files, others are just typos. Also introduce an ugly awk script to enforce this.
-
- 18 2月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
There might be some use cases, where user wants to prepare the host or its environment prior to starting a network and do some cleanup after the network has been shut down. Consider all the functionality that libvirt doesn't currently have as an example what a hook script can possibly do. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 10 2月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
The code took into account only the global permissions. The domains now support per-vm DAC labels and per-image DAC labels. Use the most specific label available.
-
- 04 2月, 2014 1 次提交
-
-
由 Laine Stump 提交于
commit f094aaac changed qemuPrepareHostdevPCIDevices() such that it may modify the "backend" (vfio vs. legacy kvm) setting in the virHostdevDef. However, qemuDomainAttachHostPciDevice() (used by hotplug) copies the backend setting into a local *before* calling qemuPrepareHostdevPCIDevices(), and then later makes a decision based on that pre-change value. The result is that, if the backend had been set to "default" (i.e. not specified in the config) and was later updated to "VFIO" by qemuPrepareHostdevPCIDevices(), the qemu process' MacMemLock is not increased (as is required for VFIO device assignment). This patch delays making the local copy of backend until after its potential modification.
-
- 09 1月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
Yet another advice appeared on the Multiqueue wiki page: http://www.linux-kvm.org/page/Multiqueue#Enable_MQ_feature We should add vectors=N onto the qemu command line, where N = 2 * (number of queues) + 1.
-
- 23 12月, 2013 2 次提交
-
-
由 Laine Stump 提交于
This eliminates the misleading error message that was being logged when a vfio hostdev hotplug failed: error: unable to set user and group to '107:107' on '/dev/vfio/22': No such file or directory as documented in: https://bugzilla.redhat.com/show_bug.cgi?id=1035490 Commit ee414b5d (pushed as a fix for Bug 1016511 and part of Bug 1025108) replaced the single call to virSecurityManagerSetHostdevLabel() in qemuDomainAttachHostDevice() with individual calls to that same function in each device-type-specific attach function (for PCI, USB, and SCSI). It also added a corresponding call to virSecurityManagerRestoreHostdevLabel() in the error handling of the device-type-specific functions, but forgot to remove the common call to that from qemuDomainAttachHostDevice() - this resulted in a duplicate call to virSecurityManagerRestoreHostdevLabel(), with the second occurrence being after (e.g.) a PCI device has already been re-attached to the host driver, thus destroying some of the device nodes / links that we then attempted to re-label (e.f. /dev/vfio/22) and generating an error log that obscured the original error.
-
由 Laine Stump 提交于
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1035490 virProcessSetMaxMemLock() (which is a wrapper over prlimit(3)) expects the memory size in bytes, but libvirt's domain definition (which was being used by qemuDomainAttachHostPciDevice()) stores all memory tuning parameters in KiB. This was being accounted for when setting MaxMemLock at domain startup time (so cold-plugged devices would work), but not for hotplug. This patch simplifies the few lines that call virProcessSetMemMaxLock(), and multiply the amount * 1024 so that we're locking the correct amount of memory. What remains a mystery to me is why hot-plug of a managed='no' device would succeed (at least on my system) while managed='yes' would fail. I guess in one case the memory was coincidentally already resident and in the other it wasn't.
-
- 10 12月, 2013 4 次提交
-
-
由 Cédric Bosdonnat 提交于
The virDomainEvent class is kept as it indicates what meta informations are valid for the children classes. This may be useful in the future.
-
由 Cole Robinson 提交于
We were unconditionally removing the device from the host list, when it should only be done on error. This fixes USB collision detection when hotplugging the same device to two guests.
-
由 Cole Robinson 提交于
If we hit a collision, we free the USB device while it is still part of our temporary USBDeviceList. When the list is unref'd, the device is free'd again. Make the initial device freeing dependent on whether it is present in the temporary list or not.
-
由 Cole Robinson 提交于
Similar to what Jiri did for cgroup setup/teardown in 05e149f9, push it all into the device handler functions so we can do the necessary prep work before claiming the device. This also fixes hotplugging USB devices by product/vendor (virt-manager's default behavior): https://bugzilla.redhat.com/show_bug.cgi?id=1016511
-
- 06 12月, 2013 1 次提交
-
-
由 Cole Robinson 提交于
They aren't used outside of qemu_hotplug.c
-
- 03 12月, 2013 1 次提交
-
-
由 Laine Stump 提交于
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1029732 The BZ asked for the capability to change the number of queues used by a virtio-net device while the device is in use. Because the number of queues can only be set at the time the device is created, that isn't possible. However, libvirt also shouldn't be silently reporting success when someone tries to change the number of queues. So this patch flags that as an error (just as attempts to change any of the other virtio-specific parameters already do).
-
- 21 11月, 2013 3 次提交
-
-
由 Eric Farman 提交于
If a SCSI hostdev is included in an initial domain XML, without a corresponding controller statement, one is created silently when the guest is booted. When hotplugging a SCSI hostdev, a presumption is that the controller is already present in the domain either from the original XML, or via an earlier hotplug. [root@xxxxxxxx ~]# cat disk.xml <hostdev mode='subsystem' type='scsi'> <source> <adapter name='scsi_host0'/> <address bus='0' target='3' unit='1088438288'/> </source> </hostdev> [root@xxxxxxxx ~]# virsh attach-device guest01 disk.xml error: Failed to attach device from disk.xml error: internal error: unable to execute QEMU command 'device_add': Bus 'scsi0.0' not found Since the infrastructure is in place, we can also create a controller silently for use by the hotplugged hostdev device. Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
-
由 Eric Farman 提交于
For systems without a PCI bus, attaching a SCSI controller fails: [root@xxxxxxxx ~]# cat controller.xml <controller type='scsi' model='virtio-scsi' index='0' /> [root@xxxxxxxx ~]# virsh attach-device guest01 controller.xml error: Failed to attach device from controller.xml error: XML error: No PCI buses available A similar problem occurs with the detach of a controller: [root@xxxxxxxx ~]# virsh detach-device guest01 controller.xml error: Failed to detach device from controller.xml error: operation failed: controller scsi:0 not found The qemuDomainXXtachPciControllerDevice routines made assumptions that any caller had a PCI bus. These routines now selectively calls PCI functions where necessary, and assigns the device information type to one appropriate for the bus in use. Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
由 Eric Farman 提交于
For attach/detach of controller devices, we rename the functions to remove 'PCI' from their title. The actual separation of PCI-specific operations will be handled in the next patch. Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
-
- 15 11月, 2013 1 次提交
-
-
由 Jiri Denemark 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1025108 So far qemuSetupHostdevCGroup was called very early during hotplug, even before we knew the device we were about to hotplug was actually available. By calling the function later, we make sure QEMU won't be allowed to access devices used by other domains. Another important effect of this change is that hopluging USB devices specified by vendor and product (but not by their USB address) works again. This was broken since v1.0.5-171-g7d763aca, when the call to qemuFindHostdevUSBDevice was moved after the call to qemuSetupHostdevCGroup, which then used an uninitialized USB address.
-
- 08 11月, 2013 1 次提交
-
-
由 Vitor de Lima 提交于
This patch moves some code in the qemuDomainAttachSCSIDisk function. The check for the existence of a PCI address assigned to the SCSI controller was moved in order to be executed only when needed. The PCI address of a controller is not necessary if QEMU_CAPS_DEVICE is supported. This fixes issues with the hotplug of SCSI disks on pseries guests.
-
- 21 10月, 2013 3 次提交
-
-
由 Laine Stump 提交于
This patch (and the two patches that precede it) resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1005682 When libvirt was changed to delay the final cleanup of device removal until the qemu process had signaled it with a DEVICE_DELETED event for that device, the hostdev removal function (qemuDomainRemoveHostDevice()) was written to properly handle the removal of a hostdev that was actually an SRIOV virtual function (defined with <interface type='hostdev'>). However, the function used to search for a device matching the alias name provided in the DEVICE_DELETED message (virDomainDefFindDevice()) would search through the list of netdevs before hostdevs, so qemuDomainRemoveHostDevice() was never called; instead the netdev function, qemuDomainRemoveNetDevice() (which *doesn't* properly cleanup after removal of <interface type='hostdev'>), was called. (As a reminder - each <interface type='hostdev'> results in a virDomainNetDef which contains a virDomainHostdevDef having a parent type of VIR_DOMAIN_DEVICE_NET, and parent.data.net pointing back to the virDomainNetDef; both Defs point to the same device info object (and the info contains the device's "alias", which is used by qemu to identify the device). The virDomainHostdevDef is added to the domain's hostdevs list *and* the virDomainNetDef is added to the domain's nets list, so searching either list for a particular alias will yield a positive result.) This function modifies the qemuDomainRemoveNetDevice() to short circuit itself and call qemu DomainRemoveHostDevice() instead when the actual device is a VIR_DOMAIN_NET_TYPE_HOSTDEV (similar logic to what is done in the higher level qemuDomainDetachNetDevice()) Note that even if virDomainDefFindDevice() changes in the future so that it finds the hostdev entry first, the current code will continue to work properly.
-
由 Laine Stump 提交于
pure code movement to setup for next patch.
-
由 Laine Stump 提交于
This function was called in three places, and in each the call was qualified by a slightly different conditional. In reality, this function should only be called for a hostdev if all of the following are true: 1) mode='subsystem' 2) type='pci' 3) there is a parent device definition which is an <interface> (VIR_DOMAIN_DEVICE_NET) We can simplify the callers and make them more consistent by checking these conditions at the top ov qemuDomainHostdevNetConfigRestore and returning 0 if one of them isn't satisfied. The location of the call to qemuDomainHostdevNetConfigRestore() has also been changed in the hot-plug case - it is moved into the caller of its previous location (i.e. from qemuDomainRemovePCIHostDevice() to qemuDomainRemoveHostDevice()). This was done to be more consistent about which functions pay attention to whether or not this is one of the special <interface> hostdevs or just a normal hostdev - qemuDomainRemoveHostDevice() already contained a call to networkReleaseActualDevice() and virDomainNetDefFree(), so it makes sense for it to also handle the resetting of the device's MAC address and vlan tag (which is what's done by qemuDomainHostdevNetConfigRestore()).
-
- 10 10月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Prefer using VFIO (if available) to the legacy KVM device passthrough. With this patch a PCI passthrough device without the driver configured will be started with VFIO if it's available on the host. If not legacy KVM passthrough is checked and error is reported if it's not available.
-
- 08 10月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
To simplify future patches dealing with this code, simplify and refactor some conditions to switch statements.
-
- 02 10月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
The qemuDomainChangeNet() is called when 'virsh update-device' is invoked on a NIC. Currently, we fail to update the QoS even though we have routines for that. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 26 9月, 2013 1 次提交
-
-
由 Chen Hanxiao 提交于
The return value of virDomainControllerFind >=0 means that the specific controller was found. But some functions invoke it and treat 0 as not found. This patch fix these incorrect invocation. Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
-
- 02 9月, 2013 1 次提交
-
-
由 John Ferlan 提交于
Remove unused 'cgroup' variable in qemuDomainAttachDeviceDiskLive() to resolve coverity DEADCODE complaint
-
- 29 8月, 2013 2 次提交
-
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
When using a <interface type="network"> that points to a network with hostdev forwarding mode a hostdev alias is created for the network. This allias is inserted into the hostdev list, but is backed with a part of the network object that it is connected to. When a VM is being stopped qemuProcessStop() calls networkReleaseActualDevice() which eventually frees the memory for the hostdev object. Afterwards when the domain definition is being freed by virDomainDefFree() an invalid pointer is accessed by virDomainHostdevDefFree() and may cause a crash of the daemon. This patch removes the entry in the hostdev list before freeing the depending memory to avoid this issue. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1000973
-
- 26 8月, 2013 1 次提交
-
-
由 Michal Privoznik 提交于
If there's no hard_limit set and domain uses VFIO we still must lock the guest memory (prerequisite from qemu). Hence, we should compute the amount to be locked from max_balloon.
-