- 10 2月, 2017 2 次提交
-
-
由 Jim Fehlig 提交于
When a user does not explicitly set a <driver> in the disk config, libvirt defers selection of a default to libxl. This approach works fine when starting a domain with such configuration or attaching a disk to a running domain. But when detaching such a disk, libxl will fail with "unrecognized disk backend type: 0". libxl makes no attempt to recalculate a default backend (driver) on detach and simply fails when uninitialized. This patch updates the libvirt disk config with the backend selected by libxl when starting a domain or attaching a disk to a running domain. Another benefit of this approach is that the live XML is also updated with the backend driver selected by libxl.
-
由 Jim Fehlig 提交于
When starting a domian, a libxl_domain_config object is created from virDomainDef. Any virDomainDiskDef devices with a format of VIR_STORAGE_FILE_NONE are mapped to LIBXL_DISK_FORMAT_RAW in the corresponding libxl_disk_device, but the virDomainDiskDef format is never updated to reflect the change. A better place to set a default format for disk devices is the device post-parse callback, ensuring the virDomainDiskDef object reflects the default format.
-
- 03 2月, 2017 1 次提交
-
-
由 Jim Fehlig 提交于
xen.git commit 57f8b13c changed several of the libxl memory get/set functions to take 64 bit parameters. The libvirt libxl driver still uses uint32_t variables for these various parameters, which is particularly problematic for the libxl_set_memory_target() function. When dom0 autoballooning is enabled, libvirt (like xl) determines the memory needed to start a domain and the memory available. If memory available is less than memory needed, dom0 is ballooned down by passing a negative value to libxl_set_memory_target() 'target_memkb' parameter. Prior to xen.git commit 57f8b13c, 'target_memkb' was an int32_t. Subtracting a larger uint32 from a smaller uint32 and assigning it to int32 resulted in a negative number. After commit 57f8b13c, the same subtraction is widened to a int64, resulting in a large positive number. The simple fix taken by this patch is to assign the difference of the uint32 values to a temporary int32 variable, which is then passed to 'target_memkb' parameter of libxl_set_memory_target(). Note that it is undesirable to change libvirt to use 64 bit variables since it requires setting LIBXL_API_VERSION to 0x040800. Currently libvirt supports LIBXL_API_VERSION >= 0x040400, essentially Xen >= 4.4.
-
- 13 1月, 2017 1 次提交
-
-
由 Jim Fehlig 提交于
For HVM domains, pae is only set in libxl_domain_build_info when explicitly specified in the hypervisor <features> config. This is fine for i686 machines, but is incorrect behavior for x86_64 machines where pae must always be enabled. See the following discussion for additional details https://www.redhat.com/archives/libvir-list/2017-January/msg00254.html
-
- 11 1月, 2017 1 次提交
-
-
由 Cédric Bosdonnat 提交于
libxl doesn't provide a way to write one log for each domain. Thus we need to demux the messages. If our logger doesn't know to which domain to attribute a message, then it will write it to the default log file. Starting with Xen 4.9 (commit f9858025 and following), libxl will write the domain ID in an easy to grab manner. The logger introduced by this commit will use it to demux the libxl log messages. Thanks to the default log file, this logger will also work with older versions of Xen.
-
- 22 10月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Change the virDomainChrDef to use a pointer to 'source' and allocate that pointer during virDomainChrDefNew. This has tremendous "fallout" in the rest of the code which mainly has to change source.$field to source->$field. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 20 10月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Modeled after the qemuDomainHostdevPrivatePtr (commit id '27726d8c'), create a privateData pointer in the _virDomainChardevDef to allow storage of private data for a hypervisor in order to at least temporarily store secret data for usage during qemuBuildCommandLine. NB: Since the qemu_parse_command (qemuParseCommandLine) code is not expecting to restore the secret data, there's no need to add code code to handle this new structure there. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 14 10月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
This function for some weird reason returns integer instead of virDomainNetType type. It is important to return the correct type so that we know what values we can expect. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 28 9月, 2016 1 次提交
-
-
由 Joao Martins 提交于
And allow libxl to handle channel element which creates a Xen console visible to the guest as a low-bandwitdh communication channel. If type is PTY we also fetch the tty after boot using libxl_channel_getinfo to fetch the tty path. On socket case, we autogenerate a path if not specified in the XML. Path autogenerated is slightly different from qemu driver: qemu stores also on "channels/target" but it creates then a directory per domain with each channel target name. libxl doesn't appear to have a clear definition of private files associated with each domain, so for simplicity we do it slightly different. On qemu each autogenerated channel goes like: channels/target/<domain-name>/<target name> Whereas for libxl: channels/target/<domain-name>-<target name> Should note that if path is not specified it won't persist, existing only on live XML, unless user had initially specified it. Since support for libxl channels only came on Xen >= 4.5 we therefore need to conditionally compile it with LIBXL_HAVE_DEVICE_CHANNEL. After this patch and having a qemu guest agent: $ cat domain.xml | grep -a1 channel | head -n 5 | tail -n 4 <channel type='unix'> <source mode='bind' path='/tmp/channel'/> <target type='xen' name='org.qemu.guest_agent.0'/> </channel> $ virsh create domain.xml $ echo '{"execute":"guest-network-get-interfaces"}' | socat stdio,ignoreeof unix-connect:/tmp/channel {"execute":"guest-network-get-interfaces"} {"return": [{"name": "lo", "ip-addresses": [{"ip-address-type": "ipv4", "ip-address": "127.0.0.1", "prefix": 8}, {"ip-address-type": "ipv6", "ip-address": "::1", "prefix": 128}], "hardware-address": "00:00:00:00:00:00"}, {"name": "eth0", "ip-addresses": [{"ip-address-type": "ipv4", "ip-address": "10.100.0.6", "prefix": 24}, {"ip-address-type": "ipv6", "ip-address": "fe80::216:3eff:fe40:88eb", "prefix": 64}], "hardware-address": "00:16:3e:40:88:eb"}, {"name": "sit0"}]} Signed-off-by: NJoao Martins <joao.m.martins@oracle.com> Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
- 27 9月, 2016 1 次提交
-
-
由 Jim Fehlig 提交于
libxl events are delivered to libvirt via the libxlDomainEventHandler callback registered with libxl. Documenation in $xensrc/tools/libxl/libxl_event.h states that the callback "may occur on any thread in which the application calls libxl". This can result in deadlock since many of the libvirt callees of libxl hold a lock on the virDomainObj they are working on. When the callback is invoked, it attempts to find a virDomainObj corresponding to the domain ID provided by libxl. Searching the domain obj list results in locking each obj before checking if it is active, and its ID equals the requested ID. Deadlock is possible when attempting to lock an obj that is already locked further up the call stack. Indeed, Max Ustermann reported an instance of this deadlock https://www.redhat.com/archives/libvir-list/2015-November/msg00130.html Guido Rossmueller also recently stumbled across it https://www.redhat.com/archives/libvir-list/2016-September/msg00287.html Fix the deadlock by moving the lookup of virDomainObj to the libxlDomainShutdownThread. After this patch, libxl events are enqueued on the libvirt side and processed by dedicated thread, avoiding the described deadlock. Reported-by: NMax Ustermann <ustermann78@web.de> Reported-by: NGuido Rossmueller <Guido.Rossmueller@gdata.de>
-
- 26 9月, 2016 4 次提交
-
-
由 Michal Privoznik 提交于
Just like virDomainDefPostParseCallback has gained new parseOpaque argument, we need to follow the logic with virDomainDeviceDefPostParse. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
We want to pass the proper opaque pointer instead of NULL to virDomainDefParseString. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
We want to pass the proper opaque pointer instead of NULL to virDomainDefParse and subsequently virDomainDefParseNode too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
Some callers might want to pass yet another pointer to opaque data to post parse callbacks. The driver generic one is not enough because two threads executing post parse callback might want to see different data (e.g. domain object pointer that domain def belongs to). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 09 9月, 2016 1 次提交
-
-
由 Jiri Denemark 提交于
The code for replacing domain's transient definition with the persistent one is repeated in several places and we'll need to add one more. Let's make a nice helper for it. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 03 9月, 2016 1 次提交
-
-
由 Bob Liu 提交于
Add support for multi serial devices, after this patch virsh can be used to connect different serial devices of running domains. E.g. vish # console <xxx> --devname serial<xxx> Note: This depends on a xen/libxl bug fix to have libxl_console_get_tty(...) correctly returning the tty path (as opposed to always returning the first one). [0] https://lists.xen.org/archives/html/xen-devel/2016-08/msg00438.htmlSigned-off-by: NBob Liu <bob.liu@oracle.com>
-
- 02 8月, 2016 3 次提交
-
-
由 John Ferlan 提交于
Commit id '7d3b2eb5' missed a closing parenthesis on the ignore_value macro, causing the failure
-
由 Cédric Bosdonnat 提交于
Introduce libxl hook and use it for start, prepare, started, stop, stopped, migrate events.
-
由 Cédric Bosdonnat 提交于
The migrate hook will affect the migrated guest definition. Allow these domains be marked as tainted in the libxl driver.
-
- 11 7月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
-
- 27 6月, 2016 1 次提交
-
-
由 Laine Stump 提交于
All the same information was already there, just in slightly different places in the virDomainNetDef.
-
- 23 6月, 2016 1 次提交
-
-
由 Jim Fehlig 提交于
When domXML contains only <console type='pty'> and no corresponding <serial>, the console is "stolen" [1] and used as the first <serial> device. When this "stolen" console is accessed from the libxl driver (in libxlConsoleCallback and libxlDomainOpenConsole), check if the targetType is VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL, and use the "stolen" device in def->serials[0] instead. Prior to this change, creating a domain with input XML containing only a <console> device and subsequently attempting to access its console with 'virsh console' would fail error: internal error: character device <null> is not using a PTY [1] See comments associated with virDomainDefAddConsoleCompat() in $LIBVIRT-SRC/src/conf/domain_conf.c:
-
- 15 6月, 2016 1 次提交
-
-
由 Chunyan Liu 提交于
Support creating guest with USB host device in config file. Currently libxl only supports xen PV guest, and only supports specifying USB host device by 'bus number' and 'device number', for example: <hostdev mode='subsystem' type='usb' managed='no'> <source> <address bus='1' device='3'/> </source> </hostdev> Signed-off-by: NChunyan Liu <cyliu@suse.com> Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
- 14 6月, 2016 1 次提交
-
-
由 Jim Fehlig 提交于
Move capabilities code out of libxl_conf.{ch} and into new libxl_capabilities.{ch} files. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
- 13 6月, 2016 1 次提交
-
-
由 Wang Yufei 提交于
In libxl driver we do virObjectRef in libxlDomainObjBeginJob, If virCondWaitUntil failed, it goes to error, do virObjectUnref, There's a chance that someone undefine the vm at the same time, and refs unref to zero, vm is freed in libxlDomainObjBeginJob. But the vm outside function is not Null, we do virObjectUnlock(vm). That's how we overwrite the vm memory after it's freed. I fix it. Signed-off-by: NWang Yufei <james.wangyufei@huawei.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 07 6月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Until now we weren't able to add checks that would reject configuration once accepted by the parser. This patch adds a new callback and infrastructure to add such checks. In this patch all the places where rejecting a now-invalid configuration wouldn't be a good idea are marked with a new parser flag.
-
- 06 6月, 2016 1 次提交
-
-
由 Ján Tomko 提交于
Remove the live attribute and mark the definition as transient whether the domain is runing or not. There were only two callers left calling with live=false: * testDomainStartState, where the domain already is active because we assigned vm->def->id just a few lines above the call * virDomainObjGetPersistentDef, which now only calls virDomainObjSetDefTransient for an active domain
-
- 25 5月, 2016 1 次提交
-
-
由 Jim Fehlig 提交于
Xen only supports network-based disks with the qemu (aka qdisk) driver. Set the driverName to 'qemu' in libxlDomainDeviceDefPostParse() if not already set. When starting a domain with network-based disks, ensure the driverName is 'qemu'. Resolves: https://bugzilla.opensuse.org/show_bug.cgi?id=981094
-
- 20 5月, 2016 1 次提交
-
-
由 Jovanka Gulicoska 提交于
Convert to virGetLastErrorMessage() in the rest of the code
-
- 11 5月, 2016 2 次提交
-
-
由 Jim Fehlig 提交于
Xen 4.6 introduced a new migration stream commonly referred to as "migration V2". Xen 4.6 and newer always produce this new stream, whereas Xen 4.5 and older always produce the legacy stream. Support for migration stream V2 can be detected at build time with LIBXL_HAVE_SRM_V2 from libxl.h. The legacy and V2 streams are not compatible, but a V2 host can accept and convert a legacy stream. Commit e7440656 changed the libxl driver to use the lowest libxl API version possible (version 0x040200) to ensure the driver builds against older Xen releases. The old 4.2 restore API does not support specifying a stream version and assumes a legacy stream, even if the incoming stream is migration V2. Thinking it has been given a legacy stream, libxl will fail to convert an incoming stream that is already V2, which causes the entire restore operation to fail. Xen's libvirt-related OSSTest has been failing since commit e7440656 landed in libvirt.git master. One of the more recent failures can be seen here http://lists.xenproject.org/archives/html/xen-devel/2016-05/msg00071.html This patch changes the call to libxl_domain_create_restore() to include the stream version if LIBXL_HAVE_SRM_V2 is defined. The version field of the libxlSavefileHeader struct is also updated to '2' when LIBXL_HAVE_SRM_V2 is defined, ensuring the stream version in the header matches the actual stream version produced by Xen. Along with bumping the libxl API requirement to 0x040400, this patch fixes save/restore on a migration V2 Xen host. Oddly, migration has never used the libxlSavefileHeader. It handles passing configuration in the Begin and Prepare phases, and then calls libxl directly to transfer domain state/memory in the Perform phase. A subsequent patch will add stream version handling in the Begin and Prepare phase handshaking, which will fix the migration related OSSTest failures. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
In LIBXL_API_VERSION 0x040400, the libxl_domain_create_restore API gained a parameter for specifying restore parameters. Switch to using version 0x040400, which will be useful in a subsequent commit to specify the Xen migration stream version when restoring. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
- 16 4月, 2016 1 次提交
-
-
由 Jim Fehlig 提交于
To ensure the libvirt libxl driver will build with future versions of Xen where the libxl API may change in incompatible ways, explicitly use LIBXL_API_VERSION 0x040200. The libxl driver does use new libxl APIs that have been added since Xen 4.2, but currently it does not make use of any changes made to existing APIs such as libxl_domain_create_restore or libxl_set_vcpuaffinity. The version can be bumped if/when the libxl driver consumes the changed APIs. Further details can be found in the following discussion thread https://www.redhat.com/archives/libvir-list/2016-April/msg00178.htmlSigned-off-by: NJim Fehlig <jfehlig@suse.com>
-
- 14 4月, 2016 1 次提交
-
-
由 Chunyan Liu 提交于
Add codes to support creating domain with network defition of assigning SRIOV VF from a pool. Signed-off-by: NChunyan Liu <cyliu@suse.com> Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
- 08 4月, 2016 1 次提交
-
-
由 Wei Liu 提交于
In the latest libxenlight code, libxl_domain_create_restore accepts a new argument. Update libvirt's libxl driver for that. Use the macro provided by libxenlight to detect which version should be used. The new parameter (send_back_fd) is set to -1 because libvirt provides no such fd. Signed-off-by: NWei Liu <wei.liu2@citrix.com> Message-id: 1459866012-27081-1-git-send-email-wei.liu2@citrix.com
-
- 30 3月, 2016 3 次提交
-
-
由 Jim Fehlig 提交于
Remove disabling domain death events from libxlDomainStart error path. The domain death event is already disabled in libxlDomainCleanup. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Chunyan Liu 提交于
libxlDomainStart allocates and reserves resources that were not being released in error paths. libxlDomainCleanup already handles the job of releasing resources, and libxlDomainStart should call it when encountering a failure. Change the error handling logic to call libxlDomainCleanup on failure. This includes acquiring the lease sooner and allowing it to be released in libxlDomainCleanup on failure, similar to the way other resources are reclaimed. With the lease now released in libxlDomainCleanup, the release_dom label can be renamed to cleanup_dom to better reflect its changed semantics. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
Rename cleanup_dom label to destroy_dom, which better describes what it does. Signed-off-by: NJim Fehlig <jfehlig@suse.com>
-
- 09 3月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Introduce a helper to check supported device and domain config and move the memory hotplug checks to it. The advantage of this approach is that by default all new features are considered unsupported by all hypervisors unless specifically changed rather than the previous approach where every hypervisor would need to declare that a given feature is unsupported.
-
- 25 2月, 2016 1 次提交
-
-
由 Joao Martins 提交于
Introduce support for domainInterfaceStats API call for querying network interface statistics. Consequently it also enables the use of `virsh domifstat <dom> <interface name>` command plus seeing the interfaces names instead of "-" when doing `virsh domiflist <dom>`. After successful guest creation we fill the network interfaces names based on domain, device id and append suffix if it's emulated in the following form: vif<domid>.<devid>[-emu]. We extract the network interfaces info from the libxl_domain_config object in libxlDomainCreateIfaceNames() to generate ifname. On domain cleanup we also clear ifname, in case it was set by libvirt (i.e. being prefixed with "vif"). We also skip these two steps in case the name of the interface was manually inserted by the administrator. Since the introduction of netprefix (commit a040ba9e), ifnames with a registered prefix will be freed on virDomain{Obj,Def}Format*, thus eliminating the migration issues observed with the reverted commit d2e5538b whereas source and destination would have the same ifname. For getting the interface statistics we resort to virNetInterfaceStats and let libvirt handle the platform specific nits. Note that the latter is not yet supported in FreeBSD. Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
-
- 24 2月, 2016 1 次提交
-
-
由 Chunyan Liu 提交于
Signed-off-by: NChunyan Liu <cyliu@suse.com>
-