[libvirt] "shadows a global declaration" warnings in virsh
by Justin Clift
Hi all,
Started seeing these warnings when compiling virsh:
virsh.c: In function 'cmdRunConsole':
virsh.c:735: warning: declaration of 'devname' shadows a global declaration [-Wshadow]
/usr/include/stdlib.h:290: warning: shadowed declaration is here [-Wshadow]
virsh.c: In function 'cmdConsole':
virsh.c:765: warning: declaration of 'devname' shadows a global declaration [-Wshadow]
/usr/include/stdlib.h:290: warning: shadowed declaration is here [-Wshadow]
virsh.c: In function 'vshReadlineInit':
virsh.c:11575: warning: assignment discards qualifiers from pointer target type
Haven't looked into it yet as they're only warnings. Anyone know if they're important enough
to look into?
Regards and best wishes,
Justin Clift
14 years
[libvirt] [PATCH] Implement virVMOperationType{To|From}String independent from WITH_MACVTAP
by Matthias Bolte
As this symbols are exported independent from WITH_MACVTAP.
---
src/util/macvtap.c | 33 +++++++++++++++++++--------------
1 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/src/util/macvtap.c b/src/util/macvtap.c
index 2aa319c..4345d97 100644
--- a/src/util/macvtap.c
+++ b/src/util/macvtap.c
@@ -27,12 +27,13 @@
#include <config.h>
+#include <stdint.h>
+
#if WITH_MACVTAP || WITH_VIRTUALPORT
# include <stdio.h>
# include <errno.h>
# include <fcntl.h>
-# include <stdint.h>
# include <c-ctype.h>
# include <sys/socket.h>
# include <sys/ioctl.h>
@@ -44,10 +45,15 @@
# include <netlink/msg.h>
-# include "util.h"
+#endif /* WITH_MACVTAP || WITH_VIRTUALPORT */
+
+#include "util.h"
+#include "macvtap.h"
+
+#if WITH_MACVTAP || WITH_VIRTUALPORT
+
# include "memory.h"
# include "logging.h"
-# include "macvtap.h"
# include "interface.h"
# include "conf/domain_conf.h"
# include "virterror_internal.h"
@@ -77,17 +83,6 @@
# define LLDPAD_PID_FILE "/var/run/lldpad.pid"
-VIR_ENUM_IMPL(virVMOperation, VIR_VM_OP_LAST,
- "create",
- "save",
- "restore",
- "destroy",
- "migrate out",
- "migrate in start",
- "migrate in finish",
- "no-op")
-
-
enum virVirtualPortOp {
ASSOCIATE = 0x1,
DISASSOCIATE = 0x2,
@@ -1609,3 +1604,13 @@ vpDisassociatePortProfileId(const char *macvtap_ifname,
}
#endif /* WITH_MACVTAP || WITH_VIRTUALPORT */
+
+VIR_ENUM_IMPL(virVMOperation, VIR_VM_OP_LAST,
+ "create",
+ "save",
+ "restore",
+ "destroy",
+ "migrate out",
+ "migrate in start",
+ "migrate in finish",
+ "no-op")
--
1.7.0.4
14 years
[libvirt] directory storage pools reported available space
by Ryan Harper
We recently had an issue with not being able to allocate the full
capacity of a directory based storage pool. The reported value via
pool-info was larger than what was available to the image creator.
Looking at the storage code, in virStorageBackendFileSystemRefresh()
we're using statvfs, and reporting back
pool->def->available = ((unsigned long long)sb.f_bfree *
(unsigned long long)sb.f_bsize);
Which is the amount of blocks available, including any root reservation
if present on the filesystem.
This does't line up with df output , which at least on RHEL5 and 6
systems reports the available space from f_bavail, which excludes
and reserved space.
Is it reasonable to have the available value line up with output from df
and not report reserved space?
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh(a)us.ibm.com
14 years
[libvirt] [RFC] new preferences requirement
by Osier Yang
Hi, all
We have some new requirements of preferences, I listed
which of them I known, and think is useful as follows:
1) for the path of x509 certificate and keys of client
The path of x509 certificate and keys of client is hard
coded in remote driver. e.g.
/* Defaults for PKI directory. */
# define LIBVIRT_PKI_DIR SYSCONFDIR "/pki"
# define LIBVIRT_CACERT LIBVIRT_PKI_DIR "/CA/cacert.pem"
# define LIBVIRT_CLIENTKEY LIBVIRT_PKI_DIR "/libvirt/private
/clientkey.pem"
# define LIBVIRT_CLIENTCERT LIBVIRT_PKI_DIR "/libvirt/clientcert.pem"
2) for default default driver and subdriver for disk image
Another requirement of new preference is default driver and subdriver
for disk images, currently we use "phy" for "driver" in virsh, and
"raw" for "subdriver" in qemu driver by default if user doesn't specify
them, it causes bugs, though we could say to user "you should use
options --driver and --subdriver", but these two options are optional.
IMHO, the best solution for those bugs is to provide new preferences.
3) for default NIC and storage type
"Chris Phillips" raised up the requirement not long ago:
http://www.redhat.com/archives/libvirt-users/2010-November/msg00033.html
====================
Should we add these new preferences(if they are really neccessary)
in qemu.conf? or create new config file, e.g. The approch Justin
raised up an approch before:
http://www.redhat.com/archives/libvir-list/2010-November/msg00651.html
Though for Justin's approch, IMHO we'd better also to provide a
default config file, e.g. "/etc/libvirt/client.conf".
Any feedback is welcomed, thanks
- Osier
14 years
[libvirt] Looking for Hypervisor Vulerability Example
by Shi Jin
Hi there,
I am researching on virtualization security and particularly on sVirt.
>From this sVirt presentation[1] and this RHEL-6 documentation on sVirt [2], I read:
If there is a security flaw in the hypervisor that can be exploited by a guest instance, this guest may be able to not only attack the host, but also other guests running on that host. This is not theoretical; attacks already exist on hypervisors. These attacks can extend beyond the guest instance and could expose other guests to attack.
I am very interested to know about the exact attacks: which version of hypervisor on which OS, how was the exploit used and how it affected the systems.
I want to be able to reproduce one of the attacks in our lab so that I can demonstrate to people on the security issues and then how sVirt could be used to actually prevent to attacks on hosting system and other VMs. I believe a real demonstration is better than a million words.
I appreciate your help.
Shi
[1]:http://namei.org/presentations/svirt-lca-2009.pdf
[2]:http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virt...
--
Shi Jin, PhD
14 years
[libvirt] Release of libvirt 0.8.6
by Daniel Veillard
As indicated 10 days ago, today was time for a release, I didn't
had much time so I simply generated a release from libvirt git
without much testing. Hopefully this will be okay !
Release is available as usual at
ftp://libvirt.org/libvirt/
There is actually a number of significant features rolled in this
release, along with the usual fixes and improvements:
Features:
- new API virDomainIsUpdated (Osier Yang)
- Add support for iSCSI target auto-discovery (Daniel P. Berrange)
- QED: Basic support for QED images (Adam Litke)
- Introduce a virDomainOpenConsole API (Daniel P. Berrange)
- Support for SPICE graphics (Daniel P. Berrange)
- Add a sysinfo and SMBIOS support (Daniel Veillard)
- Implement virsh qemu-monitor-command. (Chris Lalancette)
Documentation:
- updated c# bindings with arnauds latest changes (Justin Clift)
- Fix spelling of virBufferVSprintf (Jiri Denemark)
- Fix broken XML entity for '>' (Philipp Hahn)
- removed outdated reference to virt-mem (Justin Clift)
- Add doc for missed options of migrate (Osier Yang)
- add doc for missed parameters of attach-disk (Osier Yang)
- update virsh manual (Osier Yang)
- updated virsh command reference with libvirt.org links (Justin Clift)
- Generate HACKING from docs/hacking.html.in (Matthias Bolte)
- Prepare hacking.html.in to generate HACKING from it (Matthias Bolte)
- updated csharp pages with latest info (Justin Clift)
- trivial typo fix (Justin Clift)
- added virsh command reference page. (Justin Clift)
- rpm: Fix summary wording (Cole Robinson)
- Augment bug reporting documentation (Daniel Veillard)
- virsh: fix incorrect help text mentioning non-existent network 'id' (Justin Clift)
- Fix off-by-1 in todo page generator (Daniel P. Berrange)
- Fix comment for <video> tag in domain RNG schema (Daniel P. Berrange)
- fix typo (Eric Blake)
Portability:
- remote: Fix TLS transport on Windows (Matthias Bolte)
- Rename 'remove' param to 'toremove' to avoid clash with stdio.h (Daniel P. Berrange)
- virt-aa-helper: Fix several compile errors (Matthias Bolte)
- maint: improve i18n on non-Linux (Eric Blake)
- nwfilter: use /bin/sh rather than requiring bash (Eric Blake)
- Use python discovered through env instead of hardcoding a path (Matthias Bolte)
- esx: Avoid warnings about breaking strict-aliasing rules on FreeBSD (Matthias Bolte)
- Make sure struct sockaddr_in is defined on FreeBSD (Matthias Bolte)
- configure: Disable FS storage driver if mntent.h is not available (Matthias Bolte)
- daemon: Include stdlib.h in dispatch.c (Matthias Bolte)
- xen: work with xen 4.0.1 headers (Eric Blake)
- Fix build with polkit 0 (Jim Fehlig)
- xen: work with ia64 MAX_VIRT_CPUS of 64 (Eric Blake)
- build: cleanup declaration of xen tests. (Diego Elio Pettenò)
- qemu: check compression program availability of virsh save and dump (KAMEZAWA Hiroyuki)
Bug Fixes:
- correct the arguments of migrate_speed (Wen Congyang)
- Fix memory leaks in audit & VirtualBox code (Daniel P. Berrange)
- Fix host CPU counting on unusual NUMA topologies (Jiri Denemark)
- security, storage: plug memory leaks for security_context_t (Eric Blake)
- network: plug memory leak (Eric Blake)
- qemu: plug memory leak (Eric Blake)
- Always close drivers when a virConnectPtr is released (Matthias Bolte)
- libvirtd: fix bug when shrinking number of clients (Eric Blake)
- Fix 32-bit int truncation in QED header check (Daniel P. Berrange)
- Fix error handling in virsh when listing storage volumes (Daniel P. Berrange)
- Fix parsing of port attribute in storage XML configuration (Daniel P. Berrange)
- Don't catch SIGCHLD in libvirtd (Daniel P. Berrange)
- Ensure logfile isn't truncated by shutdown message. (Daniel P. Berrange)
- xend: Escape reserved sexpr characters (Cole Robinson)
- xend: urlencode: Properly escape '&' (Cole Robinson)
- conf: Fix parsing python style triple quotes (Cole Robinson)
- nwfilter: re-order lock grabbed by IP addr. learn thread (Stefan Berger)
- virExec: fix bug in setting up child stderr/out with /dev/null (Daniel P. Berrange)
- Fix a failure to restore SELinux label for character devices (Daniel Veillard)
- nwfilter: also purge ip(6)tables rules before detecting IP address (Stefan Berger)
- Fix ipv4-addr definition in interface.rng (Laine Stump)
- remote_driver.c: fix non-literal format strings w/o args (Laine Stump)
- ignore SELinuxSetFilecon error in SELinuxSetSecurityFileLabel if on nfs (Laine Stump)
- Fix reference counting bug in virsh console (Daniel P. Berrange)
- Fix busy-wait loop on closed file descriptor (Daniel P. Berrange)
- Fix LXC container console device setup (Daniel P. Berrange)
- rpm: fix /var/lib/libvirt permissions (Eric Blake)
- xencapstest: Don't fail when Xen is installed (Matthias Bolte)
- virsh: fix non-literal string format (Laine Stump)
- Fix syntax-check error in domain.rng (Matthias Bolte)
- qemu: Fix non-literal format string (Jiri Denemark)
- macvtap: libvirtd forgot macvtap dev name when restarted (Stefan Berger)
- tests: fix daemon-conf testing failure (Osier Yang)
- Fix virPipeReadUntilEOF on more than 1024 bytes of data (Daniel Veillard)
- Misc error handling fixes in text mode monitor commands (Daniel P. Berrange)
- Ignore open failures when relabelling disk images (Daniel P. Berrange)
- Treat failure to relabel stdin_path as non-fatal on NFS (Daniel P. Berrange)
- qemu: add the USB devices to the cgroup whitelist (Diego Elio Pettenò)
Improvements:
- Log client errors in libvirtd at debug priority
- maint: prohibit most uses of xmlGetProp (Eric Blake)
- maint: ensure syntax check exceptions are distributed (Eric Blake)
- Implementations of virDomainIsUpdated for drivers except qemu (Osier Yang)
- implement callback function for qemu driver (Osier Yang)
- implement the remote protocol (Osier Yang)
- implement public API virDomainIsUpdated (Osier Yang)
- define internal driver API (Osier Yang)
- tests: Fix dispatching internal error reports (Cole Robinson)
- Improve SCSI volume name generation (Daniel P. Berrange)
- Fix error codes returned when a storage pool is inactive (Daniel P. Berrange)
- Check whether pools are already active upon libvirtd startup (Daniel P. Berrange)
- Allow iSCSI IQN to be set with find-storage-pool-sources-as command (Daniel P. Berrange)
- Switch the virsh XML generation to use virBuffer instead of virAsprintf (Daniel P. Berrange)
- Stop iSCSI targets automatically logging back in after logout (Daniel P. Berrange)
- Refactor iSCSI driver code to facilitate future changes (Daniel P. Berrange)
- Ensure virExec preserves logging environment (Daniel P. Berrange)
- Include a thread identifier in log messages (Daniel P. Berrange)
- qemu: setvcpus: Save config changes to disk (Cole Robinson)
- qemu: setvcpus: Simplify altering the persistent config (Cole Robinson)
- qemu: setvcpus: Fix maxvcpus check (Cole Robinson)
- conf: domain: Improve vcpus validation reporting (Cole Robinson)
- Make state driver device hotplug/update actually transient (Cole Robinson)
- domain_conf: Add virDomainObjSetDefTransient (Cole Robinson)
- buf: Simplify virBufferEscapeString (Cole Robinson)
- conf: Convert ParseString to use STRPREFIX (Cole Robinson)
- schemas: domain: Add more valid file path chars (Cole Robinson)
- qed: Minor updates to QED support patches (Adam Litke)
- Support for probing qed image metadata (Adam Litke)
- storage_file: Add a new flag to mark backing files that are safe to probe (Adam Litke)
- Allow probing of image formats without version information (Adam Litke)
- maint: tighten strncmp syntax check (Eric Blake)
- capabilities, cpu: use new array API (Eric Blake)
- memory: make it easier to avoid quadratic scaling of arrays (Eric Blake)
- memory: make it safer to expand arrays (Eric Blake)
- build: fix autobuild failures on gcov upgrade (Eric Blake)
- virt-aa-helper: translate error messages (Eric Blake)
- maint: update to latest gnulib (Eric Blake)
- deprecate fclose() and introduce VIR_{FORCE_}FCLOSE() (Stefan Berger)
- qemu: record timestamp in qemu domain log (Osier Yang)
- virsh: add net-info command (Osier Yang)
- interface.rng: Make miimon and arpmon optional for bond interfaces (Laine Stump)
- macvtap: convert send / recv function to use libnl (Stefan Berger)
- configure: Remove bashism and replace 'test ==' with 'test =' (Matthias Bolte)
- virsh: Fix compile error in VPATH build (Matthias Bolte)
- qemu: Remove unnecessary quoting from the process name argument (John Morrissey)
- phyp: Don't do a flags check in the storage driver (Matthias Bolte)
- qemu: Add qemu-system-s390x to the emulators list (Matthias Bolte)
- macvtap: convert nl msg construction to use libnl (Stefan Berger)
- Do a better job of validating IP and MAC addresses in network.rng (Laine Stump)
- virt-aa-helper should require <uuid> in XML (Jamie Strandboge)
- esx: Support SMBIOS host mode (Matthias Bolte)
- Wire up virDomainOpenConsole for LXC, Xen and UML (Daniel P. Berrange)
- Re-write virsh console to use streams (Daniel P. Berrange)
- Convert daemon/events.c to use virMutex and virThread (Daniel P. Berrange)
- Introduce portability APIs for creating threads (Daniel P. Berrange)
- Support virDomainOpenConsole with QEMU (Daniel P. Berrange)
- Add a generic internal API for handling any FD based stream (Daniel P. Berrange)
- Lower logging level in remote driver streams (Daniel P. Berrange)
- Remote driver client and server for virDomainOpenConsole (Daniel P. Berrange)
- Support callbacks on virStream APIs in remote driver client (Daniel P. Berrange)
- virsh: supply long option for -V (Eric Blake)
- qemu: Add flag to force a CDROM eject (Cole Robinson)
- Allow non-file disk backingStores (Adam Litke)
- bye to close(), welcome to VIR_(FORCE_)CLOSE() (Stefan Berger)
- esx: Add support for memtune/min_guarantee (Matthias Bolte)
- schema: Move timer element inside clock (Jiri Denemark)
- Misc test case fixes for SPICE (Daniel P. Berrange)
- virsh: Add .xml suffix to tmp files used in *edit commands (Jiri Denemark)
- Support SPICE channel security options (Daniel P. Berrange)
- Support multiple QXL video cards (Daniel P. Berrange)
- Define XML syntax for password expiry (Daniel P. Berrange)
- Add SPICE support for QEMU driver configuration file (Daniel P. Berrange)
- Support automatic port number allocation for SPICE (Daniel P. Berrange)
- Implement QEMU/KVM QXL video card support in QEMU driver (Daniel P. Berrange)
- Add a <graphics> type for SPICE protocol (Daniel P. Berrange)
- Add a QXL graphics card type to domain XML schema (Daniel P. Berrange)
- Show compiled in options in virsh -V (Daniel Veillard)
- lxc: Exit on first error in lxcDomainGetMemoryParameters (Matthias Bolte)
- Allow virDomainGetMemoryParameters on read-only connections (Matthias Bolte)
- Add a new test for sysinfo and smbios handling (Daniel Veillard)
- Add sysinfo/smbios support to the QEmu driver (Daniel Veillard)
- Read the host sysinfo for the QEmu driver (Daniel Veillard)
- Add smbios element to schema and configuration to HVM os (Daniel Veillard)
- Sysinfo parsing and saving to/from configuration files (Daniel Veillard)
- Sysinfo extension to relax-ng schemas (Daniel Veillard)
- Change calling conventions in remote driver client internals (Daniel P. Berrange)
- util: Add helper function to build timestamp string (Osier Yang)
- misc: encode the Emacs suggstions from HACKING into a .dir-locals.el file (Diego Elio Pettenò)
- add compression support for "virsh dump" (KAMEZAWA Hiroyuki)
- qemu_driver: add virCgroupMounted (Lai Jiangshan)
Cleanups:
- tests: Fix detection of expected errors (Jiri Denemark)
- Remove bogus check for Xen in example program (Daniel P. Berrange)
- build: enforce files.h usage (Eric Blake)
- maint: sort exports (Eric Blake)
- Remove bogus port handling code in virsh (Daniel P. Berrange)
- Remove trailing ':' from timestamp (Daniel P. Berrange)
- Log all errors at level INFO to stop polluting syslog (Daniel P. Berrange)
- daemon: use safer memory growth macros (Eric Blake)
- maint: avoid remaining sprintf uses (Eric Blake)
- maint: use gnulib configmake rather than open-coding things (Eric Blake)
- replace last instances of close() (Stefan Berger)
- daemon: fix indention problem in daemon/libvirt.c (Osier Yang)
- qemu: fix typos in qemu_monitor_text.c (Osier Yang)
- re-indent network.rng following structural change (Laine Stump)
- Put network.rng contents inside <grammar> for uniformity with other RNGs (Laine Stump)
- maint: Commit .gitignore sorting done by bootstrap (Jiri Denemark)
- xen-proxy: Remove it entirely and use libvirtd instead (Matthias Bolte)
- qemu: Remove redundant slash in save directory path (Matthias Bolte)
- virterror: supply missing spaces (Eric Blake)
- Fix several warnings about a non-literal format string (Jiri Denemark)
- build: avoid compiler warning in xen code (Eric Blake)
Thanks everybody for their input, ideas, patches or documentation
used in this release !
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/
14 years
[libvirt] [PATCH] tests: Don't ignore return value of getcwd()
by Jiri Denemark
---
tests/commandhelper.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 2ee9153..5b2f301 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -97,7 +97,8 @@ int main(int argc, char **argv) {
fprintf(log, "DAEMON:%s\n", getppid() == 1 ? "yes" : "no");
char cwd[1024];
- getcwd(cwd, sizeof(cwd));
+ if (!getcwd(cwd, sizeof(cwd)))
+ return EXIT_FAILURE;
if (strlen(cwd) > strlen("/commanddata") &&
STREQ(cwd + strlen(cwd) - strlen("/commanddata"), "/commanddata"))
strcpy(cwd, ".../commanddata");
--
1.7.3.2
14 years
[libvirt] [PATCH] build: Fix internal docs generation in VPATH builds
by Jiri Denemark
---
docs/Makefile.am | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index ce0b391..43c54f6 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -117,6 +117,7 @@ todo:
internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
@if [ -x $(XSLTPROC) ] ; then \
echo "Generating $@"; \
+ $(MKDIR_P) "$(builddir)/internals"; \
name=`echo $@ | sed -e 's/.tmp//'`; \
$(XSLTPROC) --stringparam pagename $$name --nonet --html \
$(top_srcdir)/docs/subsite.xsl $< > $@ \
--
1.7.3.2
14 years
[libvirt] [PATCH] Change return value of VIR_DRV_SUPPORTS_FEATURE to bool
by Jiri Denemark
virDrvSupportsFeature API is allowed to return -1 on error while all but
one uses of VIR_DRV_SUPPORTS_FEATURE only check for (non)zero return
value. Let's make this macro return zero on error, which is what
everyone expects anyway.
---
src/driver.h | 8 ++++----
src/libvirt.c | 5 ++++-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/driver.h b/src/driver.h
index b770e5e..e797a75 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -52,12 +52,12 @@ typedef enum {
* Note that you must check for errors.
*
* Returns:
- * >= 1 Feature is supported.
+ * != 0 Feature is supported.
* 0 Feature is not supported.
- * -1 Error.
*/
-# define VIR_DRV_SUPPORTS_FEATURE(drv,conn,feature) \
- ((drv)->supports_feature ? (drv)->supports_feature((conn),(feature)) : 0)
+# define VIR_DRV_SUPPORTS_FEATURE(drv,conn,feature) \
+ ((drv)->supports_feature ? \
+ (drv)->supports_feature((conn), (feature)) > 0 : 0)
typedef virDrvOpenStatus
(*virDrvOpen) (virConnectPtr conn,
diff --git a/src/libvirt.c b/src/libvirt.c
index b4951c2..4188b45 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1605,7 +1605,10 @@ virDrvSupportsFeature (virConnectPtr conn, int feature)
return (-1);
}
- ret = VIR_DRV_SUPPORTS_FEATURE (conn->driver, conn, feature);
+ if (!conn->driver->supports_feature)
+ ret = 0;
+ else
+ ret = conn->driver->supports_feature(conn, feature);
if (ret < 0)
virDispatchError(conn);
--
1.7.3.2
14 years