- 24 7月, 2014 4 次提交
-
-
由 John Ferlan 提交于
Create a separate typedef for the hostdev union data describing USB. Then adjust the code to use the new pointer
-
由 Martin Kletzander 提交于
This patch adds back the virDomainDef typedef into domain_conf and makes all the numatune_conf functions independent of any virDomainDef definitions. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Eric Blake 提交于
Our seclabel parsing was repeatedly assigning malloc'd data into a temporary variable, without first freeing the previous use. Among other leaks flagged by valgrind: ==9312== 8 bytes in 1 blocks are definitely lost in loss record 88 of 821 ==9312== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9312== by 0x8C40369: strdup (strdup.c:42) ==9312== by 0x50EA799: virStrdup (virstring.c:676) ==9312== by 0x50FAEB9: virXPathString (virxml.c:90) ==9312== by 0x50FAF1E: virXPathStringLimit (virxml.c:112) ==9312== by 0x510F516: virSecurityLabelDefParseXML (domain_conf.c:4571) ==9312== by 0x510FB20: virSecurityLabelDefsParseXML (domain_conf.c:4720) While it was multiple problems, it looks like commit da78351b (thankfully unreleased) was to blame for all of them. * src/conf/domain_conf.c (virSecurityLabelDefParseXML): Plug leaks detected by valgrind. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1122205 Although the edits were changing in-memory XML, it was not flushed to disk; so unless some other action changes XML, a libvirtd restart would lose the changed information. * src/conf/domain_conf.c (virDomainObjSetMetadata): Add parameter, to save live status across restarts. (virDomainSaveXML): Allow for test driver. * src/conf/domain_conf.h (virDomainObjSetMetadata): Adjust signature. * src/bhyve/bhyve_driver.c (bhyveDomainSetMetadata): Adjust caller. * src/lxc/lxc_driver.c (lxcDomainSetMetadata): Likewise. * src/qemu/qemu_driver.c (qemuDomainSetMetadata): Likewise. * src/test/test_driver.c (testDomainSetMetadata): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 23 7月, 2014 3 次提交
-
-
由 Ján Tomko 提交于
For the values "default", "on", "off" Replaces virDeviceAddressPCIMulti virDomainFeatureState virDomainIoEventFd virDomainVirtioEventIdx virDomainDiskCopyOnRead virDomainMemDump virDomainPCIRombarMode virDomainGraphicsSpicePlaybackCompression
-
由 Ján Tomko 提交于
Replace all three-state (default/yes/no) enums with it: virDomainBIOSUseserial virDomainBootMenu virDomainPMState virDomainGraphicsSpiceClipboardCopypaste virDomainGraphicsSpiceAgentFileTransfer virNetworkDNSForwardPlainNames
-
由 Cédric Bosdonnat 提交于
Added <capabilities> in the <features> section of LXC domains configuration. This section can contain elements named after the capabilities like: <mknod state="on"/>, keep CAP_MKNOD capability <sys_chroot state="off"/> drop CAP_SYS_CHROOT capability Users can restrict or give more capabilities than the default using this mechanism.
-
- 18 7月, 2014 1 次提交
-
-
由 Cédric Bosdonnat 提交于
LXC network devices can now be assigned a custom NIC device name on the container side. For example, this is configured with: <interface type='network'> <source network='default'/> <guest dev="eth1"/> </interface> In this example the network card will appear as eth1 in the guest.
-
- 17 7月, 2014 4 次提交
-
-
由 Martin Kletzander 提交于
There were numerous places where numatune configuration (and thus domain config as well) was changed in different ways. On some places this even resulted in persistent domain definition not to be stable (it would change with daemon's restart). In order to uniformly change how numatune config is dealt with, all the internals are now accessible directly only in numatune_conf.c and outside this file accessors must be used. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
Since there was already public virDomainNumatune*, I changed the private virNumaTune to match the same, so all the uses are unified and public API is kept: s/vir\(Domain\)\?Numa[tT]une/virDomainNumatune/g then shrunk long lines, and mainly functions, that were created after that: sed -i 's/virDomainNumatuneMemPlacementMode/virDomainNumatunePlacement/g' And to cope with the enum name, I haad to change the constants as well: s/VIR_NUMA_TUNE_MEM_PLACEMENT_MODE/VIR_DOMAIN_NUMATUNE_PLACEMENT/g Last thing I did was at least a little shortening of already long name: s/virDomainNumatuneDef/virDomainNumatune/g Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
to ease the review of commits to follow. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Michele Paolino 提交于
This patch adds support for the QEMU vhost-user feature to libvirt. vhost-user enables the communication between a QEMU virtual machine and other userspace process using the Virtio transport protocol. It uses a char dev (e.g. Unix socket) for the control plane, while the data plane based on shared memory. The XML looks like: <interface type='vhostuser'> <mac address='52:54:00:3b:83:1a'/> <source type='unix' path='/tmp/vhost.sock' mode='server'/> <model type='virtio'/> </interface> Signed-off-by: NMichele Paolino <m.paolino@virtualopensystems.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 14 7月, 2014 2 次提交
-
-
由 Michal Privoznik 提交于
Instead of allocating the virSecurityLabelDef structure ourselves, we can utilize virSecurityLabelDefNew which even sets the default values for us. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1113860 We've always done that. Well, until 990e46c4. Point is, if we don't format model, we may lose a domain on libvirtd restart. If the seclabel is implicit however, we should skip it's formatting. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 11 7月, 2014 3 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1066894 With current code it's possible to have for instance: virsh dumpxml mydomain | grep seclabel <seclabel type='dynamic' model='selinux' relabel='yes'/> <seclabel type='dynamic' model='selinux' relabel='yes'/> <seclabel type='dynamic' model='selinux' relabel='yes'/> <seclabel type='dynamic' model='selinux' relabel='yes'/> <seclabel type='dynamic' model='selinux' relabel='yes'/> what doesn't make any sense. We should reject the XML in the config parsing phase. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Similarly to the previous commit, boolean variables should not start with 'no-' prefix. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
This negation in names of boolean variables is driving me insane. The code is much more readable if we drop the 'no-' prefix. Well, at least for me. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 09 7月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
Split out checking of invalid metadata type from the switch statement so that we can use the typecasted enum value to allow tracking addition of new items by the compliler. Also avoids two dead-code break statements.
-
- 08 7月, 2014 3 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Peter Krempa 提交于
In the future we might need to track state of individual images. Move the readonly and shared flags to the virStorageSource struct so that we can keep them in a per-image basis.
-
由 Peter Krempa 提交于
Some of the further changes will propagate seclabels from a disk source element into the backing store elements. This would change the XML output of the backing store as the seclabels would be formatted for each backing store element. Skip the seclabels formatting until we decide that it's necessary.
-
- 04 7月, 2014 1 次提交
-
-
由 John Ferlan 提交于
Replace the inline "auth" struct in virStorageSource with a pointer to a virStorageAuthDefPtr and utilize between the domain_conf, qemu_conf, and qemu_command sources for finding the auth data for a domain disk
-
- 03 7月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
Replace: if (virBufferError(&buf)) { virBufferFreeAndReset(&buf); virReportOOMError(); ... } with: if (virBufferCheckError(&buf) < 0) ... This should not be a functional change (unless some callers misused the virBuffer APIs - a different error would be reported then)
-
- 02 7月, 2014 1 次提交
-
-
由 Mike Perez 提交于
This introduces two new attributes "cmd_per_lun" and "max_sectors" same with the names QEMU uses for virtio-scsi. An example of the XML: <controller type='scsi' index='0' model='virtio-scsi' cmd_per_lun='50' max_sectors='512'/> The corresponding QEMU command line: -device virtio-scsi-pci,id=scsi0,cmd_per_lun=50,max_sectors=512, bus=pci.0,addr=0x3 Signed-off-by: NMike Perez <thingee@gmail.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 30 6月, 2014 1 次提交
-
-
由 Chen Hanxiao 提交于
Throwing an error is much friendly than just "error: An error occurred, but the cause is unknown" Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
-
- 26 6月, 2014 1 次提交
-
-
由 Chen Fan 提交于
Fix missing whitespace when parsing 'managed' attribute. Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 20 6月, 2014 1 次提交
-
-
由 Peter Krempa 提交于
The image labels are stored in the virStorageSource struct. Convert the virDomainDiskDefGetSecurityLabelDef helper not to use the full disk def and move it appropriately.
-
- 17 6月, 2014 1 次提交
-
-
由 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>
-
- 13 6月, 2014 1 次提交
-
-
由 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>
-
- 07 6月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Now that we track a disk mirror as a virStorageSource, we might as well update the XML to theoretically allow any type of mirroring destination (not just a local file). A later patch will also be reusing <mirror> to track the block commit of the top layer of a chain, which is another case where libvirt needs to update the backing chain after the job is finally pivoted, and since backing chains can have network backing files as the destination to commit into, it makes more sense to display that in the XML. This patch changes output-only XML; it was already documented that <mirror> does not affect a domain definition at this point (because qemu doesn't provide persistent bitmaps yet). Any application that was starting a block copy job with older libvirt and then relying on the domain XML to determine if it was complete will no longer be able to access the file= and format= attributes of mirror that were previously used. However, this is not going to be a problem in practice: the only time a block copy job works is on a transient domain, and any app that is managing a transient domain probably already does enough of its own bookkeeping to know which file it is mirroring into without having to re-read it from the libvirt XML. The one thing that was likely to be used in a mirroring job was the ready= attribute, which is unchanged. Meanwhile, I made sure the schema and parser still accept the old format, even if we no longer output it, so that upgrading from an older version of libvirt is seamless. * docs/schemas/domaincommon.rng (diskMirror): Alter definition. * src/conf/domain_conf.c (virDomainDiskDefParseXML): Parse two styles of mirror elements. (virDomainDiskDefFormat): Output new style. * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror-old.xml: New file, copied from... * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: ...here before modernizing. * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old*: New files. * tests/qemuxml2xmltest.c (mymain): Test both styles. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 06 6月, 2014 4 次提交
-
-
由 Eric Blake 提交于
The current implementation of 'virsh blockcopy' (virDomainBlockRebase) is limited to copying to a local file name. But future patches want to extend it to also copy to network disks. This patch converts over to a virStorageSourcePtr, although it should have no semantic change visible to the user, in anticipation of those future patches being able to use more fields for non-file destinations. * src/conf/domain_conf.h (_virDomainDiskDef): Change type of mirror information. * src/conf/domain_conf.c (virDomainDiskDefParseXML): Localize mirror parsing into new object. (virDomainDiskDefFormat): Adjust clients. * src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse): Likewise. * src/qemu/qemu_driver.c (qemuDomainBlockPivot) (qemuDomainBlockJobImpl, qemuDomainBlockCopy): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
As part of the work on backing chains, I'm finding that it would be easier to directly manipulate chains of pointers (adding a snapshot merely adjusts pointers to form the correct list) rather than copy data from one struct to another. This patch converts domain disk source to be a pointer. In this patch, the pointer is ALWAYS allocated (thanks in part to the previous patch forwarding all disk def allocation through a common point), and all other changse are just mechanical fallout of the new type; there should be no functional change. It is possible that we may want to leave the pointer NULL for a cdrom with no medium in a later patch, but as that requires a closer audit of the source to ensure we don't fault on a null dereference, I didn't do it here. * src/conf/domain_conf.h (_virDomainDiskDef): Change type of src. * src/conf/domain_conf.c: Adjust all clients. * src/security/security_selinux.c: Likewise. * src/qemu/qemu_domain.c: Likewise. * src/qemu/qemu_command.c: Likewise. * src/qemu/qemu_conf.c: Likewise. * src/qemu/qemu_process.c: Likewise. * src/qemu/qemu_migration.c: Likewise. * src/qemu/qemu_driver.c: Likewise. * src/lxc/lxc_driver.c: Likewise. * src/lxc/lxc_controller.c: Likewise. * tests/securityselinuxlabeltest.c: Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
A future patch wants to create disk definitions with non-zero default contents; to avoid crashes, all callers that allocate a disk definition should go through a common point. I found allocation points by looking for any code that increments ndisks, as well as any matches for ALLOC.*disk. Most places that modified ndisks were covered by the parse from XML to domain/device definition by initial domain creation or device hotplug; I also hand-checked all drivers that generate a device struct on the fly during getXMLDesc. * src/conf/domain_conf.h (virDomainDiskDefNew): New prototype. * src/conf/domain_conf.c (virDomainDiskDefNew): New function. (virDomainDiskDefParseXML): Use it. * src/parallels/parallels_driver.c (parallelsAddHddInfo): Likewise. * src/qemu/qemu_command.c (qemuParseCommandLine): Likewise. * src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc): Likewise. * src/vmx/vmx.c (virVMXParseDisk): Likewise. * src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenParseSxpr): Likewise. * src/xenxs/xen_xm.c (xenParseXM): Likewise. * src/libvirt_private.syms (domain_conf.h): Export it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Ján Tomko 提交于
It already reports an error if STRDUP fails.
-
- 03 6月, 2014 2 次提交
-
-
由 Julio Faracco 提交于
In "src/conf/domain_conf.h" there are many enum declarations. The cleanup in this header filer was started, but it wasn't enough and there are many other files that has enum variables declared. So, the commit was starting to be big. This commit finish the cleanup in this header file and in other files that has enum variables, parameters, or functions declared. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Julio Faracco 提交于
In "src/conf/domain_conf.h" there are many enumerations (enum) declarations to be converted as a typedef too. As mentioned before, it's better to use a typedef for variable types, function types and other usages. I think this file has most of those enum declarations at "src/conf/". So, me and Eric Blake plan to keep the cleanups all over the source code. This time, most of the files changed in this commit are related to part of one file: "src/conf/domain_conf.h". Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
-
- 26 5月, 2014 2 次提交
-
-
由 Laine Stump 提交于
commit e31b5cf3 attempted to fix libvirt's VIR_DOMAIN_EVENT_ID_RTC_CHANGE, which is documentated to always provide the new offset of the domain's real time clock from UTC. The problem was that, in the case that qemu is provided with an "-rtc base=x" where x is an absolute time (rather than "utc" or "localtime"), the offset sent by qemu's RTC_CHANGE event is *not* the new offset from UTC, but rather is the sum of all changes to the domain's RTC since it was started with base=x. So, despite what was said in commit e31b5cf3, if we assume that the original value stored in "adjustment" was the offset from UTC at the time the domain was started, we can always determine the current offset from UTC by simply adding the most recent (i.e. current) offset from qemu to that original adjustment. This patch accomplishes that by storing the initial adjustment in the domain's status as "adjustment0". Each time a new RTC_CHANGE event is received from qemu, we simply add adjustment0 to the value sent by qemu, store that as the new adjustment, and forward that value on to any event handler. This patch (*not* e31b5cf3, which should be reverted prior to applying this patch) fixes: https://bugzilla.redhat.com/show_bug.cgi?id=964177 (for the case where basis='utc'. It does not fix basis='localtime')
-
由 Laine Stump 提交于
This reverts commit e31b5cf3. This commit attempted to work around a bug in the offset value reported by qemu's RTC_CHANGE event in the case that a variable base date was given on the qemu commandline. The patch mixed up the math involved in arriving at the corrected offset to report, and in the process added an unnecessary private attribute to the clock element. Since that element is private/internal and not used by anyone else, it makes sense to simplify things by removing it.
-
- 23 5月, 2014 2 次提交
-
-
由 Peter Krempa 提交于
Currently the protocol type with index 0 was NBD which made it hard to distinguish whether the protocol type was actually assigned. Add a new protocol type with index 0 to distinguish it explicitly.
-
由 Peter Krempa 提交于
Skip networked storage but continue iteration through backing chain to iterate through all the local paths in the backing chain.
-