Commit Graph

22666 Commits

Author SHA1 Message Date
Chunyan Liu
c4111209b8 xlconfigtest: add test case for type=vif in xl format
Signed-off-by: Chunyan Liu <cyliu@suse.com>
2016-05-17 14:09:11 -06:00
Chunyan Liu
03f8bba26e xenFormatNet: correct `type=netfront' to 'type=vif' to match libxl
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>
2016-05-17 14:09:11 -06:00
Chunyan Liu
f1066d0d46 extract XEN_CONFIG_FORMAT_XM/XL to xen_common.h
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>
2016-05-17 14:09:11 -06:00
Fabian Freyer
ef45eb9bc7 bhyve: implement virConnectIsSecure
Trivially return 1, since bhyve is considered a local connection that
should not be vulnerable to eavesdropping.
2016-05-17 20:18:04 +03:00
Fabian Freyer
32aa9ed3ba bhyve: Implement virConnectIsEncrypted
Being a local connection, bhyve does not support encryption. Therefore
trivially return 0.
2016-05-17 20:18:01 +03:00
Cole Robinson
90f9193cff spec: Remove %defattr usage
It was only needed for rpm versions that are much older than our
minimally supported distro

Some more details here: https://fedorahosted.org/fpc/ticket/77
2016-05-17 11:34:47 -04:00
Maxim Nestratov
9ef05d597e Revert "vz: handle sourceless cdroms"
This reverts commit 071fe092.
It was committed by a mistake and correct patch was committed
earlier as baad90fb.
2016-05-17 15:11:35 +03:00
Cole Robinson
1fad65d49a qemu: hotplug: Report error if we hit tray status timeout
If we exceed the timeout waiting for the tray status to change,
we don't report an error. Fix it
2016-05-17 08:09:04 -04:00
Cole Robinson
84120af628 docs: formatdomain: document virtio-mmio device addresses 2016-05-17 07:36:31 -04:00
Erik Skultety
ef6940b917 admin: include: Rename argument dmn to conn in virAdmConnectListServers
This is just a trivial cosmetic change, throughout all the APIs the argument
is called conn as from 'connection', having 'dmn' at just this single place
might look odd, so better change it now when the interface is still explicitly
disabled and we still have the ability to alter the signatures and public
names before officially enabling it.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2016-05-17 12:45:48 +02:00
Nikolay Shirokovskiy
e10a4c67c3 vz: make error path code idiomatic
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
2016-05-17 13:35:29 +03:00
Mikhail Feoktistov
4aef1a5e3e vz: fix template ct creation
First we don't need to add disk in this case. Second flag should
be skipped.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2016-05-17 13:35:29 +03:00
Nikolay Shirokovskiy
07761f5d39 vz: fix error message for readonly fs
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
2016-05-17 13:35:29 +03:00
Mikhail Feoktistov
071fe09260 vz: handle sourceless cdroms
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>
2016-05-17 13:35:28 +03:00
Nikolay Shirokovskiy
caff6b8043 vz: fix vzCheckUnsupportedDisks format checks for cdroms
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>
2016-05-17 13:35:28 +03:00
Nikolay Shirokovskiy
38e1e06845 vz: remove check for auto file format for disks
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>
2016-05-17 13:35:28 +03:00
Pavel Hrdina
f161e40152 domain_conf: cleanup virDomainGraphicsListenDefParseXML
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-17 10:41:45 +02:00
Pavel Hrdina
b33c14b342 graphics: make address attribute for listen type='address' optional
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>
2016-05-17 10:41:45 +02:00
Pavel Hrdina
38c9973f36 domain_conf: parse listen attribute while parsing listen elements
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>
2016-05-17 10:41:45 +02:00
Pavel Hrdina
360cbf6f83 graphics: don't parse listens if socket attribute is present
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>
2016-05-17 10:41:45 +02:00
Peter Krempa
72475ac3b3 conf: Allow all volume modes for disk type='lun' sources
Commit 82ba41108a 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'.
2016-05-17 07:09:56 +02:00
Andrea Bolognani
0e8a72a5ef qemu: Drop QEMU_CAPS_VIRTIO_BLK_SG_IO
The only QEMU versions that don't have such capability are <0.11,
which we no longer support anyway
2016-05-17 00:01:45 +02:00
Andrea Bolognani
859743c27c qemu: Drop QEMU_CAPS_CPU_HOST
The only QEMU versions that don't have such capability are <0.11,
which we no longer support anyway
2016-05-17 00:01:45 +02:00
Andrea Bolognani
8531b85ba6 qemu: Drop QEMU_CAPS_PCI_ROMBAR
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.
2016-05-17 00:01:45 +02:00
John Ferlan
1222a3032b libxl: Free migration cookie
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>
2016-05-16 13:41:17 -04:00
John Ferlan
52760707bc qemu: More qemu_monitor_json cleanups
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>
2016-05-16 13:41:10 -04:00
Fabian Freyer
a1efc9428b bhyve: implement virConnectIsAlive
bhyve connections are local, and a "connection will be classed as alive
if it is [...] local".
2016-05-16 19:19:49 +03:00
Cole Robinson
e3a6859019 qemu: command: Use -name guest= if available
-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
2016-05-16 10:30:38 -04:00
Cole Robinson
7dbbc0ca07 qemu: command: escape commas in chardev socket path
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
2016-05-16 10:30:38 -04:00
Cole Robinson
077ba95677 qemu: command: escape commas in VNC socket path
This path can be dependent on the VM libdir, which contains its name
2016-05-16 10:30:38 -04:00
Cole Robinson
3153ac08c9 qemu: command: escape commas in secret master path
Need to convert the local function to virBuffer usage, so we
can use qemuBufferEscapeComma
2016-05-16 10:30:38 -04:00
Cole Robinson
0f377eb1b0 qemu: command: escape commas in VM name
This isn't sufficient on its own, since the VM name is used for things
like monitor paths, which we don't escape yet
2016-05-16 10:30:38 -04:00
Cole Robinson
53d976b63a qemu: command: Add qemuBufferEscapeComma
Centralize the magic invocation for escaping commas on the qemu
command line, and document it a bit
2016-05-16 10:30:38 -04:00
Cole Robinson
ef2c82170f qemu: alias: Remove QEMU_CAPS_DEVICE
QEMU_CAPS_DEVICE is always set nowadays, so drop code that depends
on not-DEVICE
2016-05-16 10:29:39 -04:00
Erik Skultety
e54b81604d admin: Fix passing an incorrect readonly attribute to virNetServerServiceNew
When registering admin UNIX socket, a new service is created for it. This
service is incorrectly initialized to be readonly, which is later inherited by
all clients connected to the socket. In libvirt-admin's case there currently
isn't any use for the attribute anyway, but since the socket has root-only
access permissions, the least we can do is to make every admin client
connected to it report readonly as false.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2016-05-16 16:26:47 +02:00
Jiri Denemark
5b62a95176 cpu: Properly report errors when parsing CPU map XML
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:30 +02:00
Jiri Denemark
17924643ec cpu_x86: Check vendor early
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>
2016-05-16 15:46:30 +02:00
Jiri Denemark
1cc9a1d07c cpu_x86: Don't ignore parsing errors in x86ModelLoad
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>
2016-05-16 15:46:29 +02:00
Jiri Denemark
49da4cf168 cpu_x86: Don't ignore parsing errors in x86FeatureLoad
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>
2016-05-16 15:46:29 +02:00
Jiri Denemark
db8a1873fb cpu_x86: Don't ignore parsing errors in x86VendorLoad
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>
2016-05-16 15:46:29 +02:00
Jiri Denemark
945776dbc6 cpu_x86: Simplify insertions into a linked list
The next pointer is initialized to NULL, overwriting to with another
NULL doesn't hurt.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:28 +02:00
Jiri Denemark
26bfa2a63b cpu_x86: Remove comparisons to NULL
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:28 +02:00
Jiri Denemark
aa9e0ef0ef cpu_x86: Use for loop in x86Decode
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:28 +02:00
Jiri Denemark
2085f9a514 cpu_x86: Rename cleanup labels
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:27 +02:00
Jiri Denemark
ea51e6a045 cpu_x86: Compare CPU candidates in a separate function
Splitting the comparison into a separate function makes the code cleaner
and easier to update in the future.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:27 +02:00
Jiri Denemark
5b991c44ed cpu_x86: Rename struct virCPUx86DataIterator
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:27 +02:00
Jiri Denemark
5778daf7db cpu_x86: Rename enum compare_result
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:26 +02:00
Jiri Denemark
bc01151a03 cpu_x86: Rename struct x86_map
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:26 +02:00
Jiri Denemark
449e2d43cc cpu_x86: Rename struct x86_model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:26 +02:00
Jiri Denemark
44f9cf6c04 cpu_x86: Rename struct x86_kvm_feature
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2016-05-16 15:46:25 +02:00