- 25 3月, 2011 4 次提交
-
-
由 Philipp Hahn 提交于
Add missing open curly brace between function declaration of non-linux variant of qemudDomainInterfaceStats() and its body. Signed-off-by: NPhilipp Hahn <hahn@univention.de>
-
由 Wen Congyang 提交于
Hotpluging host usb device by text mode will fail, because the monitor command 'device_add' outputs 'husb: using...' if it succeeds, but we think the command should not output anything. Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
-
由 Eric Blake 提交于
Add the compiler attribute to ensure we don't introduce any more ref bugs like were just patched in commit 9741f346, then explicitly mark the remaining places in code that are safe. * src/qemu/qemu_monitor.h (qemuMonitorUnref): Mark ATTRIBUTE_RETURN_CHECK. * src/conf/domain_conf.h (virDomainObjUnref): Likewise. * src/conf/domain_conf.c (virDomainObjParseXML) (virDomainLoadStatus): Fix offenders. * src/openvz/openvz_conf.c (openvzLoadDomains): Likewise. * src/vmware/vmware_conf.c (vmwareLoadDomains): Likewise. * src/qemu/qemu_domain.c (qemuDomainObjBeginJob) (qemuDomainObjBeginJobWithDriver) (qemuDomainObjExitRemoteWithDriver): Likewise. * src/qemu/qemu_monitor.c (QEMU_MONITOR_CALLBACK): Likewise. Suggested by Daniel P. Berrange.
-
由 Eric Blake 提交于
This simplifies several callers that were repeating checks already guaranteed by util.c, and makes other callers more robust to now reject directories. remote_driver.c was over-strict - access(,R_OK) is only needed to execute a script file; a binary only needs access(,X_OK) (besides, it's unusual to see a file with x but not r permissions, whether script or binary). * cfg.mk (sc_prohibit_access_xok): New syntax-check rule. (exclude_file_name_regexp--sc_prohibit_access_xok): Exempt one use. * src/network/bridge_driver.c (networkStartRadvd): Fix offenders. * src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes) (qemuCapsInitGuest, qemuCapsInit, qemuCapsExtractVersionInfo): Likewise. * src/remote/remote_driver.c (remoteFindDaemonPath): Likewise. * src/uml/uml_driver.c (umlStartVMDaemon): Likewise. * src/util/hooks.c (virHookCheck): Likewise.
-
- 24 3月, 2011 1 次提交
-
-
由 Wen Congyang 提交于
Steps to reproduce this bug: 1. virsh attach-disk domain --source diskimage --target sdb --sourcetype file --driver qemu --subdriver qcow2 error: Failed to attach disk error: operation failed: adding scsi-disk,bus=scsi0.0,scsi-id=1,drive=drive-scsi0-0-1,id=scsi0-0-1 device failed: Property 'scsi-disk.drive' can't find value 'drive-scsi0-0-1' 2. service libvirtd restart Stopping libvirtd daemon: [ OK ] Starting libvirtd daemon: [ OK ] 3. virsh attach-disk domain --source diskimage --target sdb --sourcetype file --driver qemu --subdriver raw error: Failed to attach disk error: operation failed: adding lsi,id=scsi0,bus=pci.0,addr=0x6 device failed: Duplicate ID 'scsi0' for device The reason is that we create a new scsi controller but we do not update /var/run/libvirt/qemu/domain.xml. Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
-
- 23 3月, 2011 2 次提交
-
-
由 Wen Congyang 提交于
Steps to reproduce this bug: # cat usb.xml <hostdev mode='subsystem' type='usb'> <source> <address bus='0x001' device='0x003'/> </source> </hostdev> # virsh attach-device vm1 usb.xml error: Failed to attach device from usb.xml error: server closed connection: The reason of this bug is that we set data.cgroup to NULL, and this will cause libvirtd crashed. Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
-
由 Eric Blake 提交于
A future patch will change reference counting idioms; consolidating this pattern now makes the next patch smaller (touch only the new macro rather than every caller). * src/qemu/qemu_monitor.c (QEMU_MONITOR_CALLBACK): New helper. (qemuMonitorGetDiskSecret, qemuMonitorEmitShutdown) (qemuMonitorEmitReset, qemuMonitorEmitPowerdown) (qemuMonitorEmitStop, qemuMonitorEmitRTCChange) (qemuMonitorEmitWatchdog, qemuMonitorEmitIOError) (qemuMonitorEmitGraphics): Use it to reduce duplication.
-
- 22 3月, 2011 9 次提交
-
-
由 Daniel P. Berrange 提交于
Enhance the QEMU migration monitoring loop, so that it can get a signal to change migration speed on the fly * src/qemu/qemu_domain.h: Add signal for changing speed on the fly * src/qemu/qemu_driver.c: Wire up virDomainMigrateSetSpeed driver * src/qemu/qemu_migration.c: Support signal for changing speed
-
由 Daniel P. Berrange 提交于
It is possible to set a migration speed limit when starting migration. This new API allows the speed limit to be changed on the fly to adjust to changing conditions * src/driver.h, src/libvirt.c, src/libvirt_public.syms, include/libvirt/libvirt.h.in: Add virDomainMigrateSetMaxSpeed * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c, src/openvz/openvz_driver.c, src/phyp/phyp_driver.c, src/qemu/qemu_driver.c, src/remote/remote_driver.c, src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c, src/vmware/vmware_driver.c, src/xen/xen_driver.c, src/libxl/libxl_driver.c: Stub new API
-
由 Hu Tao 提交于
fallback to HMP drive_add/drive_del commands if not found in QMP
-
由 Jiri Denemark 提交于
Avoids calling text monitor methods when it is know they will not succeed and also results in nicer error messages.
-
由 Jiri Denemark 提交于
-
由 Thibault Vincent 提交于
Fix for bug https://bugzilla.redhat.com/show_bug.cgi?id=618970 The "prepare" hook is called very early in the VM statup process before device labeling, so that it can allocate ressources not managed by libvirt, such as DRBD, or for instance create missing bridges and vlan interfaces. * src/util/hooks.c src/util/hooks.h: add definitions for new hooks VIR_HOOK_QEMU_OP_PREPARE and VIR_HOOK_QEMU_OP_RELEASE * src/qemu/qemu_process.c: use them in qemuProcessStart and qemuProcessStop()
-
由 Eric Blake 提交于
With only a single caller to these two monitor commands, I didn't need to wrap a new WithFds version, but just change the command itself. * src/qemu/qemu_monitor.h (qemuMonitorAddNetdev) (qemuMonitorAddHostNetwork): Add parameters. * src/qemu/qemu_monitor.c (qemuMonitorAddNetdev) (qemuMonitorAddHostNetwork): Add support for fd passing. * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Use it to simplify code.
-
由 Eric Blake 提交于
This is also a bug fix - on the error path, qemu_hotplug would leave the configfd file leaked into qemu. At least the next attempt to hotplug a PCI device would reuse the same fdname, and when the qemu getfd monitor command gets a new fd by the same name as an earlier one, it closes the earlier one, so there is no risk of qemu running out of fds. * src/qemu/qemu_monitor.h (qemuMonitorAddDeviceWithFd): New prototype. * src/qemu/qemu_monitor.c (qemuMonitorAddDevice): Move guts... (qemuMonitorAddDeviceWithFd): ...to new function, and add support for fd passing. * src/qemu/qemu_hotplug.c (qemuDomainAttachHostPciDevice): Use it to simplify code. Suggested by Daniel P. Berrange.
-
由 Eric Blake 提交于
qemu_monitor was already returning -1 and setting errno to EINVAL on any attempt to send an fd without a unix socket, but this was a silent failure in the case of qemuDomainAttachHostPciDevice. Meanwhile, qemuDomainAttachNetDevice was doing some sanity checking for a better error message; it's better to consolidate that to a central point in the API. * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Move sanity checking... * src/qemu/qemu_monitor.c (qemuMonitorSendFileHandle): ...into central location. Suggested by Chris Wright.
-
- 19 3月, 2011 1 次提交
-
-
由 Eric Blake 提交于
THREADS.txt states that the contents of vm should not be read or modified while the vm lock is not held, but that the lock must not be held while performing a monitor command. This fixes all the offenders that I could find. * src/qemu/qemu_process.c (qemuProcessStartCPUs) (qemuProcessInitPasswords, qemuProcessStart): Don't modify or refer to vm state outside lock. * src/qemu/qemu_driver.c (qemudDomainHotplugVcpus): Likewise. * src/qemu/qemu_hotplug.c (qemuDomainChangeGraphicsPasswords): Likewise.
-
- 18 3月, 2011 5 次提交
-
-
由 Jiri Denemark 提交于
-
由 Wen Congyang 提交于
Steps to reproduce this bug: # cat test.sh #! /bin/bash -x virsh start domain sleep 5 virsh qemu-monitor-command domain 'cpu_set 2 online' --hmp # while true; do ./test.sh ; done Then libvirtd will crash. The reason is that: we add a reference of obj when we open the monitor. We will reduce this reference when we free the monitor. If the reference of monitor is 0, we will free monitor automatically and the reference of obj is reduced. But in the function qemuDomainObjExitMonitorWithDriver(), we reduce this reference again when the reference of monitor is 0. It will cause the obj be freed in the function qemuDomainObjEndJob(). Then we start the domain again, and libvirtd will crash in the function virDomainObjListSearchName(), because we pass a null pointer(obj->def->name) to strcmp(). Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
-
由 Wen Congyang 提交于
This bug was reported by Shi Jin(jinzishuai@gmail.com): ============= # virsh attach-disk RHEL6RC /var/lib/libvirt/images/test3.img vdb \ --driver file --subdriver qcow2 Disk attached successfully # virsh save RHEL6RC /var/lib/libvirt/images/memory.save Domain RHEL6RC saved to /var/lib/libvirt/images/memory.save # virsh restore /var/lib/libvirt/images/memory.save error: Failed to restore domain from /var/lib/libvirt/images/memory.save error: internal error unsupported driver name 'file' for disk '/var/lib/libvirt/images/test3.img' ============= We check the driver name when we start or restore VM, but we do not check it while attaching a disk. This adds the same check on disk driverName used in qemuBuildCommandLine to qemudDomainAttachDevice. Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
-
由 Wen Congyang 提交于
Steps to reproduce this bug: # virsh qemu-monitor-command domain 'cpu_set 2 online' --hmp The domain has 2 cpus, and we try to set the third cpu online. The qemu crashes, and this command will hang. The reason is that the refs is not 1 when we unwatch the monitor. We lock the monitor, but we do not unlock it. So virCondWait() will be blocked. Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
-
由 Nikunj A. Dadhania 提交于
* Correct the documentation for cgroup: the swap_hard_limit indicates mem+swap_hard_limit. * Change cgroup private apis to: virCgroupGet/SetMemSwapHardLimit Signed-off-by: NNikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
-
- 16 3月, 2011 2 次提交
-
-
由 Eric Blake 提交于
* src/qemu/qemu_monitor.h (qemuMonitorMigrateToFd): New prototype. * src/qemu/qemu_monitor.c (qemuMonitorMigrateToFd): New function.
-
由 Eric Blake 提交于
POSIX states about dd: If the bs=expr operand is specified and no conversions other than sync, noerror, or notrunc are requested, the data returned from each input block shall be written as a separate output block; if the read returns less than a full block and the sync conversion is not specified, the resulting output block shall be the same size as the input block. If the bs=expr operand is not specified, or a conversion other than sync, noerror, or notrunc is requested, the input shall be processed and collected into full-sized output blocks until the end of the input is reached. Since we aren't using conv=sync, there is no zero-padding, but our use of bs= means that a short read results in a short write. If instead we use ibs= and obs=, then short reads are collected and dd only has to do a single write, which can make dd more efficient. * src/qemu/qemu_monitor.c (qemuMonitorMigrateToFile): Avoid 'dd bs=', since it can cause short writes.
-
- 15 3月, 2011 6 次提交
-
-
由 Wen Congyang 提交于
-
由 Eric Blake 提交于
Fixes bug in commit acacced8 * src/qemu/qemu_command.c (qemuBuildCommandLine): s/INVALID_ARG/CONFIG_UNSUPPORTED/. Reported by Daniel P. Berrange.
-
由 Eric Blake 提交于
* src/qemu/qemu_monitor_text.h (qemuMonitorTextMigrate): Declare in place of individual monitor commands. * src/qemu/qemu_monitor_json.h (qemuMonitorJSONMigrate): Likewise. * src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToHost) (qemuMonitorTextMigrateToCommand, qemuMonitorTextMigrateToFile) (qemuMonitorTextMigrateToUnix): Delete. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToHost) (qemuMonitorJSONMigrateToCommand, qemuMonitorJSONMigrateToFile) (qemuMonitorJSONMigrateToUnix): Delete. * src/qemu/qemu_monitor.c (qemuMonitorMigrateToHost) (qemuMonitorMigrateToCommand, qemuMonitorMigrateToFile) (qemuMonitorMigrateToUnix): Consolidate shared code.
-
由 Eric Blake 提交于
Outgoing migration still uses a Unix socket and or exec netcat until the next patch. * src/qemu/qemu_migration.c (qemuMigrationPrepareTunnel): Replace Unix socket with simpler pipe. Suggested by Paolo Bonzini.
-
由 Osier Yang 提交于
As perhaps other hypervisor drivers use different capacity units, do the checking in qemu driver instead of in conf/domain_conf.c.
-
由 Laine Stump 提交于
The newly added call to qemuAuditNetDevice in qemuPhysIfaceConnect was assuming that res_ifname (the name of the macvtap device) was always valid, but this isn't the case. If openMacvtapTap fails, it always returns NULL, which would result in a segv. Since the audit log only needs a record of devices that are actually sent to qemu, and a failure to open the macvtap device means that no device will be sent to qemu, we can solve this problem by only doing the audit if openMacvtapTap is successful (in which case res_ifname is guaranteed valid).
-
- 12 3月, 2011 1 次提交
-
-
由 Eric Blake 提交于
* src/qemu/qemu_command.c (qemuBuildCommandLine): Pass two separate arguments, and fix indentation.
-
- 11 3月, 2011 4 次提交
-
-
由 Gui Jianfeng 提交于
Implement domainSetBlkioParameters and domainGetBlkioParameters for QEmu Signed-off-by: NGui Jianfeng <guijianfeng@cn.fujitsu.com>
-
由 Gui Jianfeng 提交于
Implements virDomainSetBlkioParameters and virDomainGetBlkioParameters and initialization Signed-off-by: NGui Jianfeng <guijianfeng@cn.fujitsu.com>
-
由 Taku Izumi 提交于
This patch implements the code to address the new API in the qemu driver. Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
-
由 Taku Izumi 提交于
This patch introduces a new libvirt API (virDomainSetMemoryFlags) and a flag (virDomainMemoryModFlags). Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
-
- 10 3月, 2011 5 次提交
-
-
由 Eric Blake 提交于
Opening raw network devices with the intent of passing those fds to qemu is worth an audit point. This makes a multi-part audit: first, we audit the device(s) that libvirt opens on behalf of the MAC address of a to-be-created interface (which can independently succeed or fail), then we audit whether qemu actually started the network device with the same MAC (so searching backwards for successful audits with the same MAC will show which fd(s) qemu is actually using). Note that it is possible for the fd to be successfully opened but no attempt made to pass the fd to qemu (for example, because intermediate nwfilter operations failed) - no interface start audit will occur in that case; so the audit for a successful opened fd does not imply rights given to qemu unless there is a followup audit about the attempt to start a new interface. Likewise, when a network device is hot-unplugged, there is only one audit message about the MAC being discontinued; again, searching back to the earlier device open audits will show which fds that qemu quits using (and yes, I checked via /proc/<qemu-pid>/fd that qemu _does_ close out the fds associated with an interface on hot-unplug). The code would require much more refactoring to be able to definitively state which device(s) were discontinued at that point, since we currently don't record anywhere in the XML whether /dev/vhost-net was opened for a given interface. * src/qemu/qemu_audit.h (qemuAuditNetDevice): New prototype. * src/qemu/qemu_audit.c (qemuAuditNetDevice): New function. * src/qemu/qemu_command.h (qemuNetworkIfaceConnect) (qemuPhysIfaceConnect, qemuOpenVhostNet): Adjust prototype. * src/qemu/qemu_command.c (qemuNetworkIfaceConnect) (qemuPhysIfaceConnect, qemuOpenVhostNet): Add audit points and adjust parameters. (qemuBuildCommandLine): Adjust caller. * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
-
由 Eric Blake 提交于
Since libvirt always passes /dev/net/tun to qemu via fd, we should never trigger the cases where qemu tries to directly open the device. Therefore, it is safer to deny the cgroup device ACL. * src/qemu/qemu_cgroup.c (defaultDeviceACL): Remove /dev/net/tun. * src/qemu/qemu.conf (cgroup_device_acl): Reflect this change.
-
由 Eric Blake 提交于
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Honor vhost designations, similar to qemu_command code paths. * src/qemu/qemu_command.h (qemuOpenVhostNet): New prototype. * src/qemu/qemu_command.c (qemuOpenVhostNet): Export.
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-