[libvirt] [PATCH] virsh: mark autostart answers for translation
by Justin Clift
This is a trivial fix for several autostart yes/no strings that
weren't correctly marked for translation.
---
tools/virsh.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 7e65942..56e1bd7 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -3406,7 +3406,7 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
if (virNetworkGetAutostart(network, &autostart) < 0)
autostartStr = _("no autostart");
else
- autostartStr = autostart ? "yes" : "no";
+ autostartStr = autostart ? _("yes") : _("no");
vshPrint(ctl, "%-20s %-10s %-10s\n",
virNetworkGetName(network),
@@ -3429,7 +3429,7 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
if (virNetworkGetAutostart(network, &autostart) < 0)
autostartStr = _("no autostart");
else
- autostartStr = autostart ? "yes" : "no";
+ autostartStr = autostart ? _("yes") : _("no");
vshPrint(ctl, "%-20s %-10s %-10s\n",
inactiveNames[i],
@@ -4947,7 +4947,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
if (virStoragePoolGetAutostart(pool, &autostart) < 0)
autostartStr = _("no autostart");
else
- autostartStr = autostart ? "yes" : "no";
+ autostartStr = autostart ? _("yes") : _("no");
vshPrint(ctl, "%-20s %-10s %-10s\n",
virStoragePoolGetName(pool),
@@ -4970,7 +4970,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
if (virStoragePoolGetAutostart(pool, &autostart) < 0)
autostartStr = _("no autostart");
else
- autostartStr = autostart ? "yes" : "no";
+ autostartStr = autostart ? _("yes") : _("no");
vshPrint(ctl, "%-20s %-10s %-10s\n",
inactiveNames[i],
--
1.7.0.1
14 years, 5 months
[libvirt] [PATCHv2 0/5] libvirt: introduce domainCreateWithFlags API
by Eric Blake
v2 - fix things spotted by Daniel. 1, 3, and 4 are unchanged;
2 and 5 modified slightly (see patch for detail), and 6 dropped.
Eric Blake (5):
libvirt: introduce domainCreateWithFlags API
remote: protocol implementation for virDomainCreateWithFlags
drivers: add virDomainCreateWithFlags if virDomainCreate exists
qemu: support starting persistent domain paused
virsh: add start --paused support
daemon/remote.c | 27 +++++++++++++++++++++
daemon/remote_dispatch_args.h | 1 +
daemon/remote_dispatch_prototypes.h | 8 ++++++
daemon/remote_dispatch_ret.h | 1 +
daemon/remote_dispatch_table.h | 5 ++++
include/libvirt/libvirt.h.in | 2 +
src/driver.h | 6 ++++-
src/esx/esx_driver.c | 11 +++++++-
src/libvirt.c | 45 ++++++++++++++++++++++++++++++++++-
src/libvirt_public.syms | 6 ++++
src/lxc/lxc_driver.c | 21 ++++++++++++++-
src/opennebula/one_driver.c | 10 +++++++-
src/openvz/openvz_driver.c | 11 +++++++-
src/phyp/phyp_driver.c | 1 +
src/qemu/qemu_driver.c | 26 +++++++++++++++----
src/remote/remote_driver.c | 33 +++++++++++++++++++++++++
src/remote/remote_protocol.c | 20 +++++++++++++++
src/remote/remote_protocol.h | 16 ++++++++++++
src/remote/remote_protocol.x | 14 +++++++++-
src/remote_protocol-structs | 7 +++++
src/test/test_driver.c | 9 ++++++-
src/uml/uml_driver.c | 8 +++++-
src/vbox/vbox_tmpl.c | 9 ++++++-
src/xen/xen_driver.c | 11 +++++++-
src/xenapi/xenapi_driver.c | 20 ++++++++++++++-
tools/virsh.c | 9 ++++++-
tools/virsh.pod | 7 ++++-
27 files changed, 319 insertions(+), 25 deletions(-)
14 years, 5 months
[libvirt] [PATCH] maint: simplify some ignore files
by Eric Blake
* .hgignore: Delete, no longer used.
* examples/python/.gitignore: Delete, covered globally.
* include/.gitignore: Likewise.
* python/tests/.gitignore: Likewise.
* docs/schemas/.gitignore: Likewise.
* tests/xml2sexprdata/.gitignore: Likewise.
* tests/sexpr2xmldata/.gitignore: Likewise.
* tests/confdata/.gitignore: Likewise.
* tests/xencapsdata/.gitignore: Likewise.
* tests/xmconfigdata/.gitignore: Likewise.
* tests/xml2sexprdata/.gitignore: Likewise.
---
.hgignore | 298 ----------------------------------------
docs/schemas/.gitignore | 2 -
examples/python/.gitignore | 2 -
include/.gitignore | 2 -
python/tests/.gitignore | 2 -
tests/confdata/.gitignore | 2 -
tests/sexpr2xmldata/.gitignore | 2 -
tests/xencapsdata/.gitignore | 2 -
tests/xmconfigdata/.gitignore | 2 -
tests/xml2sexprdata/.gitignore | 2 -
10 files changed, 0 insertions(+), 316 deletions(-)
delete mode 100644 .hgignore
delete mode 100644 docs/schemas/.gitignore
delete mode 100644 examples/python/.gitignore
delete mode 100644 include/.gitignore
delete mode 100644 python/tests/.gitignore
delete mode 100644 tests/confdata/.gitignore
delete mode 100644 tests/sexpr2xmldata/.gitignore
delete mode 100644 tests/xencapsdata/.gitignore
delete mode 100644 tests/xmconfigdata/.gitignore
delete mode 100644 tests/xml2sexprdata/.gitignore
diff --git a/.hgignore b/.hgignore
deleted file mode 100644
index 47252d7..0000000
--- a/.hgignore
+++ /dev/null
@@ -1,298 +0,0 @@
-syntax: glob
-*.a
-*.o
-*~
-.git
-ABOUT-NLS
-COPYING
-INSTALL
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-build-aux/compile
-build-aux/config.guess
-build-aux/config.rpath
-build-aux/config.sub
-build-aux/depcomp
-build-aux/install-sh
-build-aux/ltmain.sh
-build-aux/missing
-build-aux/mkinstalldirs
-build-aux/mktempd
-config.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.rpath
-config.status
-config.sub
-configure
-coverage
-docs/.memdump
-docs/Makefile
-docs/Makefile.in
-docs/apibuild.pyc
-docs/devhelp/Makefile
-docs/devhelp/Makefile.in
-docs/devhelp/libvirt.devhelp
-docs/examples/.deps
-docs/examples/.libs
-docs/examples/.memdump
-docs/examples/Makefile
-docs/examples/Makefile.in
-docs/examples/info1
-docs/examples/python/Makefile
-docs/examples/python/Makefile.in
-docs/examples/suspend
-docs/schemas/Makefile
-docs/schemas/Makefile.in
-examples/domain-events/events-c/*.exe
-examples/domain-events/events-c/.deps
-examples/domain-events/events-c/.libs
-examples/domain-events/events-c/Makefile
-examples/domain-events/events-c/Makefile.in
-examples/domain-events/events-c/event-test
-examples/hellolibvirt/.deps
-examples/hellolibvirt/.libs
-examples/hellolibvirt/Makefile
-examples/hellolibvirt/Makefile.in
-examples/hellolibvirt/hellolibvirt
-gnulib/lib/*.la
-gnulib/lib/*.lo
-gnulib/lib/.deps
-gnulib/lib/.libs
-gnulib/lib/Makefile
-gnulib/lib/Makefile.in
-gnulib/lib/alloca.h
-gnulib/lib/arpa/inet.h
-gnulib/lib/arpa_inet.h
-gnulib/lib/errno.h
-gnulib/lib/float.h
-gnulib/lib/netdb.h
-gnulib/lib/netinet/in.h
-gnulib/lib/netinet_in.h
-gnulib/lib/poll.h
-gnulib/lib/stdbool.h
-gnulib/lib/stdint.h
-gnulib/lib/stdio.h
-gnulib/lib/stdlib.h
-gnulib/lib/string.h
-gnulib/lib/sys/select.h
-gnulib/lib/sys/socket.h
-gnulib/lib/sys/stat.h
-gnulib/lib/sys/time.h
-gnulib/lib/sys_ioctl.h
-gnulib/lib/sys_select.h
-gnulib/lib/sys_socket.h
-gnulib/lib/sys_stat.h
-gnulib/lib/sys_time.h
-gnulib/lib/time.h
-gnulib/lib/unistd.h
-gnulib/lib/wchar.h
-gnulib/tests/.deps
-gnulib/tests/.libs
-gnulib/tests/Makefile
-gnulib/tests/Makefile.in
-gnulib/tests/sys
-gnulib/tests/test-EOVERFLOW
-gnulib/tests/test-alloca-opt
-gnulib/tests/test-arpa_inet
-gnulib/tests/test-c-ctype
-gnulib/tests/test-errno
-gnulib/tests/test-fseeko
-gnulib/tests/test-getaddrinfo
-gnulib/tests/test-getdelim
-gnulib/tests/test-gethostname
-gnulib/tests/test-getline
-gnulib/tests/test-gettimeofday
-gnulib/tests/test-lseek
-gnulib/tests/test-lstat
-gnulib/tests/test-netdb
-gnulib/tests/test-netinet_in
-gnulib/tests/test-perror
-gnulib/tests/test-poll
-gnulib/tests/test-random_r
-gnulib/tests/test-snprintf
-gnulib/tests/test-sockets
-gnulib/tests/test-stdbool
-gnulib/tests/test-stdint
-gnulib/tests/test-stdio
-gnulib/tests/test-stdlib
-gnulib/tests/test-strerror
-gnulib/tests/test-string
-gnulib/tests/test-sys_select
-gnulib/tests/test-sys_socket
-gnulib/tests/test-sys_stat
-gnulib/tests/test-sys_time
-gnulib/tests/test-time
-gnulib/tests/test-unistd
-gnulib/tests/test-vasnprintf
-gnulib/tests/test-vasprintf
-gnulib/tests/test-wchar
-include/Makefile
-include/Makefile.in
-include/libvirt/Makefile
-include/libvirt/Makefile.in
-libtool
-libvirt-*.tar.gz
-libvirt.pc
-libvirt.spec
-ltconfig
-ltmain.sh
-m4/Makefile
-m4/Makefile.in
-m4/acinclude.m4
-m4/aclocal.m4
-m4/codeset.m4
-m4/gettext.m4
-m4/glibc21.m4
-m4/iconv.m4
-m4/intdiv0.m4
-m4/intmax.m4
-m4/inttypes-pri.m4
-m4/inttypes.m4
-m4/inttypes_h.m4
-m4/isc-posix.m4
-m4/lcmessage.m4
-m4/lib-ld.m4
-m4/lib-link.m4
-m4/lib-prefix.m4
-m4/libtool.m4
-m4/longdouble.m4
-m4/longlong.m4
-m4/ltoptions.m4
-m4/ltsugar.m4
-m4/ltversion.m4
-m4/lt~obsolete.m4
-m4/nls.m4
-m4/po.m4
-m4/printf-posix.m4
-m4/progtest.m4
-m4/signed.m4
-m4/size_max.m4
-m4/stdint_h.m4
-m4/uintmax_t.m4
-m4/ulonglong.m4
-m4/wchar_t.m4
-m4/wint_t.m4
-m4/xsize.m4
-mingw32-libvirt.spec
-mkinstalldirs
-po/*.gmo
-po/Makefile
-po/Makefile.in
-po/Makefile.in.in
-po/Makevars.template
-po/POTFILES
-po/Rules-quot
-po/boldquot.sed
-po/en(a)boldquot.header
-po/en(a)quot.header
-po/insert-header.sin
-po/quot.sed
-po/remove-potcdate.sed
-po/remove-potcdate.sin
-po/stamp-po
-proxy/.deps
-proxy/.libs
-proxy/Makefile
-proxy/Makefile.in
-proxy/libvirt_proxy
-python/*.la
-python/*.lo
-python/*.loT
-python/*.pyc
-python/.deps
-python/.libs
-python/Makefile
-python/Makefile.in
-python/gen_prog
-python/generated.stamp
-python/libvirt-export.c
-python/libvirt-py.[ch]
-python/libvirt.py
-python/libvirtclass.py
-python/libvirtclass.txt
-python/tests/Makefile
-python/tests/Makefile.in
-qemud/*.gcda
-qemud/*.gcno
-qemud/*.la
-qemud/*.lo
-qemud/.deps
-qemud/.libs
-qemud/Makefile
-qemud/Makefile.in
-qemud/libvirt_qemud
-qemud/libvirtd
-qemud/libvirtd.init
-qemud/libvirtd.logrotate
-results.log
-src/*.cov
-src/*.exe
-src/*.gcda
-src/*.gcno
-src/*.gcov
-src/*.i
-src/*.la
-src/*.lo
-src/*.loT
-src/*.s
-src/.deps
-src/.libs
-src/Makefile
-src/Makefile.in
-src/libvirt.syms
-src/libvirt_lxc
-src/libvirt_parthelper
-src/virsh
-src/virsh-net-edit.c
-src/virsh-pool-edit.c
-stamp-h
-stamp-h.in
-stamp-h1
-tests/*.exe
-tests/*.gcda
-tests/*.gcno
-tests/.deps
-tests/.libs
-tests/Makefile
-tests/Makefile.in
-tests/confdata/Makefile
-tests/confdata/Makefile.in
-tests/conftest
-tests/eventtest
-tests/nodedevxml2xmltest
-tests/nodeinfotest
-tests/object-locking
-tests/object-locking-files.txt
-tests/object-locking.cmi
-tests/object-locking.cmx
-tests/qemuargv2xmltest
-tests/qemuhelptest
-tests/qemuxml2argvtest
-tests/qemuxml2xmltest
-tests/qparamtest
-tests/reconnect
-tests/seclabeltest
-tests/sexpr2xmldata/Makefile
-tests/sexpr2xmldata/Makefile.in
-tests/sexpr2xmltest
-tests/statstest
-tests/virshtest
-tests/xencapsdata/Makefile
-tests/xencapsdata/Makefile.in
-tests/xencapstest
-tests/xmconfigdata/Makefile
-tests/xmconfigdata/Makefile.in
-tests/xmconfigtest
-tests/xml2sexprdata/Makefile
-tests/xml2sexprdata/Makefile.in
-tests/xml2sexprtest
-tools/Makefile
-tools/Makefile.in
-tools/virt-xml-validate
-tools/virt-xml-validate.1
-update.log
diff --git a/docs/schemas/.gitignore b/docs/schemas/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/docs/schemas/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/examples/python/.gitignore b/examples/python/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/examples/python/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/include/.gitignore b/include/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/include/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/python/tests/.gitignore b/python/tests/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/python/tests/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/tests/confdata/.gitignore b/tests/confdata/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/tests/confdata/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/tests/sexpr2xmldata/.gitignore b/tests/sexpr2xmldata/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/tests/sexpr2xmldata/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/tests/xencapsdata/.gitignore b/tests/xencapsdata/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/tests/xencapsdata/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/tests/xmconfigdata/.gitignore b/tests/xmconfigdata/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/tests/xmconfigdata/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/tests/xml2sexprdata/.gitignore b/tests/xml2sexprdata/.gitignore
deleted file mode 100644
index 282522d..0000000
--- a/tests/xml2sexprdata/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
--
1.7.0.1
14 years, 5 months
[libvirt] [PATCH] Allow one-or-more <boot dev="..."/> entries
by Philipp Hahn
According to docs/formatdomain.html.in, "The boot element can be
repeated multiple times to setup a priority list of boot devices to try
in turn." The Relax-NG schema required / allowed exactly one entry.
Signed-off-by: Philipp Hahn <hahn(a)univention.de>
---
docs/schemas/domain.rng | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
14 years, 5 months
[libvirt] printf()'s in virsh?
by Justin Clift
Hi guys,
In virsh, in the cmdSchedinfo() function, there's a block of code using
printf instead of vshPrintf():
for (i = 0; i < nparams; i++){
switch (params[i].type) {
case VIR_DOMAIN_SCHED_FIELD_INT:
printf("%-15s: %d\n", params[i].field, params[i].value.i);
break;
case VIR_DOMAIN_SCHED_FIELD_UINT:
printf("%-15s: %u\n", params[i].field, params[i].value.ui);
break;
case VIR_DOMAIN_SCHED_FIELD_LLONG:
printf("%-15s: %lld\n", params[i].field, params[i].value.l);
break;
case VIR_DOMAIN_SCHED_FIELD_ULLONG:
printf("%-15s: %llu\n", params[i].field, params[i].value.ul);
break;
case VIR_DOMAIN_SCHED_FIELD_DOUBLE:
printf("%-15s: %f\n", params[i].field, params[i].value.d);
break;
case VIR_DOMAIN_SCHED_FIELD_BOOLEAN:
printf("%-15s: %d\n", params[i].field, params[i].value.b);
break;
default:
printf("not implemented scheduler parameter type\n");
}
}
These should be vshPrintf() shouldn't they?
Regards and best wishes,
Justin Clift
--
Salasaga - Open Source eLearning IDE
http://www.salasaga.org
14 years, 5 months
[libvirt] [PATCH] [RFC] nwfilter: fix loadable module support
by Stefan Berger
Hello!
I am trying to fix the loadable modules support by removing all direct
calls from qemu_driver.c and qemu_conf.c into nwfilter functions. The
below patch extends the nwfilter driver interface with 2 more private
functions to instantiate and tear down the filters. I call them
'private' because no client should ever be calling them via RPC and be
able to tear down the filters for example -- they should only ever be
callable from within libvirtd.
I extended the qemudShutdownVMDaemon function with the virConnectPtr
type of parameter so that I have the pointer to conn->nwfilterDriver to
access the private nwfilter driver functions. The problem with that is
that the conn pointer is not always available to be passed
(qemuReconnectDomain, qemuHandleMonitorEOF), particularly in tear-down
functions, and so I have to pass a NULL pointer, which then prevents the
calling of the private interface function to tear down the filters.Does
anyone have a suggestion on how I would best change the interface with
the nwfilter driver to fix this particular problem?
Stefan
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
---
src/esx/esx_nwfilter_driver.c | 10 ++++++++
src/nwfilter/nwfilter_driver.c | 15 ++++++++++++
src/nwfilter/nwfilter_gentech_driver.h | 26 ++++++++++++++++-----
src/qemu/qemu_conf.c | 10 ++++----
src/qemu/qemu_driver.c | 40
++++++++++++++++++---------------
5 files changed, 72 insertions(+), 29 deletions(-)
Index: libvirt-acl/src/nwfilter/nwfilter_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_driver.c
@@ -410,6 +410,19 @@ cleanup:
}
+static int
+nwfilterInstantiateFilter(virConnectPtr conn,
+ virDomainNetDefPtr net) {
+ return virNWFilterInstantiateFilter(conn, net);
+}
+
+
+static void
+nwfilterTeardownFilter(virDomainNetDefPtr net) {
+ virNWFilterTeardownFilter(net);
+}
+
+
static virNWFilterDriver nwfilterDriver = {
.name = "nwfilter",
.open = nwfilterOpen,
@@ -421,6 +434,8 @@ static virNWFilterDriver nwfilterDriver
.defineXML = nwfilterDefine,
.undefine = nwfilterUndefine,
.getXMLDesc = nwfilterDumpXML,
+ .privateInstantiateFilter = nwfilterInstantiateFilter,
+ .privateTeardownFilter = nwfilterTeardownFilter,
};
Index: libvirt-acl/src/esx/esx_nwfilter_driver.c
===================================================================
--- libvirt-acl.orig/src/esx/esx_nwfilter_driver.c
+++ libvirt-acl/src/esx/esx_nwfilter_driver.c
@@ -75,6 +75,8 @@ static virNWFilterDriver esxNWFilterDriv
NULL, /* defineXML */
NULL, /* undefine */
NULL, /* getXMLDesc */
+ NULL, /* privateInstantiateFilter */
+ NULL, /* privateTeardownFilter */
};
Index: libvirt-acl/src/nwfilter/nwfilter_gentech_driver.h
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_gentech_driver.h
+++ libvirt-acl/src/nwfilter/nwfilter_gentech_driver.h
@@ -23,6 +23,8 @@
#ifndef __NWFILTER_GENTECH_DRIVER_H
# define __NWFILTER_GENTECH_DRIVER_H
+# include "datatypes.h"
+
virNWFilterTechDriverPtr virNWFilterTechDriverForName(const char *name);
int virNWFilterRuleInstAddData(virNWFilterRuleInstPtr res,
@@ -37,8 +39,18 @@ enum instCase {
};
+static inline
+int virNWFilterInstNWFilter(virConnectPtr conn,
+ const virDomainNetDefPtr net)
+{
+ if ((conn) && (conn->nwfilterDriver))
+ return conn->nwfilterDriver->privateInstantiateFilter(conn, net);
+ return 0;
+}
+
int virNWFilterInstantiateFilter(virConnectPtr conn,
const virDomainNetDefPtr net);
+
int virNWFilterUpdateInstantiateFilter(virConnectPtr conn,
const virDomainNetDefPtr net,
bool *skipIface);
@@ -70,18 +82,20 @@ void virNWFilterDomainFWUpdateCB(void *p
/* tear down an interface's filter before tearing down the interface */
static inline void
-virNWFilterTearNWFilter(virDomainNetDefPtr net) {
- if ((net->filter) && (net->ifname))
- virNWFilterTeardownFilter(net);
+virNWFilterTearNWFilter(virConnectPtr conn, virDomainNetDefPtr net) {
+ if ((conn) && (conn->nwfilterDriver) && (net->filter) && (net->ifname))
+ conn->nwfilterDriver->privateTeardownFilter(net);
}
static inline void
-virNWFilterTearVMNWFilters(virDomainObjPtr vm) {
+virNWFilterTearVMNWFilters(virConnectPtr conn, virDomainObjPtr vm) {
int i;
- for (i = 0; i < vm->def->nnets; i++)
- virNWFilterTearNWFilter(vm->def->nets[i]);
+ if (conn) {
+ for (i = 0; i < vm->def->nnets; i++)
+ virNWFilterTearNWFilter(conn, vm->def->nets[i]);
+ }
}
#endif
Index: libvirt-acl/src/qemu/qemu_conf.c
===================================================================
--- libvirt-acl.orig/src/qemu/qemu_conf.c
+++ libvirt-acl/src/qemu/qemu_conf.c
@@ -1555,7 +1555,7 @@ qemudPhysIfaceConnect(virConnectPtr conn
if (rc >= 0) {
if ((net->filter) && (net->ifname)) {
- err = virNWFilterInstantiateFilter(conn, net);
+ err = virNWFilterInstNWFilter(conn, net);
if (err) {
close(rc);
rc = -1;
@@ -1688,7 +1688,7 @@ qemudNetworkIfaceConnect(virConnectPtr c
if (tapfd >= 0) {
if ((net->filter) && (net->ifname)) {
- err = virNWFilterInstantiateFilter(conn, net);
+ err = virNWFilterInstNWFilter(conn, net);
if (err) {
close(tapfd);
tapfd = -1;
@@ -4207,7 +4207,7 @@ int qemudBuildCommandLine(virConnectPtr
goto error;
if (VIR_REALLOC_N(*vmfds, (*nvmfds)+1) < 0) {
- virNWFilterTearNWFilter(net);
+ virNWFilterTearNWFilter(conn, net);
close(tapfd);
goto no_memory;
}
@@ -4226,7 +4226,7 @@ int qemudBuildCommandLine(virConnectPtr
goto error;
if (VIR_REALLOC_N(*vmfds, (*nvmfds)+1) < 0) {
- virNWFilterTearNWFilter(net);
+ virNWFilterTearNWFilter(conn, net);
close(tapfd);
goto no_memory;
}
@@ -4766,7 +4766,7 @@ int qemudBuildCommandLine(virConnectPtr
virReportOOMError();
error:
for (i = 0; i <= last_good_net; i++)
- virNWFilterTearNWFilter(def->nets[i]);
+ virNWFilterTearNWFilter(conn, def->nets[i]);
if (vmfds &&
*vmfds) {
for (i = 0; i < *nvmfds; i++)
Index: libvirt-acl/src/qemu/qemu_driver.c
===================================================================
--- libvirt-acl.orig/src/qemu/qemu_driver.c
+++ libvirt-acl/src/qemu/qemu_driver.c
@@ -158,7 +158,8 @@ static int qemudStartVMDaemon(virConnect
int stdin_fd,
const char *stdin_path);
-static void qemudShutdownVMDaemon(struct qemud_driver *driver,
+static void qemudShutdownVMDaemon(virConnectPtr conn,
+ struct qemud_driver *driver,
virDomainObjPtr vm,
int migrated);
@@ -735,7 +736,7 @@ qemuHandleMonitorEOF(qemuMonitorPtr mon
VIR_DOMAIN_EVENT_STOPPED_FAILED :
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
- qemudShutdownVMDaemon(driver, vm, 0);
+ qemudShutdownVMDaemon(NULL, driver, vm, 0);
if (!vm->persistent)
virDomainRemoveInactive(&driver->domains, vm);
else
@@ -1283,7 +1284,7 @@ error:
/* We can't get the monitor back, so must kill the VM
* to remove danger of it ending up running twice if
* user tries to start it again later */
- qemudShutdownVMDaemon(driver, obj, 0);
+ qemudShutdownVMDaemon(NULL, driver, obj, 0);
if (!obj->persistent)
virDomainRemoveInactive(&driver->domains, obj);
else
@@ -3576,7 +3577,7 @@ static int qemudStartVMDaemon(virConnect
VIR_FREE(progenv);
if (ret == -1) /* The VM failed to start; tear filters before taps */
- virNWFilterTearVMNWFilters(vm);
+ virNWFilterTearVMNWFilters(conn, vm);
if (vmfds) {
for (i = 0 ; i < nvmfds ; i++) {
@@ -3642,7 +3643,7 @@ cleanup:
/* We jump here if we failed to start the VM for any reason, or
* if we failed to initialize the now running VM. kill it off and
* pretend we never started it */
- qemudShutdownVMDaemon(driver, vm, 0);
+ qemudShutdownVMDaemon(conn, driver, vm, 0);
if (logfile != -1)
close(logfile);
@@ -3651,7 +3652,8 @@ cleanup:
}
-static void qemudShutdownVMDaemon(struct qemud_driver *driver,
+static void qemudShutdownVMDaemon(virConnectPtr conn,
+ struct qemud_driver *driver,
virDomainObjPtr vm,
int migrated) {
int ret;
@@ -3668,7 +3670,7 @@ static void qemudShutdownVMDaemon(struct
* reporting so we don't squash a legit error. */
orig_err = virSaveLastError();
- virNWFilterTearVMNWFilters(vm);
+ virNWFilterTearVMNWFilters(conn, vm);
if (driver->macFilter) {
def = vm->def;
@@ -4465,7 +4467,7 @@ static int qemudDomainDestroy(virDomainP
goto endjob;
}
- qemudShutdownVMDaemon(driver, vm, 0);
+ qemudShutdownVMDaemon(dom->conn, driver, vm, 0);
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
@@ -5211,7 +5213,7 @@ static int qemudDomainSaveFlag(virDomain
ret = 0;
/* Shut it down */
- qemudShutdownVMDaemon(driver, vm, 0);
+ qemudShutdownVMDaemon(dom->conn, driver, vm, 0);
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_SAVED);
@@ -5528,7 +5530,7 @@ static int qemudDomainCoreDump(virDomain
endjob:
if ((ret == 0) && (flags & VIR_DUMP_CRASH)) {
- qemudShutdownVMDaemon(driver, vm, 0);
+ qemudShutdownVMDaemon(dom->conn, driver, vm, 0);
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_CRASHED);
@@ -7640,7 +7642,7 @@ cleanup:
VIR_WARN0("Unable to release PCI address on NIC");
if (ret != 0)
- virNWFilterTearNWFilter(net);
+ virNWFilterTearNWFilter(conn, net);
VIR_FREE(nicstr);
VIR_FREE(netstr);
@@ -8534,7 +8536,8 @@ cleanup:
}
static int
-qemudDomainDetachNetDevice(struct qemud_driver *driver,
+qemudDomainDetachNetDevice(virConnectPtr conn,
+ struct qemud_driver *driver,
virDomainObjPtr vm,
virDomainDeviceDefPtr dev,
unsigned long long qemuCmdFlags)
@@ -8609,7 +8612,7 @@ qemudDomainDetachNetDevice(struct qemud_
}
qemuDomainObjExitMonitorWithDriver(driver, vm);
- virNWFilterTearNWFilter(detach);
+ virNWFilterTearNWFilter(conn, detach);
#if WITH_MACVTAP
if (detach->type == VIR_DOMAIN_NET_TYPE_DIRECT) {
@@ -8921,7 +8924,8 @@ static int qemudDomainDetachDevice(virDo
_("This type of disk cannot be hot
unplugged"));
}
} else if (dev->type == VIR_DOMAIN_DEVICE_NET) {
- ret = qemudDomainDetachNetDevice(driver, vm, dev, qemuCmdFlags);
+ ret = qemudDomainDetachNetDevice(dom->conn, driver, vm, dev,
+ qemuCmdFlags);
} else if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER) {
if (dev->data.controller->type ==
VIR_DOMAIN_CONTROLLER_TYPE_SCSI) {
ret = qemudDomainDetachPciControllerDevice(driver, vm, dev,
@@ -10215,7 +10219,7 @@ qemudDomainMigratePrepareTunnel(virConne
qemust = qemuStreamMigOpen(st, unixfile);
if (qemust == NULL) {
- qemudShutdownVMDaemon(driver, vm, 0);
+ qemudShutdownVMDaemon(dconn, driver, vm, 0);
if (!vm->persistent) {
if (qemuDomainObjEndJob(vm) > 0)
virDomainRemoveInactive(&driver->domains, vm);
@@ -10940,7 +10944,7 @@ qemudDomainMigratePerform (virDomainPtr
}
/* Clean up the source domain. */
- qemudShutdownVMDaemon(driver, vm, 1);
+ qemudShutdownVMDaemon(dom->conn, driver, vm, 1);
resume = 0;
event = virDomainEventNewFromObj(vm,
@@ -11100,7 +11104,7 @@ qemudDomainMigrateFinish2 (virConnectPtr
goto endjob;
}
} else {
- qemudShutdownVMDaemon(driver, vm, 0);
+ qemudShutdownVMDaemon(dconn, driver, vm, 0);
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_FAILED);
@@ -11946,7 +11950,7 @@ static int qemuDomainRevertToSnapshot(vi
*/
if (virDomainObjIsActive(vm)) {
- qemudShutdownVMDaemon(driver, vm, 0);
+ qemudShutdownVMDaemon(snapshot->domain->conn, driver, vm, 0);
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
Index: libvirt-acl/src/driver.h
===================================================================
--- libvirt-acl.orig/src/driver.h
+++ libvirt-acl/src/driver.h
@@ -1098,6 +1098,14 @@ typedef char *
(*virDrvNWFilterGetXMLDesc) (virNWFilterPtr pool,
unsigned int flags);
+# include "conf/domain_conf.h"
+
+typedef int
+ (*virDrvNWFilterInstantiateFilter) (virConnectPtr conn,
+ const virDomainNetDefPtr
net);
+
+typedef void
+ (*virDrvNWFilterTeardownFilter) (virDomainNetDefPtr net);
typedef struct _virNWFilterDriver virNWFilterDriver;
typedef virNWFilterDriver *virNWFilterDriverPtr;
@@ -1124,6 +1132,8 @@ struct _virNWFilterDriver {
virDrvNWFilterDefineXML defineXML;
virDrvNWFilterUndefine undefine;
virDrvNWFilterGetXMLDesc getXMLDesc;
+ virDrvNWFilterInstantiateFilter privateInstantiateFilter;
+ virDrvNWFilterTeardownFilter privateTeardownFilter;
};
14 years, 5 months
[libvirt] [PATCH] Fix enumeration of partitions in disks with a trailing digit in path
by Daniel P. Berrange
Disks with a trailing digit in their path (eg /dev/loop0 or
/dev/dm0) have an extra 'p' appended before the partition
number (eg, to form /dev/loop0p1 not /dev/loop01). Fix the
partition lookup to append this extra 'p' when required
* src/storage/parthelper.c: Add a 'p' before partition
number if required
---
src/storage/parthelper.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/storage/parthelper.c b/src/storage/parthelper.c
index 5626cd2..28d88c9 100644
--- a/src/storage/parthelper.c
+++ b/src/storage/parthelper.c
@@ -36,6 +36,8 @@
#include <stdio.h>
#include <string.h>
+#include "c-ctype.h"
+
/* we don't need to include the full internal.h just for this */
#define STREQ(a,b) (strcmp(a,b) == 0)
@@ -56,6 +58,8 @@ int main(int argc, char **argv)
PedDisk *disk;
PedPartition *part;
int cmd = DISK_LAYOUT;
+ const char *path;
+ const char *partsep;
if (argc == 3 && STREQ(argv[2], "-g")) {
cmd = DISK_GEOMETRY;
@@ -64,8 +68,11 @@ int main(int argc, char **argv)
return 1;
}
- if ((dev = ped_device_get(argv[1])) == NULL) {
- fprintf(stderr, "unable to access device %s\n", argv[1]);
+ path = argv[1];
+ partsep = c_isdigit(path[strlen(path)-1]) ? "p" : "";
+
+ if ((dev = ped_device_get(path)) == NULL) {
+ fprintf(stderr, "unable to access device %s\n", path);
return 2;
}
@@ -117,8 +124,8 @@ int main(int argc, char **argv)
* in bytes, not the last sector number
*/
if (part->num != -1) {
- printf("%s%d%c%s%c%s%c%llu%c%llu%c%llu%c",
- part->geom.dev->path,
+ printf("%s%s%d%c%s%c%s%c%llu%c%llu%c%llu%c",
+ path, partsep,
part->num, '\0',
type, '\0',
content, '\0',
--
1.6.5.2
14 years, 5 months
[libvirt] Error-message when creating virtual mashin
by Sebastian Andres
Hello.
When I creating virtual Mashines with virt-install (Version 0.500.3-1)
with following options:
# virt-install --serial pty --hvm --virt-type kvm -l
http://ftp.de.debian.org/debian/dists/lenny/main/installer-i386/ -x
console=ttyS0,9600 -w
bridge=virt0,mac=52:54:00:12:34:29,model=virtio -k=de --nographics
--prompt --disk=test.img,bus=virtio
I get the following error messages:
Creating domain... 0 B
00:00
error: Unable to get domain status
error: operation failed: could not query memory balloon allocation
Domain installation does not appear to have been
successful. If it was, you can restart your domain
by running 'virsh start test'; otherwise, please
restart your installation.
I have 4 gb Ram and 2 gb free.
I am using libvirt-bin 0.8.1-2 and run all Commands as root.
Can anywhere help?
Best regards
Sebastian
--
Sebastian Andres mail: <sebastian(a)sebastianandres.de>
Olbersstr. 33, 10589 Berlin google maps: http://tinyurl.com/6z3f3
home:+49-30-3010.7852 www: http://www.sebastianandres.de
cell:+49-170-3224.773 pgp: http://www.sebastianandres.de/key.txt
14 years, 5 months
[libvirt] About cgroup mechanism using in libvirt
by Alex Jia
Hey Daniel,
The cgroup mechanism have been integrated into libvirt for LXC and QEMU driver,
and the LXC driver uses all of cgroup controllers except for net_cls and cpuset,
while the QEMU driver only uses the cpu and devices controllers at present.
>From the user point of view, user can use some virsh commands to control some
guest resources:
1. Using 'virsh schedinfo' command to get/set CPU scheduler priority for a guest
2. Using 'virsh vcpuin' command to control guest vcpu affinity
3. Using 'virsh setmem' command to change memory allocation
4. Using 'virsh setmaxmem' command to change maximum memory limit
5. Using 'virsh setvcpus' command to change number of virtual CPUs
I just make sure the above 1 using CPU scheduler controller, maybe 4 using Memory
controller? and maybe 5 using CPU set controller? I am not sure.
And I wonder how to control devices access via virsh command or libvirt binding API
such as python binding? in addition, for CPU accounting and Freezer controller,
how to use them to control guest resource from libvirt application layer? and how
to check setting result is valid such as cpuacct? these issues let me confuse at recent.
Any comments and suggestions are welcomed, thanks for your help.
Best Regards,
Alex
14 years, 5 months
Re: [libvirt] Virtual disk size associated with a Domain
by IKI-サガル バルウェ
Thanks Daniel,
> In 0.8.1 we added a virDomainGetBlockInfo API that will give you this
> data directly.
I am currently using libvirt 0.6.3. Is there a way to do it in this version.
If it is not at all possible in 0.6.3, and only possible from 0.8.1 onwards,
then I will upgrade to 0.8.1. Because for the version upgrade, I will have
to clearly explain to my client the reason why we need to upgrade.
So, If I can fetch the same info as "virDomainGetBlockInfo" in 0.6.3 in some
other way, that would be just awesome. Or if I can calculate the disk size
from any other parameters, then please guide me on that also.
Please help.
Thanks and Regards
Sagar Barve
----- Original Message -----
From: "Daniel P. Berrange" <berrange(a)redhat.com>
To: "IKI-サガル バルウェ" <sagar.barve(a)ikic.co.jp>
Cc: <libvir-list(a)redhat.com>
Sent: Friday, June 11, 2010 6:43 PM
Subject: Re: [libvirt] Virtual disk size associated with a Domain
> On Fri, Jun 11, 2010 at 06:09:19PM +0900, IKI-サガル バルウェ wrote:
>> Hello,
>>
>> Is there any way to fetch the size of all the virtual disks associated
>> with
>> a Domain??
>>
>> I could not find one in the libvirt API., I tried using 'virStorageVol'
>> and
>> 'virStoragePool', but they returned null objects.
>> Also I fetched 'virDomainBlockStats', but did not understand the
>> information
>> returned. i.e. 'rd_bytes' and 'wr_bytes'. Can we use this info for
>> calculating the disk sizes?
>
> In 0.8.1 we added a virDomainGetBlockInfo API that will give you this
> data directly.
>
>> Also, What does the size of the "img" file for a Domain represent? Is it
>> the
>> disc size?
>
> virDomainGetBlockInfo gives both several sizes - see the header file
> comments for a description of what each means.
>
>
> Daniel
> --
> |: Red Hat, Engineering, London -o-
> http://people.redhat.com/berrange/ :|
> |: http://libvirt.org -o- http://virt-manager.org -o-
> http://deltacloud.org :|
> |: http://autobuild.org -o-
> http://search.cpan.org/~danberr/ :|
> |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B
> 9505 :|
14 years, 5 months