[libvirt] Re: [virt-tools-list] Guests and Server Reboots
by Cole Robinson
On 11/20/2009 08:16 AM, Thomas Baker wrote:
cc-ing libvirt-list, since that's where this functionality would live.
>
> I'm running virt-manager 0.7 on Fedora 11 and I recently converted a parallels win2003 server over to run there. I've been running Xen paravirt guests under CentOS 5 and when I reboot that server, the guests are paused, the reboot occurs, and then the guests are unpaused.
>
> My question is what happens under F11 on a server reboot? It appears that the guests are just shut off instead of being paused? Is there a way to pause them before a reboot automatically?
>
This behavior has been requested before:
https://bugzilla.redhat.com/show_bug.cgi?id=444273
No patches yet though.
- Cole
15 years
[libvirt] Release of libvirt-0.7.4
by Daniel Veillard
Nearly as expected, but the 0.7.3 release had a missing file and some
broken dependancies, so I rolled out a new release immediately.
Available as usual at
ftp://libvirt.org/libvirt/
The rate of changes doesn't seems to slow down, though this release is
more about incremental improvements, bug fixes and cleanups than major
new features:
Features:
- Implement a node device backend using libudev (David Allan)
- New APIs for checking some object properties (Daniel P. Berrange)
- Fully asynchronous monitor I/O processing (Daniel P. Berrange)
- add MAC address based port filtering to qemu (Gerhard Stenzel)
- Support for IPv6 / multiple addresses per interfaces (Laine Stump)
Documentation:
- Document overriding domain interface target (Cole Robinson)
- 514532 Fix man page, most operation are synchronous (Daniel Veillard)
- Fix typo in error message (Matthew Booth)
- esx: Add documentation to the website (Matthias Bolte)
- AppArmor updates of examples (Jamie Strandboge)
- Add documentation for <channel> domain element (Matthew Booth)
- Separate character device doc guest and host parts (Matthew Booth)
- Add a Python example that lists active ESX domains (Matthias Bolte)
- LXC fix wrong or out-of-date function descriptions (Ryota Ozaki)
- docs: <clock> property is 'offset', not 'sync' (Cole Robinson)
- Update the documentation for virDomainMigrateToURI (Chris Lalancette)
- fix virDomainMigrateToURI doc (Dan Kenigsberg)
Bug fixes:
- 504262 Check for duplicated UUID in XM Xen defines (Daniel Veillard)
- 512069 fix domain XML schemas for backward compatibility (Daniel Veillard)
- qemu-kvm needs -enable-kvm flag for VT optimization (Steve Yarmie)
- fix deprecated iptables command syntax (Steve Yarmie)
- Ensure driver lock is released when entering QEMU monitor (Daniel P. Berrange)
- only remove masquerade roles for VIR_NETWORK_FORWARD_NAT (Guido Günther)
- esx: Fix CPU clock Hz to MHz conversion (Matthias Bolte)
- esx: Fix memory leak in esxVI_HostCpuIdInfo_Free() (Matthias Bolte)
- esx: Fix MAC address formatting (Matthias Bolte)
- Fix compilation of libvirt against xen-unstable (Jim Fehlig)
- Fix probing for libpciaccess (Daniel P. Berrange)
- Fix incorrect reference counting logic in qemu monitor open (Daniel P. Berrange)
- Don't return fatal error in HAL driver init if HAL isn't running (Daniel P. Berrange)
- Fix cleanup when state driver init fails (Daniel P. Berrange)
- AppArmor handling of accesses to readonly files (Jamie Strandboge)
- AppArmor require absolute paths (Jamie Strandboge)
- Check that domain is running when starting console (Daniel P. Berrange)
- Fix incorrect variable passed to LXC event callback (Daniel P. Berrange)
- Fix race condition in HAL driver startup (Daniel P. Berrange)
- Remove capng_lock() call when spawning LXC container init process (Daniel P. Berrange)
- Fix initscript to check daemon pidfile (Daniel P. Berrange)
- Filter out stale domains from xenstore listing (Daniel P. Berrange)
- Fix logic in xenUnifiedNumOfDomains to match xenUnifiedListDomains (Jonas Eriksson)
- Disable IPv6 socket auto-binding to IPv4 socket (Daniel P. Berrange)
- Fix save and restore with non-privileged guests and SELinux (Daniel P. Berrange)
- Prevent initializing ebtables if disabled in qemu.conf (Ryota Ozaki)
- phyp: too much timeout when polling socket (Eduardo Otubo)
- phyp: ssh authentication with public key fixed (Eduardo Otubo)
- opennebula: Fix potential memory/mutex leak in state driver startup (Matthias Bolte)
- phyp: Break potential infinite loops (Matthias Bolte)
- phyp: Fix memory/session leaks and potential invalid frees (Matthias Bolte)
- storage: conf: Fix memory leak in encryption parsing (Cole Robinson)
- Fix improper error return in virInterfaceDefParseProtoIPvX (Laine Stump)
- Fix virInterfaceIpDefPtr leak during virInterfaceIpDefFree (Laine Stump)
- give up python interpreter lock before calling cb (Dan Kenigsberg)
- ESX: Fix memory leak in list handling functions. (Matthias Bolte)
- Fix --with-init-script configure option (Matthew Booth)
- Don't let parent of daemon exit until basic initialization is done (Daniel P. Berrange)
- Fix configure detection of device mapper (Pritesh Kothari)
- Remote code caught EINTR making it ininterruptable (Daniel Veillard)
- virterror: Add a missing 'break' for VIR_ERR_INVALID_SECRET (Cole Robinson)
- Fix p2p migration without a passed uri. (Cole Robinson)
- Fix problems in the Xen inotify driver. (Matthias Bolte)
- Remove a completely bogus reference increment in the Xen driver. (Chris Lalancette)
- 528575 avoid libvirtd crash on LCX domain autostart (Daniel Veillard)
- Fix SELinux linking issues (Jim Fehlig)
- node device: Fix locking issue in virNodeDeviceDestroy (Cole Robinson)
- LXC fix virCgroupGetValueStr problem with \n (Ryota Ozaki)
- Avoid crash in virBufferEscapeString (Laine Stump)
- LXC complement PATH environment variable (Ryota Ozaki)
Improvements:
- Enable udev instead of hal on F12 / RHEL-6 or later (Daniel P. Berrange)
- python: Actually implement list*Interfaces bindings (Cole Robinson)
- esx: Handle 'vmxnet3' in esxVMX_FormatEthernet() (Matthias Bolte)
- Fix check for existance of cgroups at creation (Daniel P. Berrange)
- Fix virt-aa-helper when host and os.type arch differ (Jamie Strandboge)
- Add translation of PCI vendor and product IDs (David Allan)
- Add scsi_target device type (David Allan)
- Add several fields to node device capabilities (David Allan)
- Add virConnectGetLibvirtVersion API (Cole Robinson)
- Implement finer grained migration control for Xen (Maximilian Wilhelm)
- Support for SATA Disks in virDomainDiskBus (pritesh)
- LXC implement missing DomainInterfaceStats API (Ryota Ozaki)
- disable mac_filter config switch by default (Gerhard Stenzel)
- phyp: Reorder keyboard_interactive label in openSSHSession() (Eduardo Otubo)
- Implmentation of new APIs to checking state/persistence of objects (Daniel P. Berrange)
- Allow timeouts waiting for QEMU job lock (Daniel P. Berrange)
- Release driver and domain lock when running monitor commands (Daniel P. Berrange)
- Add reference counting on virDomainObjPtr objects (Daniel P. Berrange)
- Locking of the qemuMonitorPtr object (Daniel P. Berrange)
- Wrap text mode monitor APIs, pass qemuMonitorPtr directly to APIs (Daniel P. Berrange)
- Move encryption lookup back into qemu driver file (Daniel P. Berrange)
- Make use of private data structure for monitor state (Daniel P. Berrange)
- Add a new timed condition variable wait API (Daniel P. Berrange)
- Fix errno handling for pthreads wrappers (Daniel P. Berrange)
- 524280 pass max lease option to dnsmasq (Daniel Veillard)
- Store the range size when adding a DHCP range (Daniel Veillard)
- qemu: Allow cpu pinning for all logical CPUs, not just physical (Cole Robinson)
- qemu: Use same create/define overwrite logic for migration prepare. (Cole Robinson)
- qemu: Break out function to check if we can create/define/restore (Cole Robinson)
- Add sentinel attribute for NULL terminated arg lists (Paolo Bonzini)
- test: Update inactive guest config on shutdown (Cole Robinson)
- test: Add testDomainShutdownState helper (Cole Robinson)
- Properly convert port numbers to/from network byte order (Matthew Booth)
- phyp add create() and destroy() support (Eduardo Otubo)
- Support for <channel> in domain and QEmu backend (Matthew Booth)
- Detect availability of QEMU -chardev CLI option (Matthew Booth)
- Allow character devices to have different target types (Matthew Booth)
- LXC allow container to have ethN interfaces (Ryota Ozaki)
- New ebtables module wrapper (Gerhard Stenzel)
- test: Implement virDomainPinVcpu (Cole Robinson)
- test: Implement virDomainGetVcpus (Cole Robinson)
- test: Update vcpu runtime info in SetVcpus (Cole Robinson)
- test: Use privateData to track running VM vcpu state (Cole Robinson)
- test: Break out wrapper for setting up started domain state. (Cole Robinson)
- test: Fixes for SetVcpus (Cole Robinson)
- Make monitor type (miimon/arpmon) optional in bond xml (Laine Stump)
- Support reporting live interface IP/netmask (Laine Stump)
- Make startmode optional in toplevel interface definition (Laine Stump)
- Move libvirtd event loop into background thread (Daniel P. Berrange)
- Allow NULL mac address in virGetInterface (Laine Stump)
- ESX: Don't automatically follow redirects. (Matthias Bolte)
- ESX: Change disk selection for datastore detection. (Matthias Bolte)
- ESX: Fallback to the preliminary name if the datastore cannot be found. (Matthias Bolte)
- Set KMEMSIZE for OpenVZ domains being defined (Yuji NISHIDA)
- Allow for a driver specific private data blob in virDomainObjPtr (Daniel P. Berrange)
- More network utility functions (Matthew Booth)
- Add symbols from new network.h module (Daniel Veillard)
- Set of new network related utilities (Daniel Veillard)
- Convert virDomainObjListPtr to use a hash of domain objects (Daniel P. Berrange)
- qemu: migrate: Don't require manual URI to specify a port (Cole Robinson)
- test: Support virStorageFindPoolSources (Cole Robinson)
- storage: Add ParseSourceString function for use with FindPoolSources. (Cole Robinson)
- Add support for an external TFTP boot server (Paolo Bonzini)
- test: Support virNodeDeviceCreate and virNodeDeviceDestroy (Cole Robinson)
- Consolidate virXPathNodeSet() (Daniel Veillard)
- Support QEMU watchdog device. (Richard Jones)
- Do not log rotate very small logs (Dan Kenigsberg)
- LXC implement missing macaddr assignment feature (Ryota Ozaki)
- tests: Initialize virRandom in for test suite. (Cole Robinson)
- tests: Add storage volume XML 2 XML tests. (Cole Robinson)
- tests: Add network XML to XML tests. (Cole Robinson)
- schema: Update network schema. (Cole Robinson)
- tests: Add XML 2 XML tests for storage pools. (Cole Robinson)
- tests: Break out duplicate schema verification functionality. (Cole Robinson)
- tests: Fix text output for interface XML 2 XML (Cole Robinson)
- Add ocfs2 to list of fs pool types (Jim Fehlig)
- Finer grained migration control (Chris Lalancette)
Cleanups:
- remove sysfs_path and parent_sysfs_path from XML (Dave Allan)
- Removing devicePath member from dev struct (Dave Allan)
- report OOM in two places in node_device_driver.c (Dave Allan)
- Whitespace cleanup for pre-tags on the website (Matthias Bolte)
- Fix type in configure output summary (Daniel P. Berrange)
- Remove a compilation warning on uninitialized var (Daniel Veillard)
- Change DTD references to use public instead of system identifier (Matthias Bolte)
- Remove obsolete devicekit checks (Daniel P. Berrange)
- Small guestfwd code cleanup (Matthew Booth)
- Small indentation cleanup of domain schema (Matthew Booth)
- AppArmor code cleanups (Jamie Strandboge)
- Fix formatting of XML for an inactive guest (Daniel P. Berrange)
- Remove DevKit node device backend (David Allan)
- Exclude numactl on s390[x] (Daniel P. Berrange)
- Fix error handling in qemuMonitorOpen (Ryota Ozaki)
- Fix warning on make due to missing cast (int) (Ryota Ozaki)
- Various fixes following a code review part 2 (Daniel Veillard)
- Various fixes following a code review (Daniel Veillard)
- Move code for low level QEMU monitor interaction into separate file (Daniel P. Berrange)
- Make pciDeviceList struct opaque (Daniel P. Berrange)
- Add missing OOM error checks, reports and cleanups (Matthias Bolte)
- Removes the ebtablesSaveRules() function (Gerhard Stenzel)
- phyp: Use actual error code instead of 0 (Matthias Bolte)
- phyp: Don't use VIR_ALLOC if a stack variable is good enough (Matthias Bolte)
- phyp: Fix several UUID table related problems (Matthias Bolte)
- phyp: Check for exit_status < 0 before parsing the result (Matthias Bolte)
- phyp: memcpy/memmove/memset can't fail, so don't check for error (Matthias Bolte)
- phyp: Make generic domain listing functions return -1 in case of error (Matthias Bolte)
- Fix configure check for libssh2 (Matthias Bolte)
- Repair getIPv4Addr after the ntohl conversion (Daniel Veillard)
- Cleanup whitespace in docs (Matthew Booth)
- Use virBuffer when building QEMU char dev command line (Matthew Booth)
- Cleanup virBuffer usage in qemdBuildCommandLine (Matthew Booth)
- Fix some cut-and-paste error in migration code (Paolo Bonzini)
- Ensure guestfwd address is IPv4 and various cleanups (Matthew Booth)
- LXC cleanup deep indentation in lxcDomainSetAutostart (Ryota Ozaki)
- LXC messages cleanup and fix lxcError (Ryota Ozaki)
- qemu: Remove compiled out localhost migration support (Cole Robinson)
- Various error reporting fixes (Cole Robinson)
- Improve error reporting for virConnectGetHostname calls (Cole Robinson)
- Fix up NLS warnings. (Chris Lalancette)
- Remove redundant virFileDeletePID() call (Chris Lalancette)
- Fix return value in virStateInitialize impl for LXC (Daniel P. Berrange)
- ESX: Unify naming of VI API utility and convenience functions. (Matthias Bolte)
- Rename internal APis (Daniel P. Berrange)
- Pull signal setup code out into separate method (Daniel P. Berrange)
- Fix duplicating logging of errors in libvirtd (Daniel P. Berrange)
- Fix initialization order bugs (Daniel P. Berrange)
- Misc cleanup to network socket init (Daniel P. Berrange)
- Annotate many methods with ATTRIBUTE_RETURN_CHECK & fix problems (Daniel P. Berrange)
- Don't use private struct member names of in6_addr (Matthias Bolte)
- Fix typo in network.c function comments (Matthew Booth)
- libvirt-devel should only require libvirt-client (Mark McLoughlin)
- qemu: Fix an error message in GetVcpus (Cole Robinson)
- storage: Break out function to add pool source to a SourceList. (Cole Robinson)
- storage: Break out pool source parsing to a separate function. (Cole Robinson)
- Fix some typos in comments (Dan Kenigsberg)
- Fix error message in qemudLoadDriverConfig() (Matthias Bolte)
- Add a new syntax-check rule for gethostname. (Chris Lalancette)
- Various syntax-check fixes. (Chris Lalancette)
- Tighten up nonreentrant syntax-check. (Chris Lalancette)
- Replace a gethostname by virGetHostname in libvirtd.c (Chris Lalancette)
- Replace two strcmp() by STREQ() in qemu_driver.c (Chris Lalancette)
- Replace gethostname by virGetHostname in xend_internal.c (Chris Lalancette)
- Add a default log_level to qemudSetLogging to remove a build warning. (Chris Lalancette)
- Better error message when libvirtd fails to start. (Chris Lalancette)
- Fix potential false-positive OOM error reporting. (Matthias Bolte)
- Fix virsh.c compilation warning (Jim Fehlig)
- Fix a make dist error due to wrong EXTRA_DIST paths (Daniel Veillard)
- node device: Break out get_wwns and get_parent_node helpers (Cole Robinson)
- tests: Centralize VIR_TEST_DEBUG lookup, and document it (Cole Robinson)
- Remove bogus const annotations to hash iterator (Daniel P. Berrange)
- Remove bashisms from schema tests. (Matthias Bolte)
- Don't copy old machines from a domain which has none (Mark McLoughlin)
Thanks everybody for your contributions !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
15 years
[libvirt] [PATCH] Enable udev instead of hal on F12 / RHEL-6 or later
by Daniel P. Berrange
HAL has been deprecated since F12 and RHEL-6, so if building on
these platforms, switch on the udev driver instead
* libvirt.spec.in: Activate udev on F12/RHEL6
---
libvirt.spec.in | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index f2933ad..a2ace2c 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -53,12 +53,13 @@
%define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}}
%define with_numactl 0%{!?_without_numactl:%{server_drivers}}
%define with_selinux 0%{!?_without_selinux:%{server_drivers}}
-%define with_hal 0%{!?_without_hal:%{server_drivers}}
# A few optional bits off by default, we enable later
%define with_polkit 0%{!?_without_polkit:0}
%define with_capng 0%{!?_without_capng:0}
%define with_netcf 0%{!?_without_netcf:0}
+%define with_udev 0%{!?_without_udev:0}
+%define with_hal 0%{!?_without_hal:0}
# Non-server/HV driver defaults which are always enabled
%define with_python 0%{!?_without_python:1}
@@ -133,6 +134,13 @@
%define with_netcf 0%{!?_without_netcf:%{server_drivers}}
%endif
+# udev is used to manage host devices in Fedora 12 / RHEL-6 or newer
+%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+%define with_udev 0%{!?_without_udev:%{server_drivers}}
+%else
+%define with_hal 0%{!?_without_hal:%{server_drivers}}
+%endif
+
# Force QEMU to run as non-root
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
%define qemu_user qemu
@@ -179,6 +187,9 @@ Requires: iptables
%if %{with_hal}
Requires: hal
%endif
+%if %{with_udev}
+Requires: udev >= 145
+%endif
%if %{with_polkit}
%if 0%{?fedora} >= 12 || 0%{?rhel} >=6
Requires: polkit >= 0.93
@@ -242,6 +253,10 @@ BuildRequires: gnutls-devel
%if %{with_hal}
BuildRequires: hal-devel
%endif
+%if %{with_udev}
+BuildRequires: libudev-devel >= 145
+BuildRequires: libpciaccess-devel >= 0.10.9
+%endif
%if %{with_avahi}
BuildRequires: avahi-devel
%endif
@@ -476,6 +491,10 @@ of recent versions of Linux (and other OSes).
%define _without_hal --without-hal
%endif
+%if ! %{with_udev}
+%define _without_udev --without-udev
+%endif
+
%configure %{?_without_xen} \
%{?_without_qemu} \
%{?_without_openvz} \
@@ -502,6 +521,7 @@ of recent versions of Linux (and other OSes).
%{?_without_netcf} \
%{?_without_selinux} \
%{?_without_hal} \
+ %{?_without_udev} \
--with-qemu-user=%{qemu_user} \
--with-qemu-group=%{qemu_group} \
--with-init-script=redhat \
--
1.6.5.2
15 years
[libvirt] [PATCH] docs: Document overriding domain interface target
by Cole Robinson
People have been confused about this in the past, so document that
vnet and vif are reserved names and will be ignored if manually specified.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
docs/formatdomain.html.in | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 05047d3..5b7aa10 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -484,7 +484,8 @@
of the box which does NAT'ing to the default route and has an IP range of
<code>192.168.22.0/255.255.255.0</code>. Each guest will have an
associated tun device created with a name of vnetN, which can also be
- overridden with the <target> element.
+ overridden with the <target> element (see
+ <a href="#elementsNICSTargetOverride">overriding the target element</a>).
</p>
<pre>
@@ -514,10 +515,11 @@
there is a bridge device on the host which has one or more of the hosts
physical NICs enslaved. The guest VM will have an associated tun device
created with a name of vnetN, which can also be overridden with the
- <target> element. The tun device will be enslaved to the bridge.
- The IP range / network configuration is whatever is used on the LAN. This
- provides the guest VM full incoming & outgoing net access just like a
- physical machine.
+ <target> element (see
+ <a href="#elementsNICSTargetOverride">overriding the target element</a>).
+ The tun device will be enslaved to the bridge. The IP range / network
+ configuration is whatever is used on the LAN. This provides the guest VM
+ full incoming & outgoing net access just like a physical machine.
</p>
<pre>
@@ -652,6 +654,25 @@ qemu-kvm -net nic,model=? /dev/null
ne2k_isa i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio
</p>
+ <h5><a name="elementsNICSTargetOverride">Overriding the target element</a></h5>
+
+ <pre>
+ ...
+ <interface type='network'>
+ <source network='default'/>
+ <b><target dev='vnet1'/></b>
+ </interface>
+ ...</pre>
+
+ <p>
+ If no target is specified, certain hypervisors will automatically
+ generate a name for the created tun device. This name can be manually
+ specifed, however the name <i>must not start with either 'vnet' or
+ 'vif'</i>, which are prefixes reserved by libvirt and certain
+ hypervisors. Manually specified targets using these prefixes will be
+ ignored.
+ </p>
+
<h4><a name="elementsInput">Input devices</a></h4>
<p>
--
1.6.5.2
15 years
[libvirt] [PATCH] python: Actually implement list*Interfaces
by Cole Robinson
These have never worked. Would be nice to get this in the pending release!
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
python/generator.py | 4 +-
python/libvirt-override-api.xml | 10 ++++
python/libvirt-override.c | 102 +++++++++++++++++++++++++++++++++++++++
3 files changed, 114 insertions(+), 2 deletions(-)
diff --git a/python/generator.py b/python/generator.py
index 0b32116..3fd7f90 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -260,13 +260,13 @@ skip_impl = (
'virConnectListDefinedDomains',
'virConnectListNetworks',
'virConnectListDefinedNetworks',
- 'virConnectListInterfaces',
- 'virConnectListDefinedInterfaces',
'virConnectListSecrets',
+ 'virConnectListInterfaces',
'virConnectListStoragePools',
'virConnectListDefinedStoragePools',
'virConnectListStorageVols',
'virConnectListDefinedStorageVols',
+ 'virConnectListDefinedInterfaces',
'virConnGetLastError',
'virGetLastError',
'virDomainGetInfo',
diff --git a/python/libvirt-override-api.xml b/python/libvirt-override-api.xml
index 4e55182..96958b5 100644
--- a/python/libvirt-override-api.xml
+++ b/python/libvirt-override-api.xml
@@ -211,5 +211,15 @@
<return type='char *' info='the UUID string or None in case of error'/>
<arg name='secret' type='virSecretPtr' info='a secret object'/>
</function>
+ <function name='virConnectListInterfaces' file='python'>
+ <info>list the running interfaces, stores the pointers to the names in @names</info>
+ <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
+ <return type='str *' info='the list of Names of None in case of error'/>
+ </function>
+ <function name='virConnectListDefinedInterfaces' file='python'>
+ <info>list the defined interfaces, stores the pointers to the names in @names</info>
+ <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
+ <return type='str *' info='the list of Names of None in case of error'/>
+ </function>
</symbols>
</api>
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 20037ef..b885190 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -1761,6 +1761,106 @@ libvirt_virSecretSetValue(PyObject *self ATTRIBUTE_UNUSED,
return py_retval;
}
+static PyObject *
+libvirt_virConnectListInterfaces(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args) {
+ PyObject *py_retval;
+ char **names = NULL;
+ int c_retval, i;
+ virConnectPtr conn;
+ PyObject *pyobj_conn;
+
+
+ if (!PyArg_ParseTuple(args, (char *)"O:virConnectListInterfaces", &pyobj_conn))
+ return(NULL);
+ conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+ c_retval = virConnectNumOfInterfaces(conn);
+ if (c_retval < 0)
+ return VIR_PY_NONE;
+
+ if (c_retval) {
+ names = malloc(sizeof(*names) * c_retval);
+ if (!names)
+ return VIR_PY_NONE;
+ c_retval = virConnectListInterfaces(conn, names, c_retval);
+ if (c_retval < 0) {
+ free(names);
+ return VIR_PY_NONE;
+ }
+ }
+ py_retval = PyList_New(c_retval);
+ if (py_retval == NULL) {
+ if (names) {
+ for (i = 0;i < c_retval;i++)
+ free(names[i]);
+ free(names);
+ }
+ return VIR_PY_NONE;
+ }
+
+ if (names) {
+ for (i = 0;i < c_retval;i++) {
+ PyList_SetItem(py_retval, i, libvirt_constcharPtrWrap(names[i]));
+ free(names[i]);
+ }
+ free(names);
+ }
+
+ return(py_retval);
+}
+
+
+static PyObject *
+libvirt_virConnectListDefinedInterfaces(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args) {
+ PyObject *py_retval;
+ char **names = NULL;
+ int c_retval, i;
+ virConnectPtr conn;
+ PyObject *pyobj_conn;
+
+
+ if (!PyArg_ParseTuple(args, (char *)"O:virConnectListDefinedInterfaces",
+ &pyobj_conn))
+ return(NULL);
+ conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+ c_retval = virConnectNumOfDefinedInterfaces(conn);
+ if (c_retval < 0)
+ return VIR_PY_NONE;
+
+ if (c_retval) {
+ names = malloc(sizeof(*names) * c_retval);
+ if (!names)
+ return VIR_PY_NONE;
+ c_retval = virConnectListDefinedInterfaces(conn, names, c_retval);
+ if (c_retval < 0) {
+ free(names);
+ return VIR_PY_NONE;
+ }
+ }
+ py_retval = PyList_New(c_retval);
+ if (py_retval == NULL) {
+ if (names) {
+ for (i = 0;i < c_retval;i++)
+ free(names[i]);
+ free(names);
+ }
+ return VIR_PY_NONE;
+ }
+
+ if (names) {
+ for (i = 0;i < c_retval;i++) {
+ PyList_SetItem(py_retval, i, libvirt_constcharPtrWrap(names[i]));
+ free(names[i]);
+ }
+ free(names);
+ }
+
+ return(py_retval);
+}
+
/*******************************************
* Helper functions to avoid importing modules
* for every callback
@@ -2472,6 +2572,8 @@ static PyMethodDef libvirtMethods[] = {
{(char *) "virConnectListSecrets", libvirt_virConnectListSecrets, METH_VARARGS, NULL},
{(char *) "virSecretGetValue", libvirt_virSecretGetValue, METH_VARARGS, NULL},
{(char *) "virSecretSetValue", libvirt_virSecretSetValue, METH_VARARGS, NULL},
+ {(char *) "virConnectListInterfaces", libvirt_virConnectListInterfaces, METH_VARARGS, NULL},
+ {(char *) "virConnectListDefinedInterfaces", libvirt_virConnectListDefinedInterfaces, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};
--
1.6.5.2
15 years
[libvirt] [PATCH] 514532 Fix man page, most operation are synchronous
by Daniel Veillard
As pointed in https://bugzilla.redhat.com/show_bug.cgi?id=514532
we were historically warning about operation being asynchronous
in the man page but actually most operations are synchronous.
I still kept a warning about domain creation and shutdown, maybe
we should add a few more, but as is this is mostly correct and
better than the current description IMHO
Maybe we should flag formally in the description all APIs which
have an asynchronous behaviour.
514532 Fix man page, most operation are synchronous
* tools/virsh.pod: the man page was stating that most operations
are asynchronous while in fact most of them are synchronous except
domain creation and shutdown
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 55ec64a..2986c34 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -40,12 +40,11 @@ Most B<virsh> commands require root privileges to run due to the
communications channels used to talk to the hypervisor. Running as
non root will return an error.
-Most B<virsh> commands act asynchronously, so just because the B<virsh>
-program returned, doesn't mean the action is complete. This is
-important, as many operations on domains, like create and shutdown,
-can take considerable time (30 seconds or more) to bring the machine
-into a fully compliant state. If you want to know when one of these
-actions has finished you must poll through virsh list periodically.
+Most B<virsh> commands act synchronously, except maybe shutdown
+and domain creation. In those case the fact that the B<virsh>
+program returned, may not mean the action is complete and you
+must poll through virsh list periodically to detect that the
+operation completed.
=head1 GENERIC COMMANDS
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
15 years
[libvirt] [PATCH] Check for duplicated UUID in XM Xen defines
by Daniel Veillard
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=504262
where the xen drivers happily allows to define domains with conflicting
UUID. This is similar to the virDomainObjIsDuplicate check done in other
drivers but the internal structures are different so this need to be
done in a special way
Author: Daniel Veillard <veillard(a)redhat.com>
Date: Tue Nov 17 12:06:46 2009 +0100
504262 Check for duplicated UUID in XM Xen defines
* src/xen/xm_internal.c: the XM driver was not checking for previously
defined UUID on new defines. Similar to virDomainObjIsDuplicate()
behaviour.
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index f833ce7..47bcc11 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -2623,6 +2623,26 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
return (NULL);
}
+ /*
+ * check that if there is another domain defined with the same uuid
+ * it has the same name
+ */
+ if ((entry = virHashSearch(priv->configCache, xenXMDomainSearchForUUID,
+ (const void *)&(def->uuid))) != NULL) {
+ if ((entry->def != NULL) && (entry->def->name != NULL) &&
+ (STRNEQ(def->name, entry->def->name))) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+ virUUIDFormat(entry->def->uuid, uuidstr);
+ xenXMError(conn, VIR_ERR_OPERATION_FAILED,
+ _("domain '%s' is already defined with uuid %s"),
+ entry->def->name, uuidstr);
+ entry = NULL;
+ goto error;
+ }
+ entry = NULL;
+ }
+
if (virHashLookup(priv->nameConfigMap, def->name)) {
/* domain exists, we will overwrite it */
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
15 years
[libvirt] [PATCH] 512069 fix domain XML schemas for backward compatibility
by Daniel Veillard
https://bugzilla.redhat.com/show_bug.cgi?id=512069
512069 fix domain XML schemas for backward compatibility
For backward compatibility we used to add the tty path as
a tty attribute on console of type pty, duplicating the value
now found in source/@path, but the Relax-NG grammar wasn't
extended for this
<console type='pty' tty='/dev/pts/8'>
<source path='/dev/pts/8'/>
<target port='0'/>
</console>
* docs/schemas/domain.rng: allow an optional tty attribute
containing a devicePath
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 1bf44fd..e726801 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -931,6 +931,11 @@
-->
<define name="qemucdev">
<ref name="qemucdevSrcType"/>
+ <optional>
+ <attribute name="tty">
+ <ref name="devicePath"/>
+ </attribute>
+ </optional>
<interleave>
<ref name="qemucdevSrcDef"/>
<optional>
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
15 years
[libvirt] PATCH: recent qemu-kvm requires -enable-kvm flag to activate VT optimization
by Steve Yarmie
Hello,
Recent qemu releases require command option '-enable-qemu' in order
for the kvm functionality be activated. Libvirt needs to pass this
flag to qemu when starting a domain. Note that without the option,
even if both the kernel and qemu support KVM, KVM will not be activated
and VMs will be slow as molasses ;)
I added a check in qemu_conf.c to see if `qemu -help` emits the -enable-kvm
flag, and if so, use the flag accordingly.
There exists a check in src/qemu/qemu_conf.c to check for the -no-kvm flag.
This check works the same way.
Adding the included code will not break systems where qemu does not
have the option.
See 'qemu -help':
...
-enable-kvm enable KVM full virtualization support
...
included patch against src/qemu/qemu_conf.{c,h}
-Steve
diff -ur libvirt/src/qemu/qemu_conf.c libvirt-qemu-enable-kvm/src/qemu/qemu_conf.c
--- libvirt/src/qemu/qemu_conf.c 2009-11-08 20:57:08.438908134 -0800
+++ libvirt-qemu-enable-kvm/src/qemu/qemu_conf.c 2009-11-08 22:36:04.299921427 -0800
@@ -1602,6 +1602,7 @@
struct utsname ut;
int disableKQEMU = 0;
int disableKVM = 0;
+ int enableKVM = 0;
int qargc = 0, qarga = 0;
const char **qargv = NULL;
int qenvc = 0, qenva = 0;
@@ -1660,6 +1661,15 @@
def->virtType == VIR_DOMAIN_VIRT_QEMU)
disableKVM = 1;
+ /* Should explicitly enable KVM if
+ * 1. Guest domain is 'qemu'
+ * 2. The qemu binary has the -enable-kvm flag
+ * NOTE: user must be responsible to load the kvm modules
+ */
+ if ((qemuCmdFlags & QEMUD_CMD_FLAG_ENABLE_KVM) &&
+ def->virtType == VIR_DOMAIN_VIRT_QEMU)
+ enableKVM = 1;
+
/*
* Need to force a 32-bit guest CPU type if
*
@@ -1787,6 +1797,8 @@
ADD_ARG_LIT("-no-kqemu");
if (disableKVM)
ADD_ARG_LIT("-no-kvm");
+ if (enableKVM)
+ ADD_ARG_LIT("-enable-kvm");
ADD_ARG_LIT("-m");
ADD_ARG_LIT(memory);
if (def->hugepage_backed) {
diff -ur libvirt/src/qemu/qemu_conf.h libvirt-qemu-enable-kvm/src/qemu/qemu_conf.h
--- libvirt/src/qemu/qemu_conf.h 2009-11-08 20:57:08.438908134 -0800
+++ libvirt-qemu-enable-kvm/src/qemu/qemu_conf.h 2009-11-08 14:57:39.000000000 -0800
@@ -73,6 +73,7 @@
QEMUD_CMD_FLAG_XEN_DOMID = (1 << 20), /* -xen-domid (new style xen integration) */
QEMUD_CMD_FLAG_MIGRATE_QEMU_UNIX = (1 << 21), /* Does qemu support unix domain sockets for migration? */
QEMUD_CMD_FLAG_CHARDEV = (1 << 22), /* Is the new -chardev arg available */
+ QEMUD_CMD_FLAG_ENABLE_KVM = (1 << 23), /* Is the -enable-kvm flag available to "enable KVM full virtualization support" */
};
/* Main driver state */
15 years