- 17 9月, 2013 9 次提交
-
-
由 Aline Manera 提交于
The https protocol is also accepted by qemu/KVM when specifying the cdrom ISO image. The xml should be as following: <disk type='network' device='cdrom'> <source protocol='https' name='/url/path'> <host name='host.name' port='443'/> </source> </disk> Signed-off-by: NAline Manera <alinefm@br.ibm.com>
-
由 Peter Krempa 提交于
GCC 4.8.0+ whines about variable "new" being uninitialized since commit 73bfac0e. This is a false positive as the xmlFreeNode(new) statement can be only reached if new was actually allocated successfully. CC conf/libvirt_conf_la-domain_conf.lo conf/domain_conf.c: In function 'virDomainDefSetMetadata': conf/domain_conf.c:18650:24: error: 'new' may be used uninitialized in this function [-Werror=maybe-uninitialized] xmlFreeNode(new); Reported independently by John Ferlan and Michal Privoznik.
-
由 Peter Krempa 提交于
Eric Blake suggested that we could do a little better in case copying of the metadata to be set fails. With this patch, the old metadata is discarded after the new string is copied successfuly.
-
由 Peter Krempa 提交于
The functionality wasn't originally implemented. This patch adds the ability to modify domain's XML metadata using the API.
-
由 Peter Krempa 提交于
The virDomainGetMetadata function was designed to support also retrieval of app specific metadata from the <metadata> element. This functionality was never implemented originally.
-
由 Peter Krempa 提交于
The code to set the metadata in a domain definition is common to live and inactive domains. Factor it out into a common func.
-
由 Peter Krempa 提交于
The function implemented common behavior that can be reused for other hypervisor drivers that use the virDomainObj data structures. Factor out the core into a separate helper func.
-
由 Peter Krempa 提交于
The function implemented common behavior that can be reused for other hypervisor drivers that use the virDomainObj data structures. Factor out the core into a separate helper func.
-
由 Doug Goldstein 提交于
CD-ROMs and Floppies are allowed to have no source to imply they are empty or disconnected. Since the LUN type is used for raw CD-ROM access with QEMU (and VMWare in the future), it also needs to allow an empty source when the raw CD-ROM device is disconnected from the domain.
-
- 11 9月, 2013 1 次提交
-
-
由 Liuji (Jeremy) 提交于
After freeing the bitmap pointer, it must set the pointer to NULL. This will avoid any other use of the freed memory of the bitmap pointer. https://bugzilla.redhat.com/show_bug.cgi?id=1006710Signed-off-by: NLiuji (Jeremy) <jeremy.liu@huawei.com>
-
- 06 9月, 2013 1 次提交
-
-
由 Eric Blake 提交于
'virsh domxml-from-native' and 'virsh qemu-attach' could misbehave for an emulator installed in (a somewhat unlikely) location such as /usr/local/qemu-1.6/qemu-system-x86_64 or (an even less likely) /opt/notxen/qemu-system-x86_64. Limit the strstr seach to just the basename of the file where we are assuming details about the binary based on its name. While testing, I accidentally triggered a core dump during strcmp when I forgot to set os.type on one of my code paths; this patch changes such a coding error to raise a nicer internal error instead. * src/qemu/qemu_command.c (qemuParseCommandLine): Compute basename earlier. * src/conf/domain_conf.c (virDomainDefPostParseInternal): Avoid NULL deref. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 05 9月, 2013 3 次提交
-
-
由 Liuji (Jeremy) 提交于
Delete the USB controller check from the USB Device checklist in virDomainDeviceIsUSB as USB controller is a PCI device rather than a USB one. Signed-off-by: NLiu Ji <jeremy.liu@huawei.com>
-
由 Daniel P. Berrange 提交于
The VIR_FREE() macro will cast away any const-ness. This masked a number of places where we passed a 'const char *' string to VIR_FREE. Fortunately in all of these cases, the variable was not in fact const data, but a heap allocated string. Fix all the variable declarations to reflect this. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Peter Krempa 提交于
In commit 991270db I've used virDomainNetGetActualHostdev() to get the actual hostdev from a network when removing the network from the list to avoid leaving the hostdev in the list. I didn't notice that this function doesn't check if the actual network is allocated and dereferences it. This crashes the daemon when cleaning up a domain object in early startup phases when the actual network definition isn't allocated. When the actual definition isn't present, the hostdev that might correspond to it won't be present anyways so it's safe to return NULL. Thanks to Cole Robinson for noticing this problem.
-
- 04 9月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Commit 50348e6e reused the code to remove the hostdev portion of a network definition on multiple places but forgot to take into account that sometimes the "actual" network is passed and in some cases the parent of that. This patch uses the virDomainNetGetActualHostdev() helper to acquire the correct pointer all the time while removing the hostdev portion from the list.
-
- 03 9月, 2013 3 次提交
-
-
由 Cole Robinson 提交于
Starting with qemu 1.6, the qemu-system-arm vexpress-a9 model has a hardcoded virtio-mmio transport which enables attaching all virtio devices. On the command line, we have to use virtio-XXX-device rather than virtio-XXX-pci, thankfully s390 already set the precedent here so it's fairly straight forward. At the XML level, this adds a new device address type virtio-mmio. The controller and addressing don't have any subelements at the moment because we they aren't needed for this usecase, but could be added later if needed. Add a test case for an ARM guest with one of every virtio device enabled.
-
由 Cole Robinson 提交于
This corresponds to '-sd' and '-drive if=sd' on the qemu command line. Needed for many ARM boards which don't provide any other way to pass in storage.
-
由 Cole Robinson 提交于
This should be a no-op change for now.
-
- 02 9月, 2013 1 次提交
-
-
由 Fred A. Kemp 提交于
Add an attribute named 'removable' to the 'target' element of disks, which controls the removable flag. For instance, on a Linux guest it controls the value of /sys/block/$dev/removable. This option is only valid for USB disks (i.e. bus='usb'), and its default value is 'off', which is the same behaviour as before. To achieve this, 'removable=on' (or 'off') is appended to the '-device usb-storage' parameter sent to qemu when adding a USB disk via '-disk'. A capability flag QEMU_CAPS_USB_STORAGE_REMOVABLE was added to keep track if this option is supported by the qemu version used. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=922495Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 29 8月, 2013 1 次提交
-
-
由 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
-
- 27 8月, 2013 5 次提交
-
-
由 Ján Tomko 提交于
<controller type='pci' index='0' model='pci-root'> <pcihole64 unit='KiB'>1048576</pcihole64> </controller> It can be used to adjust (or disable) the size of the 64-bit PCI hole. The size attribute is in kilobytes (different unit can be specified on input), but it gets rounded up to the nearest GB by QEMU. Disabling it will be needed for guests that crash with the 64-bit PCI hole (like Windows XP), see: https://bugzilla.redhat.com/show_bug.cgi?id=990418
-
由 Ján Tomko 提交于
virDomainParseScaledValue requires it.
-
由 Ján Tomko 提交于
Let virDomainControllerDefParseXML use it without a forward declaration.
-
由 Aline Manera 提交于
The ftp protocol is already recognized by qemu/KVM so add this support to libvirt as well. The xml should be as following: <disk type='network' device='cdrom'> <source protocol='ftp' name='/url/path'> <host name='host.name' port='21'/> </source> </disk> Signed-off-by: NAline Manera <alinefm@br.ibm.com>
-
由 Aline Manera 提交于
QEMU/KVM already allows a HTTP URL for the cdrom ISO image so add this support to libvirt as well. The xml should be as following: <disk type='network' device='cdrom'> <source protocol='http' name='/url/path'> <host name='host.name' port='80'/> </source> </disk> Signed-off-by: NAline Manera <alinefm@br.ibm.com>
-
- 22 8月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Re-arrange the code so that the returned bitmap is always initialized to NULL even on early failures and return an error message as some callers are already expecting it. Fix up the rest not to shadow the error.
-
- 21 8月, 2013 1 次提交
-
-
由 Eric Blake 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=924153 Commit 904e05a2 (v0.9.9) added a per-<disk> seclabel element with an attribute relabel='no' in order to try and minimize the impact of shutdown delays when an NFS server disappears. The idea was that if a disk is on NFS and can't be labeled in the first place, there is no need to attempt the (no-op) relabel on domain shutdown. Unfortunately, the way this was implemented was by modifying the domain XML so that the optimization would survive libvirtd restart, but in a way that is indistinguishable from an explicit user setting. Furthermore, once the setting is turned on, libvirt avoids attempts at labeling, even for operations like snapshot or blockcopy where the chain is being extended or pivoted onto non-NFS, where SELinux labeling is once again possible. As a result, it was impossible to do a blockcopy to pivot from an NFS image file onto a local file. The solution is to separate the semantics of a chain that must not be labeled (which the user can set even on persistent domains) vs. the optimization of not attempting a relabel on cleanup (a live-only annotation), and using only the user's explicit notation rather than the optimization as the decision on whether to skip a label attempt in the first place. When upgrading an older libvirtd to a newer, an NFS volume will still attempt the relabel; but as the avoidance of a relabel was only an optimization, this shouldn't cause any problems. In the ideal future, libvirt will eventually have XML describing EVERY file in the backing chain, with each file having a separate <seclabel> element. At that point, libvirt will be able to track more closely which files need a relabel attempt at shutdown. But until we reach that point, the single <seclabel> for the entire <disk> chain is treated as a hint - when a chain has only one file, then we know it is accurate; but if the chain has more than one file, we have to attempt relabel in spite of the attribute, in case part of the chain is local and SELinux mattered for that portion of the chain. * src/conf/domain_conf.h (_virSecurityDeviceLabelDef): Add new member. * src/conf/domain_conf.c (virSecurityDeviceLabelDefParseXML): Parse it, for live images only. (virSecurityDeviceLabelDefFormat): Output it. (virDomainDiskDefParseXML, virDomainChrSourceDefParseXML) (virDomainDiskSourceDefFormat, virDomainChrDefFormat) (virDomainDiskDefFormat): Pass flags on through. * src/security/security_selinux.c (virSecuritySELinuxRestoreSecurityImageLabelInt): Honor labelskip when possible. (virSecuritySELinuxSetSecurityFileLabel): Set labelskip, not norelabel, if labeling fails. (virSecuritySELinuxSetFileconHelper): Fix indentation. * docs/formatdomain.html.in (seclabel): Document new xml. * docs/schemas/domaincommon.rng (devSeclabel): Allow it in RNG. * tests/qemuxml2argvdata/qemuxml2argv-seclabel-*-labelskip.xml: * tests/qemuxml2argvdata/qemuxml2argv-seclabel-*-labelskip.args: * tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-*-labelskip.xml: New test files. * tests/qemuxml2argvtest.c (mymain): Run the new tests. * tests/qemuxml2xmltest.c (mymain): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 16 8月, 2013 1 次提交
-
-
由 Eric Blake 提交于
* src/util/virnetdevvportprofile.c: Fix typo. * src/conf/domain_conf.c: Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 07 8月, 2013 1 次提交
-
-
由 Guannan Ren 提交于
Add startupPolicy attribute for harddisk with type "file", "block" and "dir". 'requisite' is not supported currently for harddisk.
-
- 06 8月, 2013 2 次提交
-
-
由 Laine Stump 提交于
This PCI controller, named "dmi-to-pci-bridge" in the libvirt config, and implemented with qemu's "i82801b11-bridge" device, connects to a PCI Express slot (e.g. one of the slots provided by the pcie-root controller, aka "pcie.0" on the qemu commandline), and provides 31 *non-hot-pluggable* PCI (*not* PCIe) slots, numbered 1-31. Any time a machine is defined which has a pcie-root controller (i.e. any q35-based machinetype), libvirt will automatically add a dmi-to-pci-bridge controller if one doesn't exist, and also add a pci-bridge controller. The reasoning here is that any useful domain will have either an immediate (startup time) or eventual (subsequent hot-plug) need for a standard PCI slot; since the pcie-root controller only provides PCIe slots, we need to connect a dmi-to-pci-bridge controller to it in order to get a non-hot-plug PCI slot that we can then use to connect a pci-bridge - the slots provided by the pci-bridge will be both standard PCI and hot-pluggable. Since pci-bridge devices themselves can not be hot-plugged into a running system (although you can hot-plug other devices into a pci-bridge's slots), any new pci-bridge controller that is added can (and will) be plugged into the dmi-to-pci-bridge as long as it has empty slots available. This patch is also changing the qemuxml2xml-pcie test from a "DO_TEST" to a "DO_DIFFERENT_TEST". This is so that the "before" xml can omit the automatically added dmi-to-pci-bridge and pci-bridge devices, and the "after" xml can include it - this way we are testing if libvirt is properly adding these devices.
-
由 Laine Stump 提交于
This controller is implicit on q35 machinetypes. It provides 31 PCIe (*not* PCI) slots as controller 0. Currently there are no devices that can connect to pcie-root, and no implicit pci controller on a q35 machine, so q35 is still unusable. For a usable q35 system, we need to add a "dmi-to-pci-bridge" pci controller, which can connect to pcie-root, and provides standard pci slots that can be used to connect other devices.
-
- 04 8月, 2013 1 次提交
-
-
由 Laine Stump 提交于
The parser shouldn't be doing arch-specific things like adding in implicit controllers to the config. This should instead be done in the hypervisor's post-parse callback. This patch removes the auto-add of a usb controller from the domain parser, and puts it into the qemu driver's post-parse callback (just as is already done with the auto-add of the pci-root controller). In the future, any machine/arch that shouldn't have a default usb controller added should just set addDefaultUSB = false in this function. We've recently seen that q35 and ARMV7L domains shouldn't get a default USB controller, so I've set addDefaultUSB to false for both of those.
-
- 31 7月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
-
- 30 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
The VIR_DOMAIN_SHUTDOWN_CRASHED state constant does not appear to be used in the QEMU code anyway. It also doesn't make much (any) sense, since the 'shutdown' state is a transient state between 'running' and 'shutoff' and when a guest crashes, it does not end up in a 'shutdown' state, only 'shutoff'. It was added in commit 14e7e0ae which post-dates v1.1.0, so is safe to remove before 1.1.1 Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 27 7月, 2013 1 次提交
-
-
由 Eric Blake 提交于
Otherwise, with new enough gcc compiling at -O2, the build fails with: ../../src/conf/domain_conf.c: In function ‘virDomainDeviceDefPostParse’: ../../src/conf/domain_conf.c:2821:29: error: ‘cnt’ may be used uninitialized in this function [-Werror=maybe-uninitialized] for (i = 0; i < *cnt; i++) { ^ ../../src/conf/domain_conf.c:2795:20: note: ‘cnt’ was declared here size_t i, *cnt; ^ ../../src/conf/domain_conf.c:2794:30: error: ‘arrPtr’ may be used uninitialized in this function [-Werror=maybe-uninitialized] virDomainChrDefPtr **arrPtr; ^ * src/conf/domain_conf.c (virDomainChrGetDomainPtrs): Always assign into output parameters. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 26 7月, 2013 1 次提交
-
-
由 Alex Jia 提交于
Signed-off-by: NAlex Jia <ajia@redhat.com>
-
- 23 7月, 2013 4 次提交
-
-
由 Osier Yang 提交于
virDomainDiskDefForeachPath is not only used by the security setting helpers, also used by cgroup setting helpers, so this is to ignore the volume type disk with mode="direct" for cgroup setting.
-
由 John Ferlan 提交于
The difference with already supported pool types (dir, fs, block) is: there are two modes for iscsi pool (or network pools in future), one can specify it either to use the volume target path (the path showed up on host) with mode='host', or to use the remote URI qemu supports (e.g. file=iscsi://example.org:6000/iqn.1992-01.com.example/1) with mode='direct'. For 'host' mode, it copies the volume target path into disk->src. For 'direct' mode, the corresponding info in the *one* pool source host def is copied to disk->hosts[0].
-
由 John Ferlan 提交于
Introduce a new helper to check if the disk source is of block type
-
由 John Ferlan 提交于
There are two ways to use a iSCSI LUN as disk source for qemu. * The LUN's path as it shows up on host, e.g. /dev/disk/by-path/ip-$ip:3260-iscsi-$iqn-fc18:iscsi.iscsi0-lun-1 * The libiscsi URI from the storage pool source element host attribute, e.g. iscsi://demo.org:6000/iqn.1992-01.com.example/1 For a "volume" type disk, if the specified "pool" is of iscsi type, we should support to use the LUN in either of above 2 ways. That's why to introduce a new XML tag "mode" for the disk source (libvirt should support iscsi pool with libiscsi, but it's another new feature, which should be done later). The "mode" can be either of "host" or "direct". Use "host" to indicate use of the LUN with the path as it shows up on host. Use "direct" to indicate to use it with the source pool host URI (future patches may support to use network type libvirt storage too, e.g. Ceph)
-