- 29 10月, 2011 3 次提交
-
-
由 Roopa Prabhu 提交于
- changed some return 1's to return -1 - changed if (rc) error checks to if (rc < 0) - fixed some other minor convention violations I might have missed some. Can fix in another patch or can respin Signed-off-by: NRoopa Prabhu <roprabhu@cisco.com> Reported-by: NEric Blake <eblake@redhat.com> Reported-by: NLaine Stump <laine@laine.org> Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Xu He Jie 提交于
When using the xml as below: ------------------------------------------------------ <devices> <emulator>/home/soulxu/data/work-code/qemu-kvm/x86_64-softmmu/qemu-system-x86_64</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/home/soulxu/data/VM/images/linux.img'/> <target dev='vda' bus='virtio'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <video> <model type='cirrus' vram='9216' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </memballoon> </devices> ------------------------------------------------------ Then can't startup qemu, the error message as below: virsh # start test-vm error: Failed to start domain test-vm error: internal error process exited while connecting to monitor: qemu-system-x86_64: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-balloon-pci, in use by virtio-blk-pci qemu-system-x86_64: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: Device 'virtio-balloon-pci' could not be initialized So adding check for bus type and address type. Only the address of pci type support by virtio bus. Signed-off-by: NXu He Jie <xuhj@linux.vnet.ibm.com>
-
由 Alex Jia 提交于
Leak introduced in commit c1bc3d89. Detected by valgrind: ==18462== 1,100 bytes in 1 blocks are definitely lost in loss record 183 of 184 ==18462== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==18462== by 0x4A06167: realloc (vg_replace_malloc.c:525) ==18462== by 0x4AADBB: virReallocN (memory.c:161) ==18462== by 0x4A975E: virBufferGrow (buf.c:117) ==18462== by 0x4A9D92: virBufferVasprintf (buf.c:290) ==18462== by 0x4A9EF7: virBufferAsprintf (buf.c:263) ==18462== by 0x429488: qemuBuildControllerDevStr (qemu_command.c:1993) ==18462== by 0x42C4B6: qemuBuildCommandLine (qemu_command.c:3803) ==18462== by 0x41A604: testCompareXMLToArgvHelper (qemuxml2argvtest.c:124) ==18462== by 0x41BB81: virtTestRun (testutils.c:141) ==18462== by 0x416DFF: mymain (qemuxml2argvtest.c:369) ==18462== by 0x41B277: virtTestMain (testutils.c:696) ==18462== ==18462== LEAK SUMMARY: ==18462== definitely lost: 1,100 bytes in 1 blocks ==18462== indirectly lost: 0 bytes in 0 blocks * src/qemu/qemu_command.c (qemuBuildCommandLine): Clean up on success. Signed-off-by: NAlex Jia <ajia@redhat.com>
-
- 28 10月, 2011 4 次提交
-
-
由 Eric Blake 提交于
Detected by Coverity. The fix in 2c27dfae didn't catch all bad instances of memcpy(). Thankfully, on further analysis, all of the problematic uses are only triggered by old qemu that lacks -device. * src/qemu/qemu_hotplug.c (qemuDomainAttachPciDiskDevice) (qemuDomainAttachNetDevice, qemuDomainAttachHostPciDevice): Init all fields since monitor only populates some of them.
-
由 Daniel P. Berrange 提交于
The QEMU monitor command 'add_client' can be used to connect to a VNC or SPICE graphics display. This allows for implementation of the virDomainOpenGraphics API * src/qemu/qemu_driver.c: Implement virDomainOpenGraphics * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h, src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add binding for 'add_client' command
-
由 Daniel P. Berrange 提交于
Not all VNC/SPICE servers use a TCP socket for their connections. It is possible to configure a UNIX socket server. The graphics event must thus include a UNIX socket address type. * include/libvirt/libvirt.h.in: Add UNIX socket address type for graphics event * src/qemu/qemu_monitor_json.c: Add 'unix' string to address type enum
-
由 Jiri Denemark 提交于
-
- 27 10月, 2011 2 次提交
-
-
由 Daniel P. Berrange 提交于
This change adds some systemtap/dtrace probes to the QEMU monitor client code. In particular it allows watching of all operations for a VM * examples/systemtap/qemu-monitor.stp: Watch all monitor commands * src/Makefile.am: Passing libdir/bindir/sbindir to dtrace2systemtap.pl * src/dtrace2systemtap.pl: Accept libdir/bindir/sbindir as args and look for '# binary:' comment to mark probes against libvirtd vs libvirt.so * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Add probes for key functions
-
由 Eric Blake 提交于
Rather than making all clients of monitor commands that are JSON-only check whether yajl support was compiled in, it is simpler to just avoid setting the capability bit up front if we can't use the capability. * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Only set capability bit if we also have yajl library to use it. * src/qemu/qemu_driver.c (qemuDomainReboot): Drop #ifdefs. * src/qemu/qemu_process.c (qemuProcessStart): Likewise. * tests/qemuhelptest.c (testHelpStrParsing): Pass test even without yajl. * tests/qemuxml2argvtest.c (mymain): Simplify use of json flag. * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-*.args: Update expected results to match.
-
- 25 10月, 2011 4 次提交
-
-
由 Michal Privoznik 提交于
If a disk source gets dropped because it is not accessible, mgmt application might want to be informed about this. Therefore we need to emit an event. The event presented in this patch is however a bit superset of what written above. The reason is simple: an intention to be easily expanded, e.g. on 'user ejected disk in guest' events. Therefore, callback gets source string and disk alias (which should be unique among a domain) and reason (an integer);
-
由 Michal Privoznik 提交于
This patch implements on_missing feature in qemu driver. Upon qemu startup process an accessibility of CDROMs and floppy disks is checked. The source might get dropped if unavailable and on_missing is set accordingly. No event is emit thought. Look for follow up patch.
-
由 Michal Privoznik 提交于
This patch is rather cosmetic as it only moves device alias assignation from command line construction just before that. However, it is needed in connotation of previous and next patch.
-
由 Eric Blake 提交于
Detected by Coverity. Both text and JSON monitors set only the bus and unit fields, which means driveAddr.controller spends life as garbage on the stack, and is then memcpy()'d into the in-memory representation which the user can see via dumpxml. * src/qemu/qemu_hotplug.c (qemuDomainAttachSCSIDisk): Only copy defined fields.
-
- 21 10月, 2011 3 次提交
-
-
由 Eric Blake 提交于
The improvements to virBuffer, along with a paradigm shift to pass the original buffer through rather than creating a second buffer, allow us to shave off quite a few lines of code. * src/util/sysinfo.h (virSysinfoFormat): Alter signature. * src/util/sysinfo.c (virSysinfoFormat, virSysinfoBIOSFormat) (virSysinfoSystemFormat, virSysinfoProcessorFormat) (virSysinfoMemoryFormat): Change indentation parameter. * src/conf/domain_conf.c (virDomainSysinfoDefFormat): Adjust caller. * src/qemu/qemu_driver.c (qemuGetSysinfo): Likewise.
-
由 Eric Blake 提交于
<domainsnapshot> is the first public instance of <domain> being used as a sub-element, although we have two other private uses (runtime state, and migration cookie). Although indentation has no effect on XML parsing, using it makes the output more consistent. This uses virBuffer auto-indentation to obtain the effect, for all but the portions of <domain> that are not generated a line at a time into the same virBuffer. Further patches will clean up the remaining problems. * src/conf/domain_conf.h (virDomainDefFormatInternal): New prototype. * src/conf/domain_conf.c (virDomainDefFormatInternal): Export. (virDomainObjFormat, virDomainSnapshotDefFormat): Update callers. * src/libvirt_private.syms (domain_conf.h): Add new export. * src/qemu/qemu_migration.c (qemuMigrationCookieXMLFormat): Use new function. (qemuMigrationCookieXMLFormatStr): Update caller.
-
由 tangchen 提交于
There is a little difference between the output of domxml-to-native and the actual commandline. No matter qemu is in control or readline mode, domxml-to-native always converts it to readline mode. That is because the parameter "monitor_json" for qemuBuildCommandLine() is always set to false in qemuDomainXMLToNative(). Signed-off-by: Ntangchen <tangchen@cn.fujitsu.com>
-
- 19 10月, 2011 3 次提交
-
-
由 Philipp Hahn 提交于
The XML parser for the qemu specific extensions expects the qemu name-space to be bound to the 'qemu' prefix. This is too strict, since the name of the name-space-prefix is only meant as an internal lookup key. Only the associated URI is relevant. <domain>... <qemu:commandline xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> ...</qemu:commandline> </domain> <domain xmlns:ns0="http://libvirt.org/schemas/domain/qemu/1.0">... <ns0:commandline> ...</ns0:commandline> </domain> <domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> <qemu:commandline xmlns:qemu="urn:foo"> ...</qemu:commandline> </domain> Remove the test for checking the name-space binding on the top-level <domain> element. Registering the name-space with XPath is enough. Signed-off-by: NPhilipp Hahn <hahn@univention.de>
-
由 Guido Günther 提交于
-
由 Eric Blake 提交于
Noticed when testing new libvirt against old qemu that lacked the snapshot_blkdev HMP command. Libvirt was mistakenly treating the command as successful, and re-writing the domain XML to use the just-created 0-byte file, rendering the domain broken on restart. * src/qemu/qemu_monitor_text.c (qemuMonitorTextDiskSnapshot): Notice another possible error message. * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateSingleDiskActive): Don't keep 0-byte file on failure.
-
- 18 10月, 2011 2 次提交
-
-
由 Osier Yang 提交于
Waiting for qemu-kvm cleaning up the PCI bar(s) mapping with long time while the device is not managed is just waste of time.
-
由 Jim Fehlig 提交于
Tested with multiple AHCI controllers and multiple disks attached to a controller. E.g., <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test/disk0.raw'/> <target dev='sda' bus='sata'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test/disk1.raw'/> <target dev='sdb' bus='sata'/> <address type='drive' controller='0' bus='0' unit='1'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/test/disk2.raw'/> <target dev='sdc' bus='sata'/> <address type='drive' controller='1' bus='0' unit='0'/> </disk> <controller type='sata' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </controller> <controller type='sata' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </controller>
-
- 17 10月, 2011 1 次提交
-
-
由 Jiri Denemark 提交于
The patch that fixes SIGTERM handling with -no-shutdown was taken into 0.15.1 stable release of qemu.
-
- 15 10月, 2011 3 次提交
-
-
由 Osier Yang 提交于
BZ# https://bugzilla.redhat.com/show_bug.cgi?id=736214 The problem is caused by the original info of domain's PCI dev is maintained by qemu_driver->activePciHostdevs list, (E.g. dev->reprobe, which stands for whether need to reprobe driver for the dev when do reattachment). The fields (dev->reprobe, dev->unbind_from_stub, and dev->remove_slot) are initialized properly when preparing the PCI device for managed attachment. However, when do reattachment, it construct a complete new "pciDevice" without honoring the original dev info, and thus the dev won't get the original driver or can get other problem. This patch is to fix the problem by get the devs from list driver->activePciHostdevs. Tested with following 3 scenarios: * the PCI was bound to some driver not pci-stub before attaching result: the device will be bound to the original driver * the PCI was bound to pci-stub before attaching result: no driver reprobing, and still bound to pci-stub * The PCI was not bound to any driver result: no driver reprobing, and still not bound to any driver.
-
由 Jiri Denemark 提交于
Explicitly disallow conflicts between domain name from dxml and dname.
-
由 Osier Yang 提交于
When failing on starting a domain, it tries to reattach all the PCI devices defined in the domain conf, regardless of whether the devices are still used by other domain. This will cause the devices to be deleted from the list qemu_driver->activePciHostdevs, thus the devices will be thought as usable even if it's not true. And following commands nodedev-{reattach,reset} will be successful. How to reproduce: 1) Define two domains with same PCI device defined in the confs. 2) # virsh start domain1 3) # virsh start domain2 4) # virsh nodedev-reattach $pci_device You will see the device will be reattached to host successfully. As pciDeviceReattach just check if the device is still used by other domain via checking if the device is in list driver->activePciHostdevs, however, the device is deleted from the list by step 2). This patch is to prohibit the bug by: 1) Prohibit a domain starting or device attachment right at preparation period (qemuPrepareHostdevPCIDevices) if the device is in list driver->activePciHostdevs, which means it's used by other domain. 2) Introduces a new field for struct _pciDevice, (const char *used_by), it will be set as the domain name at preparation period, (qemuPrepareHostdevPCIDevices). Thus we can prohibit deleting the device from driver->activePciHostdevs if it's still used by other domain when stopping the domain process. * src/pci.h (define two internal functions, pciDeviceSetUsedBy and pciDevceGetUsedBy) * src/pci.c (new field "const char *used_by" for struct _pciDevice, implementations for the two new functions) * src/libvirt_private.syms (Add the two new internal functions) * src/qemu_hostdev.h (Modify the definition of functions qemuPrepareHostdevPCIDevices, and qemuDomainReAttachHostdevDevices) * src/qemu_hostdev.c (Prohibit preparation and don't delete the device from activePciHostdevs list if it's still used by other domain) * src/qemu_hotplug.c (Update function usage, as the definitions are changed) Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 14 10月, 2011 6 次提交
-
-
由 Eric Blake 提交于
Detected by Coverity. Leak introduced in commit 72de0d28. * src/qemu/qemu_migration.c (qemuMigrationCookieGraphicsXMLParse): Clean up on success.
-
由 Jiri Denemark 提交于
Otherwise we can end up with a dangling job that can only be cleared by restarting libvirtd.
-
由 Jiri Denemark 提交于
Log debug messages anytime we call *BeginJob* or *EndJob* so that it's easier to spot incorrect usage of domain job APIs.
-
由 Eric Blake 提交于
Detected by Coverity. p (the pointer to the string) is always true; when in reality, we wanted to know whether the integer value of the just-parsed string is '0' or '1'. Logic bug since commit b1b5b51a. * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBlockInfo): Set results to proper value.
-
由 Eric Blake 提交于
Detected by Coverity. If, for some reason, our text monitor input does not match our assumptions, we end up incrementing p while it is NULL, then dereferencing the pointer 0x1, which will fault. * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBlockStatsParamsNumber): Rewrite to avoid deref of strchr failure. Fix indentation.
-
由 Eric Blake 提交于
Detected by Coverity. Introduced in commit b1b5b51a. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockInfo): Avoid null dereference.
-
- 13 10月, 2011 4 次提交
-
-
由 Michal Privoznik 提交于
As this is needed. Although some functions check for domain being active before obtaining job, we need to check it after, because obtaining job unlocks domain object, during which a state of domain can be changed.
-
由 Michal Privoznik 提交于
This patch extends qemudDomainCoreDump so it supports new VIR_DUMP_RESET flag. If this flag is set, domain is reset on successful dump. However, this is needed to be done after we start CPUs.
-
由 Eric Blake 提交于
With the recent refactoring of qemu snapshot relationships, it is now trivial to filter on leaves. * src/conf/domain_conf.c (virDomainSnapshotObjListCount) (virDomainSnapshotObjListCopyNames): Handle new flag. * src/qemu/qemu_driver.c (qemuDomainSnapshotListNames) (qemuDomainSnapshotNum, qemuDomainSnapshotListChildrenNames) (qemuDomainSnapshotNumChildren): Pass new flag through.
-
由 Harsh Prateek Bora 提交于
VirtFS allows the user to choose between path/handle based fs driver. As of now, libvirt hardcoded path based driver only. This patch provides a solution to allow user to choose between path/handle based fs driver. Sample: <filesystem type='mount'> <driver type='handle'/> <source dir='/folder/to/share1'/> <target dir='mount_tag1'/> </filesystem> <filesystem type='mount'> <driver type='path'/> <source dir='/folder/to/share2'/> <target dir='mount_tag2'/> </filesystem> Signed-off-by: NHarsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 12 10月, 2011 3 次提交
-
-
由 Eric Blake 提交于
The previous optimizations lead to some follow-on cleanups. * src/conf/domain_conf.c (virDomainSnapshotForEachChild) (virDomainSnapshotForEachDescendant): Drop dead parameter. (virDomainSnapshotActOnDescendant) (virDomainSnapshotObjListNumFrom) (virDomainSnapshotObjListGetNamesFrom): Update callers. * src/qemu/qemu_driver.c (qemuDomainSnapshotNumChildren) (qemuDomainSnapshotListChildrenNames, qemuDomainSnapshotDelete): Likewise. * src/conf/domain_conf.h: Update prototypes.
-
由 Eric Blake 提交于
Maintain the parent/child relationships of all qemu snapshots. * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Populate relationships after loading. (qemuDomainSnapshotCreateXML): Set relations on creation; tweak redefinition to reuse existing object. (qemuDomainSnapshotReparentChildren, qemuDomainSnapshotDelete): Clear relations on delete.
-
由 Eric Blake 提交于
To date, JSON disk snapshots worked by accident, as they were always using hmp fallback due to a typo in commit e702b5ba not picking up on the (intentional) difference in command names between the two monitor protocols. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot): Spell QMP command correctly. Reported by Luiz Capitulino.
-
- 11 10月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Not too hard to wire up. The trickiest part is realizing that listing children of a snapshot cannot use SNAPSHOT_LIST_ROOTS, and that we overloaded that bit to also mean SNAPSHOT_LIST_DESCENDANTS; we use that bit to decide which iteration to use, but don't want the existing counting/listing functions to see that bit. * src/conf/domain_conf.h (virDomainSnapshotObjListNumFrom) (virDomainSnapshotObjListGetNamesFrom): New prototypes. * src/conf/domain_conf.c (virDomainSnapshotObjListNumFrom) (virDomainSnapshotObjListGetNamesFrom): New functions. * src/libvirt_private.syms (domain_conf.h): Export them. * src/qemu/qemu_driver.c (qemuDomainSnapshotNumChildren) (qemuDomainSnapshotListChildrenNames): New functions.
-
- 09 10月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
If parsing qemu command line fails (e.g. because of non-existing process number supplied), we jump to cleanup label where we free pidfile. Therefore it needs to be initialized. Otherwise we free random pointer.
-