[libvirt] [PATCHv2 0/8] virCommand: next round
by Eric Blake
This should address some of the review comments from the first round
(https://www.redhat.com/archives/libvir-list/2010-November/msg00803.html).
Daniel P. Berrange (5):
Introduce new APIs for spawning processes
virCommand: docs for usage of new command APIs
Port hooks and iptables code to new command execution APIs
uml: convert to virCommand
Remove bogus includes
Eric Blake (3):
util: add virVasprintf
util: fix saferead type
qemu: convert to virCommand
.x-sc_avoid_write | 1 +
.x-sc_prohibit_asprintf | 4 +-
cfg.mk | 3 +-
docs/Makefile.am | 11 +-
docs/internals.html.in | 9 +
docs/internals/command.html.in | 550 +++++++++++++++++++
docs/sitemap.html.in | 4 +
docs/subsite.xsl | 25 +
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/conf/domain_conf.c | 1 -
src/libvirt_private.syms | 36 ++
src/qemu/qemu_conf.c | 710 ++++++++++---------------
src/qemu/qemu_conf.h | 10 +-
src/qemu/qemu_driver.c | 190 ++------
src/uml/uml_conf.c | 163 ++-----
src/uml/uml_conf.h | 10 +-
src/uml/uml_driver.c | 68 +--
src/util/command.c | 1138 ++++++++++++++++++++++++++++++++++++++++
src/util/command.h | 260 +++++++++
src/util/hooks.c | 217 +--------
src/util/iptables.c | 73 +---
src/util/util.c | 85 ++--
src/util/util.h | 8 +-
src/util/virtaudit.c | 2 +-
tests/.gitignore | 4 +
tests/Makefile.am | 18 +-
tests/commanddata/test10.log | 14 +
tests/commanddata/test11.log | 14 +
tests/commanddata/test12.log | 12 +
tests/commanddata/test13.log | 12 +
tests/commanddata/test14.log | 12 +
tests/commanddata/test15.log | 12 +
tests/commanddata/test16.log | 1 +
tests/commanddata/test2.log | 12 +
tests/commanddata/test3.log | 14 +
tests/commanddata/test4.log | 12 +
tests/commanddata/test5.log | 10 +
tests/commanddata/test6.log | 6 +
tests/commanddata/test7.log | 11 +
tests/commanddata/test8.log | 7 +
tests/commanddata/test9.log | 18 +
tests/commandhelper.c | 137 +++++
tests/commandtest.c | 630 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 68 +--
45 files changed, 3461 insertions(+), 1143 deletions(-)
create mode 100644 docs/internals/command.html.in
create mode 100644 docs/subsite.xsl
create mode 100644 src/util/command.c
create mode 100644 src/util/command.h
create mode 100644 tests/commanddata/test10.log
create mode 100644 tests/commanddata/test11.log
create mode 100644 tests/commanddata/test12.log
create mode 100644 tests/commanddata/test13.log
create mode 100644 tests/commanddata/test14.log
create mode 100644 tests/commanddata/test15.log
create mode 100644 tests/commanddata/test16.log
create mode 100644 tests/commanddata/test2.log
create mode 100644 tests/commanddata/test3.log
create mode 100644 tests/commanddata/test4.log
create mode 100644 tests/commanddata/test5.log
create mode 100644 tests/commanddata/test6.log
create mode 100644 tests/commanddata/test7.log
create mode 100644 tests/commanddata/test8.log
create mode 100644 tests/commanddata/test9.log
create mode 100644 tests/commandhelper.c
create mode 100644 tests/commandtest.c
--
1.7.3.2
13 years, 11 months
[libvirt] GNU awk vs BSD awk?
by Justin Clift
Hi Eric,
One of the OSX Homebrew guys, CC'd, has asked (casually) whether our dependency on GNU awk is very deeply ingrained, or if we could be convinced to allow usage of other make's instead (ie BSD).
Figured I'd ask you directly, as you'd probably best know whether it's an easy thing to address or not?
Any idea?
Regards and best wishes,
Justin Clift
13 years, 11 months
[libvirt] [PATCH v3 0/5] Support of auto-dump on watchdog event in libvirtd
by Hu Tao
This patch series adds a new watchdog action `dump' which lets libvirtd
can do auto-dump when receiving a watchdog event from qemu guest.
In order to make the function work, there must be a watchdog device
added to guest, and guest must have a watchdog daemon running, for
example, /etc/init.d/watchdog start or auto-started on boot.
Changes from v2:
- let default auto-dump dir be /var/lib/libvirt/qemu/dump
Hu Tao (5):
Add a threadpool implementation
Fall back to QEMUD_SAVE_FORMAT_RAW if compression method fails.
Add a new function doCoreDump
Add a watchdog action `dump'
Add me to AUTHORS to make `make syntax-check' happy
AUTHORS | 1 +
src/Makefile.am | 3 +-
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/qemu/qemu.conf | 5 +
src/qemu/qemu_conf.c | 13 +++-
src/qemu/qemu_conf.h | 4 +
src/qemu/qemu_driver.c | 235 ++++++++++++++++++++++++++++++++++--------------
src/util/threadpool.c | 140 ++++++++++++++++++++++++++++
src/util/threadpool.h | 35 +++++++
10 files changed, 367 insertions(+), 71 deletions(-)
create mode 100644 src/util/threadpool.c
create mode 100644 src/util/threadpool.h
--
1.7.3
--
Thanks,
Hu Tao
13 years, 11 months
[libvirt] [PATCH 0/2] Add tests for CPU selection in qemu driver
by Jiri Denemark
Some more CPU tests that can make use of recently introduced cpuMapOverride().
Jiri Denemark (2):
tests: Support for faking emulator in qemuxml2argv
tests: Add tests for CPU selection in qemu driver
tests/qemuxml2argvdata/qemu.sh | 64 ++++++++++++++++++++
.../qemuxml2argvdata/qemuxml2argv-cpu-exact1.args | 1 +
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml | 28 +++++++++
.../qemuxml2argvdata/qemuxml2argv-cpu-exact2.args | 1 +
tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml | 35 +++++++++++
.../qemuxml2argv-cpu-minimum1.args | 1 +
.../qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml | 21 +++++++
.../qemuxml2argv-cpu-minimum2.args | 1 +
.../qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml | 25 ++++++++
.../qemuxml2argvdata/qemuxml2argv-cpu-strict1.args | 1 +
.../qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml | 38 ++++++++++++
.../qemuxml2argv-cpu-topology1.args | 1 +
.../qemuxml2argv-cpu-topology1.xml | 21 +++++++
.../qemuxml2argv-cpu-topology2.args | 1 +
.../qemuxml2argv-cpu-topology2.xml | 22 +++++++
.../qemuxml2argv-cpu-topology3.args | 1 +
.../qemuxml2argv-cpu-topology3.xml | 21 +++++++
tests/qemuxml2argvtest.c | 38 ++++++++++++
18 files changed, 321 insertions(+), 0 deletions(-)
create mode 100755 tests/qemuxml2argvdata/qemu.sh
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-exact1.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-exact2.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum1.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-minimum2.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-strict1.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-topology1.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-topology2.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-topology3.xml
--
1.7.3.2
13 years, 11 months
[libvirt] [PATCH] schemas: Fix cpu element schema
by Jiri Denemark
Both vendor and topology elements are optional.
---
docs/schemas/domain.rng | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index fb44335..08ebefb 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -1745,6 +1745,8 @@
<ref name="cpuModel"/>
<optional>
<ref name="cpuVendor"/>
+ </optional>
+ <optional>
<ref name="cpuTopology"/>
</optional>
<zeroOrMore>
--
1.7.3.2
13 years, 11 months
[libvirt] [PATCH] virsh: Remove using phy as default disk driver in cmdAttachDisk
by Osier Yang
* tools/virsh.c (virsh shouldn't use 'phy' as the disk driver if
user doesn't specify "--driver", it causes bugs, as not all of
hypervisor driver supports 'phy', and actually hypervisor should
known the correct default disk driver and subdriver, so remove it)
---
tools/virsh.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 6a9aba2..5b5c5ee 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -8668,11 +8668,16 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
virBufferVSprintf(&buf, " device='%s'", type);
virBufferAddLit(&buf, ">\n");
- virBufferVSprintf(&buf, " <driver name='%s'",
- (driver) ? driver : "phy");
+ if (driver || subdriver)
+ virBufferVSprintf(&buf, " <driver ");
+
+ if (driver)
+ virBufferVSprintf(&buf, " name='%s'", driver);
if (subdriver)
virBufferVSprintf(&buf, " type='%s'", subdriver);
- virBufferAddLit(&buf, "/>\n");
+
+ if (driver || subdriver)
+ virBufferAddLit(&buf, "/>\n");
virBufferVSprintf(&buf, " <source %s='%s'/>\n",
(isFile) ? "file" : "dev",
--
1.7.3.2
13 years, 11 months
[libvirt] [PATCH v4 0/7] Support of auto-dump on watchdog event in libvirtd
by Hu Tao
This patch series adds a new watchdog action `dump' which lets libvirtd
can do auto-dump when receiving a watchdog event from qemu guest.
In order to make the function work, there must be a watchdog device
added to guest, and guest must have a watchdog daemon running, for
example, /etc/init.d/watchdog start or auto-started on boot.
Changes:
v4:
- getCompressionType returns type of enum qemud_save_formats rather
than int
- use virThread api in thread pool
- fix an error that qemuDomainObjBeginJobWithDriver() get lost in
qemuDomainCoreDump()
v3:
- let default auto-dump dir be /var/lib/libvirt/qemu/dump
Hu Tao (7):
bug: local var referenced in another thread
Add a threadpool implementation
Fall back to QEMUD_SAVE_FORMAT_RAW if compression method fails.
Add a new function doCoreDump
Add a watchdog action `dump'
Using threadpool API to manage qemud worker
Add me to AUTHORS to make `make syntax-check' happy
AUTHORS | 1 +
cfg.mk | 3 +-
daemon/libvirtd.c | 168 +++++------------------------
daemon/libvirtd.h | 4 +
po/af.po | 14 ++--
po/am.po | 14 ++--
po/ar.po | 14 ++--
po/as.po | 14 ++--
po/be.po | 14 ++--
po/bg.po | 18 ++--
po/bn.po | 14 ++--
po/bn_IN.po | 18 ++--
po/bs.po | 14 ++--
po/ca.po | 42 ++++----
po/cs.po | 14 ++--
po/cy.po | 14 ++--
po/da.po | 14 ++--
po/de.po | 22 ++--
po/el.po | 22 ++--
po/en_GB.po | 14 ++--
po/es.po | 54 +++++-----
po/et.po | 14 ++--
po/eu_ES.po | 14 ++--
po/fa.po | 14 ++--
po/fi.po | 14 ++--
po/fr.po | 94 ++++++++--------
po/gl.po | 14 ++--
po/gu.po | 14 ++--
po/he.po | 14 ++--
po/hi.po | 14 ++--
po/hr.po | 18 ++--
po/hu.po | 14 ++--
po/hy.po | 14 ++--
po/id.po | 14 ++--
po/is.po | 14 ++--
po/it.po | 54 +++++-----
po/ja.po | 18 ++--
po/ka.po | 14 ++--
po/kn.po | 14 ++--
po/ko.po | 14 ++--
po/ku.po | 14 ++--
src/Makefile.am | 3 +-
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 1 +
src/qemu/qemu.conf | 5 +
src/qemu/qemu_conf.c | 16 +++-
src/qemu/qemu_conf.h | 5 +
src/qemu/qemu_driver.c | 259 ++++++++++++++++++++++++++++++++------------
src/util/threadpool.c | 175 ++++++++++++++++++++++++++++++
src/util/threadpool.h | 62 +++++++++++
src/util/threads-pthread.c | 13 ++-
51 files changed, 868 insertions(+), 586 deletions(-)
create mode 100644 src/util/threadpool.c
create mode 100644 src/util/threadpool.h
--
1.7.3
--
Thanks,
Hu Tao
13 years, 11 months
[libvirt] [PATCH] maint: update .gitignore
by Eric Blake
* .gitignore: Ignore recent built file, sort.
---
Pushing under the trivial rule. Noticed after a clean bootstrap.
.gitignore | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/.gitignore b/.gitignore
index 12ae5e3..5518d2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,10 +50,12 @@
/po/
/proxy/
/tests/*.log
+/tests/cputest
/tests/nwfilterxml2xmltest
/update.log
Makefile
Makefile.in
+TAGS
coverage
cscope.files
cscope.out
@@ -61,4 +63,3 @@ results.log
stamp-h
stamp-h.in
stamp-h1
-TAGS
--
1.7.1
13 years, 11 months
[libvirt] [PATCH] OpenVZ: drop fd leakage
by Guido Günther
Drop unused (and unclosed) errfd and close outfd on exit. Otherwise
polling the running domains with virt-manager let's us quickly run out
of fds. O.k. to apply?
Cheers,
-- Guido
13 years, 11 months
[libvirt] [PATCH] qemu: Use macro for max and min vnc port instead of number
by Osier Yang
* src/qemu/qemu_driver.c (though MACROS QEMU_VNC_PORT_MAX, and
QEMU_VNC_PORT_MIN are defined at the beginning, numbers (65535, 5900)
are still used, replace them)
---
src/qemu/qemu_driver.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fcb90a3..f733482 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2964,7 +2964,7 @@ static int qemudNextFreePort(struct qemud_driver *driver,
int startPort) {
int i;
- for (i = startPort ; i < 65535 ; i++) {
+ for (i = startPort ; i < QEMU_VNC_PORT_MAX; i++) {
int fd;
int reuse = 1;
struct sockaddr_in addr;
@@ -3939,7 +3939,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
if (vm->def->ngraphics == 1) {
if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
vm->def->graphics[0]->data.vnc.autoport) {
- int port = qemudNextFreePort(driver, 5900);
+ int port = qemudNextFreePort(driver, QEMU_VNC_PORT_MIN);
if (port < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused VNC port"));
@@ -3948,7 +3948,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
vm->def->graphics[0]->data.vnc.port = port;
} else if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
vm->def->graphics[0]->data.spice.autoport) {
- int port = qemudNextFreePort(driver, 5900);
+ int port = qemudNextFreePort(driver, QEMU_VNC_PORT_MIN);
int tlsPort = -1;
if (port < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
@@ -7380,7 +7380,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
for (i = 0 ; i < def->ngraphics ; i++) {
if (def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
def->graphics[i]->data.vnc.autoport)
- def->graphics[i]->data.vnc.port = 5900;
+ def->graphics[i]->data.vnc.port = QEMU_VNC_PORT_MIN;
}
emulator = def->emulator;
--
1.7.3.2
13 years, 11 months