summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* vz: drop prlsdkDomainHasSnapshotsNikolay Shirokovskiy2016-05-181-69/+18
| | | | | | Let's use introduced domain snapshots infrastructure instead. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
* vz: add domain snapshots functionalityNikolay Shirokovskiy2016-05-185-0/+759
| | | | | | | | | | | | | This solution does not keep snapshots cache because vz sdk lacks good support for snapshot related events. Libvirt and vz sdk has different approach to snapshot ids. vz sdk always auto generate them while libvirt has ability to specify id by user. Thus I have no other choice rather than simply ignore ids set by user or generated by libvirt. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
* iscsi: Remove initiatoriqn from virISCSIScanTargetsJohn Ferlan2016-05-183-9/+3
| | | | No longer necessary to have it, so remove it.
* util: Remove disabling of autologin for iscsi-targetsFritz Elfert2016-05-181-28/+2
| | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1331552 Instead of disabling auto-login of all scsi targets (even those that do not "belong" to libvirt), use iscsiadm's "--op nonpersistent" during discovery of iSCSI targets (e.g. "iscsiadm --mode discovery --type sendtargets") in order to avoid the node database being altered which led to the need for the "large hammer" approach taken by commit id '3c12b654'. This commit removes the virISCSITargetAutologin adjustment (eg. the setting of node.startup to "manual"). The iscsiadm command has supported this mode of operation as of commit id 'ad873767' to open-iscsi.
* iscsi: Add exit status checking for virISCSIGetSessionJohn Ferlan2016-05-181-6/+10
| | | | | | | | | | | | | | | | | | Utilize the exit status parameter for virCommandRunRegex in order to check the return error from the 'iscsiadm --mode session' command. Without this enabled, if there are no sessions running then virCommandRun would have displayed an error such as: 2016-05-13 15:17:15.165+0000: 10920: error : virCommandWait:2553 : internal error: Child process (iscsiadm --mode session) unexpected exit status 21: iscsiadm: No active sessions. It is possible that for certain paths (when probe is true) we only care whether it's running or not to make certain decisions. Spitting out the error for those paths is unnecessary. If we do have a situation where probe = false and there's an error, then display the error from iscsiadm if it's there.
* util: Add exitstatus parameter to virCommandRunRegexJohn Ferlan2016-05-185-11/+17
| | | | | | Rather than have virCommandRun just spit out the error, allow callers to decide to pass the exitstatus so the caller can make intelligent decisions based on the error.
* qemu: Add virQEMUCapsSetGICCapabilities()Andrea Bolognani2016-05-182-4/+30
| | | | For use in the test suite.
* qemu: Automatically choose usable GIC versionAndrea Bolognani2016-05-181-12/+29
| | | | | | | | | | | | | When the <gic/> element in not present in the domain XML, use the domain capabilities to figure out what GIC version is usable and choose that one automatically. This allows guests to be created on hardware that only supports GIC v3 without having to update virt-manager and similar tools. Keep using the default GIC version if the <gic/> element has been added to the domain XML but no version has been specified, as not to break existing guests.
* qemu: Add virQEMUCapsSupportsGICVersion()Andrea Bolognani2016-05-182-11/+50
| | | | | | This utility function extracts some of the logic from virQEMUCapsFillDomainFeatureGICCaps() so that it can be used in a different context.
* Change return value of VIR_APPEND*INPLACE* to voidJiri Denemark2016-05-183-16/+13
| | | | | The INPLACE variants of the VIR_APPEND macros cannot fail and they are inherently quiet.
* Remove virDomainRNGInsertJiri Denemark2016-05-185-19/+2
| | | | It was just a useless wrapper around VIR_APPEND_ELEMENT*.
* xenFormatNet: correct `type=netfront' to 'type=vif' to match libxlChunyan Liu2016-05-174-16/+40
| | | | | | | | | | | | | | | | | | | | | | According to current xl.cfg docs and xl codes, it uses type=vif instead of type=netfront. Currently after domxml-to-native, libvirt xml model=netfront will be converted to xl type=netfront. This has no problem before, xen codes for a long time just check type=ioemu, if not, set type to _VIF. Since libxl uses parse_nic_config to avoid duplicate codes, it compares 'type=vif' and 'type=ioemu' for valid parameters, others are considered as invalid, thus we have problem with type=netfront in xl config file. #xl create sles12gm-hvm.orig Parsing config from sles12gm-hvm.orig Invalid parameter `type'. Correct the conversion in libvirt, so that it matchs libxl codes and also xl.cfg. Signed-off-by: Chunyan Liu <cyliu@suse.com>
* extract XEN_CONFIG_FORMAT_XM/XL to xen_common.hChunyan Liu2016-05-173-12/+9
| | | | | | | Unify XEN_CONFIG_FORMAT_x and LIBXL_CONFIG_FORMAT_x to XEN_CONFIG_FORMAT_x, and move to xen_common.h. Signed-off-by: Chunyan Liu <cyliu@suse.com>
* bhyve: implement virConnectIsSecureFabian Freyer2016-05-171-0/+8
| | | | | Trivially return 1, since bhyve is considered a local connection that should not be vulnerable to eavesdropping.
* bhyve: Implement virConnectIsEncryptedFabian Freyer2016-05-171-0/+8
| | | | | Being a local connection, bhyve does not support encryption. Therefore trivially return 0.
* Revert "vz: handle sourceless cdroms"Maxim Nestratov2016-05-171-6/+4
| | | | | | This reverts commit 071fe092. It was committed by a mistake and correct patch was committed earlier as baad90fb.
* qemu: hotplug: Report error if we hit tray status timeoutCole Robinson2016-05-171-1/+7
| | | | | If we exceed the timeout waiting for the tray status to change, we don't report an error. Fix it
* vz: make error path code idiomaticNikolay Shirokovskiy2016-05-171-3/+4
| | | | | Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
* vz: fix template ct creationMikhail Feoktistov2016-05-171-2/+8
| | | | | | | First we don't need to add disk in this case. Second flag should be skipped. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
* vz: fix error message for readonly fsNikolay Shirokovskiy2016-05-171-1/+1
| | | | Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
* vz: handle sourceless cdromsMikhail Feoktistov2016-05-171-4/+6
| | | | | | | | | | | | | SDK handles empty cdroms all right. We just need to pass "" instead of NULL (not setting is good too). However we can get problems here. Disk detaching treats source as ids. Fortunately disk detaching is not supported for cdroms yet and for hard disks we can not get empty source - this is prohibitited by xml parsing code. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
* vz: fix vzCheckUnsupportedDisks format checks for cdromsNikolay Shirokovskiy2016-05-171-13/+9
| | | | | | | | | | | | | | Current version of the function does not check format of cdroms at all. At the same time prlsdkGetDiskInfo give hints that cdroms always have format VIR_STORAGE_FILE_RAW. So fix vzCheckUnsupportedDisks. About structure of checks. As we don't have means to store format in SDK we always have only one format in every situation. So instead of setting boolean let's get allowed format instead and finally compare it to the requested. This structure of checks seems stable to me because we have only one format in every situation. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
* vz: remove check for auto file format for disksNikolay Shirokovskiy2016-05-171-2/+1
| | | | | | | | | VIR_STORAGE_FILE_AUTO can not be set from xml description. At the same time we don't set disks format to this value as for example qemu does. Thus this we can never get this value in format. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
* domain_conf: cleanup virDomainGraphicsListenDefParseXMLPavel Hrdina2016-05-171-3/+2
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* graphics: make address attribute for listen type='address' optionalPavel Hrdina2016-05-177-25/+29
| | | | | | | | | We support omitting listen attribute of graphics element so we should also support omitting address attribute of listen element. This patch also updates libvirt to always add a listen element into domain XML except for VNC graphics if socket attribute is specified. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* domain_conf: parse listen attribute while parsing listen elementsPavel Hrdina2016-05-171-34/+51
| | | | | | | | | | | | | | | Move the compatibility code out of virDomainGraphicsListensParseXML() into virDomainGraphicsListenDefParseXML(). This also fixes a small inconsistency between the code and error message itself. Before this patch we would search first listen element that is type='address' to validate listen and address attributes. After this patch we always take the first listen element regardless of the type. This shouldn't break anything since all drivers supports only one listen. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* graphics: don't parse listens if socket attribute is presentPavel Hrdina2016-05-171-0/+8
| | | | | | | | If socket attribute is present we start VNC that listens only on that unix socket. This makes the parser behave the same way as we actually use the socket attribute. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* conf: Allow all volume modes for disk type='lun' sourcesPeter Krempa2016-05-171-20/+12
| | | | | | | | Commit 82ba41108acd0f3f made possible to use direct mapped iSCSI volumes in qemu as disk sources but didn't remove the define time check. Rework the check by simplifying the condition and allow any volumes to be used with disk type='lun'.
* qemu: Drop QEMU_CAPS_VIRTIO_BLK_SG_IOAndrea Bolognani2016-05-173-20/+3
| | | | | The only QEMU versions that don't have such capability are <0.11, which we no longer support anyway
* qemu: Drop QEMU_CAPS_CPU_HOSTAndrea Bolognani2016-05-173-18/+5
| | | | | The only QEMU versions that don't have such capability are <0.11, which we no longer support anyway
* qemu: Drop QEMU_CAPS_PCI_ROMBARAndrea Bolognani2016-05-173-24/+4
| | | | | | | | | The only QEMU versions that don't have such capability are <0.12, which we no longer support anyway. Additionally, this solves the issue of some QEMU binaries being reported as not having such capability just because they lacked the {kvm-}pci-assign QMP object.
* libxl: Free migration cookieJohn Ferlan2016-05-161-1/+4
| | | | | | | | | | | | | | | Commit id 'f9edcfa4' added cookie manipulation for libxl; however, some cookie crumb cleanup was missed. Found by Coverity. In libxlDomainMigrationBegin, the cookie is allocated and baked; however, the mig ingredients weren't cleaned up. In libxlDomainMigrationPrepare, when the 'mig' cookie is added to the args, set the 'mig = NULL'; otherwise, other failure paths between when the code ate the cookie data and when it was added to args would fail to clean up the crumbs. Signed-off-by: John Ferlan <jferlan@redhat.com>
* qemu: More qemu_monitor_json cleanupsJohn Ferlan2016-05-161-21/+25
| | | | | | | | | | | Recent adjustments to the code produced a litany of coverity false positives, but only because the "standard" procedure of setting a variable to NULL after it was assigned to something else and keeping the *Free/*FREE call in the cleanup path wasn't kept. So this patch makes those adjustments (assign variable to NULL and remove the if 'ret < 0' condition to clean it up). Signed-off-by: John Ferlan <jferlan@redhat.com>
* bhyve: implement virConnectIsAliveFabian Freyer2016-05-161-0/+6
| | | | | bhyve connections are local, and a "connection will be classed as alive if it is [...] local".
* qemu: command: Use -name guest= if availableCole Robinson2016-05-163-0/+7
| | | | | | | -name guest= is the explicit parameter for passing a VM name. Using it is required to allow a VM with an '=' in the name https://bugzilla.redhat.com/show_bug.cgi?id=1276485
* qemu: command: escape commas in chardev socket pathCole Robinson2016-05-161-5/+4
| | | | | | | After this, a default virt-manager VM will startup with a comma in the VM name: https://bugzilla.redhat.com/show_bug.cgi?id=639926
* qemu: command: escape commas in VNC socket pathCole Robinson2016-05-161-1/+2
| | | | This path can be dependent on the VM libdir, which contains its name
* qemu: command: escape commas in secret master pathCole Robinson2016-05-161-2/+5
| | | | | Need to convert the local function to virBuffer usage, so we can use qemuBufferEscapeComma
* qemu: command: escape commas in VM nameCole Robinson2016-05-161-1/+1
| | | | | This isn't sufficient on its own, since the VM name is used for things like monitor paths, which we don't escape yet
* qemu: command: Add qemuBufferEscapeCommaCole Robinson2016-05-161-4/+21
| | | | | Centralize the magic invocation for escaping commas on the qemu command line, and document it a bit
* qemu: alias: Remove QEMU_CAPS_DEVICECole Robinson2016-05-161-78/+4
| | | | | QEMU_CAPS_DEVICE is always set nowadays, so drop code that depends on not-DEVICE
* cpu: Properly report errors when parsing CPU map XMLJiri Denemark2016-05-161-10/+1
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* cpu_x86: Check vendor earlyJiri Denemark2016-05-161-11/+16
| | | | | | | | When searching for the best CPU model for CPUID data we can easily ignore models with non-matching vendor before spending time on CPUID data to virCPUDef conversion. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* cpu_x86: Don't ignore parsing errors in x86ModelLoadJiri Denemark2016-05-161-19/+16
| | | | | | | CPU map XML is our internal data file, it makes no sense to tolerate any errors in it. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* cpu_x86: Don't ignore parsing errors in x86FeatureLoadJiri Denemark2016-05-161-20/+17
| | | | | | | CPU map XML is our internal data file, it makes no sense to tolerate any errors in it. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* cpu_x86: Don't ignore parsing errors in x86VendorLoadJiri Denemark2016-05-161-13/+10
| | | | | | | CPU map XML is our internal data file, it makes no sense to tolerate any errors in it. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* cpu_x86: Simplify insertions into a linked listJiri Denemark2016-05-161-25/+8
| | | | | | | The next pointer is initialized to NULL, overwriting to with another NULL doesn't hurt. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* cpu_x86: Remove comparisons to NULLJiri Denemark2016-05-161-33/+33
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* cpu_x86: Use for loop in x86DecodeJiri Denemark2016-05-161-7/+3
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
* cpu_x86: Rename cleanup labelsJiri Denemark2016-05-161-12/+12
| | | | Signed-off-by: Jiri Denemark <jdenemar@redhat.com>