- 09 1月, 2012 2 次提交
-
-
由 Laine Stump 提交于
In the past, generic SCSI commands issued from a guest to a virtio disk were always passed through to the underlying disk by qemu, and the kernel would also pass them on. As a result of CVE-2011-4127 (see: http://seclists.org/oss-sec/2011/q4/536), qemu now honors its scsi=on|off device option for virtio-blk-pci (which enables/disables passthrough of generic SCSI commands), and the kernel will only allow the commands for physical devices (not for partitions or logical volumes). The default behavior of qemu is still to allow sending generic SCSI commands to physical disks that are presented to a guest as virtio-blk-pci devices, but libvirt prefers to disable those commands in the standard virtio block devices, enabling it only when specifically requested (hopefully indicating that the requester understands what they're asking for). For this purpose, a new libvirt disk device type (device='lun') has been created. device='lun' is identical to the default device='disk', except that: 1) It is only allowed if bus='virtio', type='block', and the qemu version is "new enough" to support it ("new enough" == qemu 0.11 or better), otherwise the domain will fail to start and a CONFIG_UNSUPPORTED error will be logged). 2) The option "scsi=on" will be added to the -device arg to allow SG_IO commands (if device !='lun', "scsi=off" will be added to the -device arg so that SG_IO commands are specifically forbidden). Guests which continue to use disk device='disk' (the default) will no longer be able to use SG_IO commands on the disk; those that have their disk device changed to device='lun' will still be able to use SG_IO commands. *docs/formatdomain.html.in - document the new device attribute value. *docs/schemas/domaincommon.rng - allow it in the RNG *tests/* - update the args of several existing tests to add scsi=off, and add one new test that will test scsi=on. *src/conf/domain_conf.c - update domain XML parser and formatter *src/qemu/qemu_(command|driver|hotplug).c - treat VIR_DOMAIN_DISK_DEVICE_LUN *almost* identically to VIR_DOMAIN_DISK_DEVICE_DISK, except as indicated above. Note that no support for this new device value was added to any hypervisor drivers other than qemu, because it's unclear what it might mean (if anything) to those drivers.
-
由 Laine Stump 提交于
This patch adds two capabilities flags to deal with various aspects of supporting SG_IO commands on virtio-blk-pci devices: QEMU_CAPS_VIRTIO_BLK_SCSI set if -device virtio-blk-pci accepts the scsi="on|off" option When present, this is on by default, but can be set to off to disable SG_IO functions. QEMU_CAPS_VIRTIO_BLK_SG_IO set if SG_IO commands are supported in the virtio-blk-pci driver (present since qemu 0.11 according to a qemu developer, if I understood correctly)
-
- 08 1月, 2012 1 次提交
-
-
由 Laine Stump 提交于
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=638633 Although scripts are not used by interfaces of type other than "ethernet" in qemu, due to the fact that the parser stores the script name in a union that is only valid when type is ethernet or bridge, there is no way for anyone except the parser itself to catch the problem of specifying an interface script for an inappropriate interface type (by the time the parsed data gets back to the code that called the parser, all evidence that a script was specified is forgotten). Since the parser itself should be agnostic to which type of interface allows scripts (an example of why: a script specified for an interface of type bridge is valid for xen domains, but not for qemu domains), the solution here is to move the script out of the union(s) in the DomainNetDef, always populate it when specified (regardless of interface type), and let the driver decide whether or not it is appropriate. Currently the qemu, xen, libxml, and uml drivers recognize the script parameter and do something with it (the uml driver only to report that it isn't supported). Those drivers have been updated to log a CONFIG_UNSUPPORTED error when a script is specified for an interface type that's inappropriate for that particular hypervisor. (NB: There was earlier discussion of solving this problem by adding a VALIDATE flag to all libvirt APIs that accept XML, which would cause the XML to be validated against the RNG files. One statement during that discussion was that the RNG shouldn't contain hypervisor-specific things, though, and a proper solution to this problem would require that (again, because a script for an interface of type "bridge" is accepted by xen, but not by qemu).
-
- 07 1月, 2012 3 次提交
-
-
由 Eric Blake 提交于
Commit ae523427 missed one pair of functions that could use the helper routine. * src/qemu/qemu_driver.c (qemuSetSchedulerParametersFlags) (qemuGetSchedulerParametersFlags): Simplify.
-
由 Eric Blake 提交于
On rawhide, gcc is new enough to output new DWARF information that pdwtags has not yet learned, but the resulting 'make check' output was rather confusing: $ make -C src check ... GEN virkeepaliveprotocol-structs die__process_function: DW_TAG_INVALID (0x4109) @ <0x58c> not handled! WARNING: your pdwtags program is too old WARNING: skipping the virkeepaliveprotocol-structs test WARNING: install dwarves-1.3 or newer ... $ pdwtags --version v1.9 I've filed the pdwtags deficiency as https://bugzilla.redhat.com/show_bug.cgi?id=772358 * src/Makefile.am (PDWTAGS): Don't leave -t file behind on version mismatch. Soften warning message, since 1.9 is newer than 1.3. Don't leak stderr from broken version.
-
由 Eric Blake 提交于
Commit db371a21 mistakenly added new functions inside a #ifndef WIN32 guard, even though they are needed on all platforms. * src/util/command.c (virCommandFDSet): Move outside WIN32 conditional.
-
- 06 1月, 2012 3 次提交
-
-
由 Alex Jia 提交于
Detected by valgrind. Leak introduced in commit 5745dc12. * src/qemu/qemu_command.c: fix memory leak on failure and successful path. * How to reproduce? % valgrind -v --leak-check=full ./qemuargv2xmltest * Actual result: ==2196== 80 bytes in 1 blocks are definitely lost in loss record 3 of 4 ==2196== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==2196== by 0x39CF07F6E1: strdup (in /lib64/libc-2.12.so) ==2196== by 0x419823: qemuParseRBDString (qemu_command.c:1657) ==2196== by 0x4221ED: qemuParseCommandLine (qemu_command.c:5934) ==2196== by 0x422AFB: qemuParseCommandLineString (qemu_command.c:7561) ==2196== by 0x416864: testCompareXMLToArgvHelper (qemuargv2xmltest.c:48) ==2196== by 0x417DB1: virtTestRun (testutils.c:141) ==2196== by 0x415CAF: mymain (qemuargv2xmltest.c:175) ==2196== by 0x4174A7: virtTestMain (testutils.c:696) ==2196== by 0x39CF01ECDC: (below main) (in /lib64/libc-2.12.so) ==2196== ==2196== LEAK SUMMARY: ==2196== definitely lost: 80 bytes in 1 blocks Signed-off-by: NAlex Jia <ajia@redhat.com>
-
由 Hu Tao 提交于
When setting numa nodeset for a domain which has no nodeset set before, libvirtd crashes by dereferencing the pointer to the old nodemask which is null in that case.
-
由 Eric Blake 提交于
Commit baade4d fixed a memory leak on failure, but in the process, introduced a use-after-free on success, which can be triggered with: 1. set bandwidth with --live 2. query bandwidth 3. set bandwidth with --live * src/qemu/qemu_driver.c (qemuDomainSetInterfaceParameters): Don't free newBandwidth on success. Reported by Hu Tao.
-
- 05 1月, 2012 4 次提交
-
-
由 Eric Blake 提交于
Commit b4343293 has a logic bug: seclabel overrides don't set def->type, but the default value is 0 (aka static). Restarting libvirtd would thus reject the XML for any domain with an override of <seclabel relabel='no'/> (which happens quite easily if a disk image lives on NFS), with a message: 2012-01-04 22:29:40.949+0000: 6769: error : virSecurityLabelDefParseXMLHelper:2593 : XML error: security label is missing Fix the logic to never read from an override's def->type, and to allow a missing <label> subelement when relabel is no. There's a lot of stupid double-negatives in the code (!norelabel) because of the way that we want the zero-initialized defaults to behave. * src/conf/domain_conf.c (virSecurityLabelDefParseXMLHelper): Use type field from correct location.
-
由 Michal Privoznik 提交于
Currently, virCommand implementation uses FD_ macros from sys/select.h. However, those cannot handle more opened files than FD_SETSIZE. Therefore switch to generalized implementation based on array of integers.
-
由 Jim Fehlig 提交于
xen-unstable c/s 23874:651aed73b39c added another member to xen_domctl_getdomaininfo struct and bumped domctl version to 8. Add a corresponding domctl v8 struct in xen hypervisor sub-driver and detect domctl v8 during initialization.
-
由 Jim Fehlig 提交于
The console path in xenstore is /local/domain/<id>/console/tty for PV guests (PV console) and /local/domain/<id>/serial/0/tty (serial console) for HVM guests. Similar to Xen's in-tree console client, read the correct path for PV vs HVM.
-
- 04 1月, 2012 3 次提交
-
-
由 Michal Privoznik 提交于
It is a good practise to set revents to zero before doing any poll(). Moreover, we should check if event we waited for really occurred or if any of fds we were polling on didn't encountered hangup.
-
由 Jiri Denemark 提交于
As a result of it, guest NUMA topology would be lost during migration.
-
- 03 1月, 2012 3 次提交
-
-
由 Eric Blake 提交于
Typo has existed since API introduction in commit ee0d8c3b. * src/qemu/qemu_driver.c (qemuDomainBlockStatsFlags): Use correct name.
-
由 Eric Blake 提交于
Most severe here is a latent (but currently untriggered) memory leak if any hypervisor ever adds a string interface property; the remainder are mainly cosmetic. * include/libvirt/libvirt.h.in (VIR_DOMAIN_BANDWIDTH_*): Move macros closer to interface that uses them, and document type. * src/libvirt.c (virDomainSetInterfaceParameters) (virDomainGetInterfaceParameters): Formatting tweaks. * daemon/remote.c (remoteDispatchDomainGetInterfaceParameters): Avoid memory leak. * src/libvirt_public.syms (LIBVIRT_0.9.9): Sort lines. * src/libvirt_private.syms (domain_conf.h): Likewise. * src/qemu/qemu_driver.c (qemuDomainSetInterfaceParameters): Fix comments, break long lines.
-
由 Peter Krempa 提交于
-
- 02 1月, 2012 1 次提交
-
-
由 Michal Novotny 提交于
Hi, this is the fifth version of my SRV record for DNSMasq patch rebased for the current codebase to the bridge driver and libvirt XML file to include support for the SRV records in the DNS. The syntax is based on DNSMasq man page and tests for both xml2xml and xml2argv were added as well. There are some things written a better way in comparison with version 4, mainly there's no hack in tests/networkxml2argvtest.c and also the xPath context is changed to use a simpler query using the virXPathInt() function relative to the current node. Also, the patch is also fixing the networkxml2argv test to pass both checks, i.e. both unit tests and also syntax check. Please review, Michal Signed-off-by: NMichal Novotny <minovotn@redhat.com>
-
- 01 1月, 2012 2 次提交
-
-
由 Alex Jia 提交于
Detected by Coverity. Leaks introduced in commit e8d6b293. Signed-off-by: NAlex Jia <ajia@redhat.com>
-
由 Eric Blake 提交于
Leak detected by Coverity, and introduced in commit 93ab5859. Reported by Alex Jia. * src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Free devices array on error.
-
- 30 12月, 2011 5 次提交
-
-
由 Daniel Veillard 提交于
The blocks to extract node information on a per-arch basis wasn't well balanced leading to a compilation failure if not on one of the handled arches (PCs and PPCs)
-
由 Eric Blake 提交于
This wires up the XML changes in the previous patch to let SELinux labeling honor user overrides, as well as affecting the live XML configuration in one case where the user didn't specify anything in the offline XML. I noticed that the logs contained messages like this: 2011-12-05 23:32:40.382+0000: 26569: warning : SELinuxRestoreSecurityFileLabel:533 : cannot lookup default selinux label for /nfs/libvirt/images/dom.img for all my domain images living on NFS. But if we would just remember that on domain creation that we were unable to set a SELinux label (due to NFSv3 lacking labels, or NFSv4 not being configured to expose attributes), then we could avoid wasting the time trying to clear the label on domain shutdown. This in turn is one less point of NFS failure, especially since there have been documented cases of virDomainDestroy hanging during an attempted operation on a failed NFS connection. * src/security/security_selinux.c (SELinuxSetFilecon): Move guts... (SELinuxSetFileconHelper): ...to new function. (SELinuxSetFileconOptional): New function. (SELinuxSetSecurityFileLabel): Honor override label, and remember if labeling failed. (SELinuxRestoreSecurityImageLabelInt): Skip relabeling based on override.
-
由 Eric Blake 提交于
Implement the parsing and formatting of the XML addition of the previous commit. The new XML doesn't affect qemu command line, so we can now test round-trip XML->memory->XML handling. I chose to reuse the existing structure, even though per-device override doesn't use all of those fields, rather than create a new structure, in order to reuse more code. * src/conf/domain_conf.h (_virDomainDiskDef): Add seclabel member. * src/conf/domain_conf.c (virDomainDiskDefFree): Free it. (virSecurityLabelDefFree): New function. (virDomainDiskDefFormat): Print it. (virSecurityLabelDefFormat): Reduce output if model not present. (virDomainDiskDefParseXML): Alter signature, and parse seclabel. (virSecurityLabelDefParseXML): Split... (virSecurityLabelDefParseXMLHelper): ...into new helper. (virDomainDeviceDefParse, virDomainDefParseXML): Update callers. * tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args: New file. * tests/qemuxml2xmltest.c (mymain): Enhance test. * tests/qemuxml2argvtest.c (mymain): Likewise.
-
由 Eric Blake 提交于
Pure code motion; no semantic change. * src/conf/domain_conf.h (virDomainSeclabelType) (virSecurityLabelDefPtr): Declare earlier. * src/conf/domain_conf.c (virSecurityLabelDefClear) (virSecurityLabelDefParseXML): Move earlier. (virDomainDefParseXML): Move seclabel parsing earlier.
-
由 Eric Blake 提交于
A future patch will parse and output <seclabel> in more than one location in a <domain> xml; make it easier to reuse code. * src/conf/domain_conf.c (virSecurityLabelDefFree): Rename... (virSecurityLabelDefClear): ...and make static. (virSecurityLabelDefParseXML): Alter signature. (virDomainDefParseXML, virDomainDefFree): Adjust callers. (virDomainDefFormatInternal): Split output... (virSecurityLabelDefFormat): ...into new helper.
-
- 29 12月, 2011 5 次提交
-
-
由 Hu Tao 提交于
* src/qemu/qemu_driver.c: implement the qemu driver support
-
由 Hu Tao 提交于
Add a util function virDomainNetFind to find a domain's net def.
-
由 Hu Tao 提交于
* daemon/remote.c: implement the server side support * src/remote/remote_driver.c: implement the client side support * src/remote/remote_protocol.x: definitions for the new entry points * src/remote_protocol-structs: structure definitions
-
由 Hu Tao 提交于
* src/libvirt.c: implement the main entry points
-
由 Hu Tao 提交于
The APIs are used to set/get domain's network interface's parameters. Currently supported parameters are bandwidth settings. * include/libvirt/libvirt.h.in: new API and parameters definition * python/generator.py: skip the Python API generation * src/driver.h: add new entry to the driver structure * src/libvirt_public.syms: export symbols
-
- 28 12月, 2011 1 次提交
-
-
由 Eric Blake 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=770520 We had two nested loops both trying to use 'i' as the iteration variable, which can result in an infinite loop when the inner loop interferes with the outer loop. Introduced in commit 93ab5859. * src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Don't reuse iteration variable across two loops.
-
- 25 12月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
In order to avoid situation where a USB device is in use by two domains, we must keep a list of already attached devices like we do for PCI.
-
- 23 12月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
This patch adds max_files option to qemu.conf which can be used to override system default limit on number of opened files that are allowed for qemu user.
-
- 22 12月, 2011 1 次提交
-
-
由 Osier Yang 提交于
Upstream QEMU starts to support it from commit 2c74c2cb.
-
- 21 12月, 2011 4 次提交
-
-
由 Stefan Berger 提交于
Remove the requirement that DHCP messages have to be broadcasted. DHCP requests are most often sent via broadcast but can be directed towards a specific DHCP server. For example 'dhclient' takes '-s <server>' as a command line parameter thus allowing DHCP requests to be sent to a specific DHCP server.
-
由 Osier Yang 提交于
-
由 Michael Ellerman 提交于
Add logic to assign addresses for devices with spapr-vio addresses. We also do validation of addresses specified by the user, ie. ensuring that there are not duplicate addresses on the bus. Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
-
由 Michael Ellerman 提交于
For QEMU PPC64 we have a machine type ("pseries") which has a virtual bus called "spapr-vio". We need to be able to create devices on this bus, and as such need a way to specify the address for those devices. This patch adds a new address type "spapr-vio", which achieves this. The addressing is specified with a "reg" property in the address definition. The reg is optional, if it is not specified QEMU will auto-assign an address for the device. Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
-