[libvirt] [PATCH] configure: Remove check for pkcheck_supports_uid
by Guido Günther
We're using Polkit's DBus API so no need to check wether this feature is
supported. We don't use the result or the path to the pkcheck program
anywhere.
---
configure.ac | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index abf4436..073624b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1362,15 +1362,6 @@ if test "x$with_polkit" = "xyes" || test "x$with_polkit" = "xcheck"; then
dnl Check for new polkit first - just a binary
AC_PATH_PROG([PKCHECK_PATH],[pkcheck], [], [/usr/sbin:$PATH])
if test "x$PKCHECK_PATH" != "x" ; then
- AC_DEFINE_UNQUOTED([PKCHECK_PATH],["$PKCHECK_PATH"],[Location of pkcheck program])
- AC_MSG_CHECKING([whether pkcheck supports uid value])
- pkcheck_supports_uid=`$PKG_CONFIG --variable pkcheck_supports_uid polkit-gobject-1`
- if test "x$pkcheck_supports_uid" = "xtrue"; then
- AC_MSG_RESULT([yes])
- AC_DEFINE_UNQUOTED([PKCHECK_SUPPORTS_UID], 1, [Pass uid to pkcheck])
- else
- AC_MSG_RESULT([no])
- fi
AC_DEFINE_UNQUOTED([WITH_POLKIT], 1,
[use PolicyKit for UNIX socket access checks])
AC_DEFINE_UNQUOTED([WITH_POLKIT1], 1,
--
2.1.4
9 years, 7 months
[libvirt] [PATCH] conf: Fix virDomainObjGetDefs when getting persistent config on a live vm
by Peter Krempa
If @flags contains only VIR_DOMAIN_AFFECT_CONFIG and @vm is active, the
function would return the active config rather than the persistent one
that it should return. This happened due to the fact that
virDomainObjGetDefs was checking the updated flags which may not contain
VIR_DOMAIN_AFFECT_LIVE if it is not requested even if @vm is active.
The mistake was caught by the virt-test suite.
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2e79610..fd38c5d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2933,7 +2933,7 @@ virDomainObjGetDefs(virDomainObjPtr vm,
if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
return -1;
- if (flags & VIR_DOMAIN_AFFECT_LIVE) {
+ if (virDomainObjIsActive(vm)) {
if (liveDef)
*liveDef = vm->def;
--
2.4.1
9 years, 7 months
[libvirt] [glib PATCH] domain config: add API to set the filesystem image format
by Cédric Bosdonnat
Add the gvir_config_domain_filesys_set_driver_format function to allow
setting nbd driver type + image format for containers filesystems.
---
libvirt-gconfig/libvirt-gconfig-domain-filesys.c | 30 +++++++++++++++++++++++-
libvirt-gconfig/libvirt-gconfig-domain-filesys.h | 4 ++++
libvirt-gconfig/libvirt-gconfig.sym | 5 ++++
3 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-filesys.c b/libvirt-gconfig/libvirt-gconfig-domain-filesys.c
index 006a407..fffbe88 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-filesys.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-filesys.c
@@ -125,7 +125,9 @@ void gvir_config_domain_filesys_set_driver_type(GVirConfigDomainFilesys *filesys
GVirConfigObject *node;
g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_FILESYS(filesys));
- node = gvir_config_object_add_child(GVIR_CONFIG_OBJECT(filesys), "driver");
+ if (!(node = gvir_config_object_get_child(GVIR_CONFIG_OBJECT(filesys), "driver"))) {
+ node = gvir_config_object_add_child(GVIR_CONFIG_OBJECT(filesys), "driver");
+ }
g_return_if_fail(GVIR_CONFIG_IS_OBJECT(node));
if (type != GVIR_CONFIG_DOMAIN_FILESYS_DRIVER_DEFAULT)
gvir_config_object_set_attribute_with_type(
@@ -137,6 +139,32 @@ void gvir_config_domain_filesys_set_driver_type(GVirConfigDomainFilesys *filesys
g_object_unref(G_OBJECT(node));
}
+void gvir_config_domain_filesys_set_driver_format(GVirConfigDomainFilesys *filesys,
+ GVirConfigDomainDiskFormat format)
+{
+ GVirConfigObject *node;
+ GVirConfigDomainFilesysDriverType type = GVIR_CONFIG_DOMAIN_FILESYS_DRIVER_LOOP;
+
+ g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_FILESYS(filesys));
+ if (!(node = gvir_config_object_get_child(GVIR_CONFIG_OBJECT(filesys), "driver"))) {
+ node = gvir_config_object_add_child(GVIR_CONFIG_OBJECT(filesys), "driver");
+ }
+ g_return_if_fail(GVIR_CONFIG_IS_OBJECT(node));
+ if (format != GVIR_CONFIG_DOMAIN_DISK_FORMAT_RAW)
+ type = GVIR_CONFIG_DOMAIN_FILESYS_DRIVER_NBD;
+
+ gvir_config_object_set_attribute_with_type(
+ node, "type",
+ GVIR_CONFIG_TYPE_DOMAIN_FILESYS_DRIVER_TYPE,
+ type, NULL);
+
+ gvir_config_object_set_attribute_with_type(
+ node, "format",
+ GVIR_CONFIG_TYPE_DOMAIN_DISK_FORMAT,
+ format, NULL);
+ g_object_unref(G_OBJECT(node));
+}
+
void gvir_config_domain_filesys_set_source(GVirConfigDomainFilesys *filesys,
const char *source)
{
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-filesys.h b/libvirt-gconfig/libvirt-gconfig-domain-filesys.h
index 4f3973e..18c4069 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-filesys.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-filesys.h
@@ -75,6 +75,8 @@ typedef enum {
GVIR_CONFIG_DOMAIN_FILESYS_DRIVER_DEFAULT,
GVIR_CONFIG_DOMAIN_FILESYS_DRIVER_PATH,
GVIR_CONFIG_DOMAIN_FILESYS_DRIVER_HANDLE,
+ GVIR_CONFIG_DOMAIN_FILESYS_DRIVER_LOOP,
+ GVIR_CONFIG_DOMAIN_FILESYS_DRIVER_NBD,
} GVirConfigDomainFilesysDriverType;
GType gvir_config_domain_filesys_get_type(void);
@@ -89,6 +91,8 @@ void gvir_config_domain_filesys_set_access_type(GVirConfigDomainFilesys *filesys
GVirConfigDomainFilesysAccessType type);
void gvir_config_domain_filesys_set_driver_type(GVirConfigDomainFilesys *filesys,
GVirConfigDomainFilesysDriverType type);
+void gvir_config_domain_filesys_set_driver_format(GVirConfigDomainFilesys *filesys,
+ GVirConfigDomainDiskFormat format);
void gvir_config_domain_filesys_set_source(GVirConfigDomainFilesys *filesys,
const char *source);
void gvir_config_domain_filesys_set_ram_usage(GVirConfigDomainFilesys *filesys,
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 407a52f..6ce1511 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -719,4 +719,9 @@ global:
gvir_config_storage_vol_target_set_compat;
} LIBVIRT_GCONFIG_0.1.9;
+LIBVIRT_GCONFIG_0.2.1 {
+global:
+ gvir_config_domain_filesys_set_driver_format;
+} LIBVIRT_GCONFIG_0.2.0;
+
# .... define new API here using predicted next version number ....
--
2.1.4
9 years, 7 months
[libvirt] [PATCH] add more domain memory functions
by Vasiliy Tolstov
* libvirt_domain_set_max_memory
* libvirt_domain_set_memory
* libvirt_domain_set_memory_flags
Signed-off-by: Vasiliy Tolstov <v.tolstov(a)selfip.ru>
---
src/libvirt-php.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/libvirt-php.h | 3 +++
2 files changed, 77 insertions(+), 1 deletion(-)
diff --git a/src/libvirt-php.c b/src/libvirt-php.c
index 0adc4be..b2ace23 100644
--- a/src/libvirt-php.c
+++ b/src/libvirt-php.c
@@ -1361,6 +1361,11 @@ PHP_MINIT_FUNCTION(libvirt)
REGISTER_LONG_CONSTANT("VIR_DOMAIN_AFFECT_LIVE", 1, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("VIR_DOMAIN_AFFECT_CONFIG", 2, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("VIR_DOMAIN_MEM_CONFIG", VIR_DOMAIN_MEM_CONFIG, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("VIR_DOMAIN_MEM_CURRENT", VIR_DOMAIN_MEM_CURRENT, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("VIR_DOMAIN_MEM_LIVE", VIR_DOMAIN_MEM_LIVE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("VIR_DOMAIN_MEM_MAXIMUM", VIR_DOMAIN_MEM_MAXIMUM, CONST_CS | CONST_PERSISTENT);
+
/* Connect flags */
REGISTER_LONG_CONSTANT("VIR_CONNECT_FLAG_SOUNDHW_GET_NAMES", CONNECT_FLAG_SOUNDHW_GET_NAMES, CONST_CS | CONST_PERSISTENT);
@@ -3286,6 +3291,75 @@ PHP_FUNCTION(libvirt_domain_is_persistent)
}
/*
+ Function name: libvirt_domain_set_max_memory
+ Since version: 0.5.1
+ Description: Function to set max memory for domain
+ Arguments: @res [resource]: libvirt domain resource
+ @memory [int]: memory size in 1024 bytes (Kb)
+ Returns: TRUE for success, FALSE for failure
+*/
+PHP_FUNCTION(libvirt_domain_set_max_memory)
+{
+ php_libvirt_domain *domain = NULL;
+ zval *zdomain;
+ long memory = 0;
+
+ GET_DOMAIN_FROM_ARGS ("rl", &zdomain, &memory);
+
+ if (virDomainSetMaxMemory(domain->domain, memory) != 0)
+ RETURN_FALSE;
+
+ RETURN_TRUE;
+}
+
+/*
+ Function name: libvirt_domain_set_memory
+ Since version: 0.5.1
+ Description: Function to set memory for domain
+ Arguments: @res [resource]: libvirt domain resource
+ @memory [int]: memory size in 1024 bytes (Kb)
+ Returns: TRUE for success, FALSE for failure
+*/
+PHP_FUNCTION(libvirt_domain_set_memory)
+{
+ php_libvirt_domain *domain = NULL;
+ zval *zdomain;
+ long memory = 0;
+
+ GET_DOMAIN_FROM_ARGS ("rl", &zdomain, &memory);
+
+ if (virDomainSetMemory(domain->domain, memory) != 0)
+ RETURN_FALSE;
+
+ RETURN_TRUE;
+}
+
+/*
+ Function name: libvirt_domain_set_memory_flags
+ Since version: 0.5.1
+ Description: Function to set max memory for domain
+ Arguments: @res [resource]: libvirt domain resource
+ @memory [int]: memory size in 1024 bytes (Kb)
+ @flags [int]: bitwise-OR VIR_DOMAIN_MEM_* flags
+ Returns: TRUE for success, FALSE for failure
+*/
+PHP_FUNCTION(libvirt_domain_set_memory_flags)
+{
+ php_libvirt_domain *domain = NULL;
+ zval *zdomain;
+ long memory = 0;
+ long flags = 0;
+
+ GET_DOMAIN_FROM_ARGS ("rl|l", &zdomain, &memory, &flags);
+
+ if (virDomainSetMemoryFlags(domain->domain, memory, flags) != 0)
+ RETURN_FALSE;
+
+ RETURN_TRUE;
+}
+
+
+/*
Function name: libvirt_domain_get_autostart
Since version: 0.4.1(-1)
Description: Function is getting the autostart value for the domain
@@ -8863,4 +8937,3 @@ PHP_FUNCTION(libvirt_logfile_set)
RETURN_TRUE;
}
#endif
-
diff --git a/src/libvirt-php.h b/src/libvirt-php.h
index 3bcc682..cd3d0a9 100644
--- a/src/libvirt-php.h
+++ b/src/libvirt-php.h
@@ -399,6 +399,9 @@ PHP_FUNCTION(libvirt_domain_undefine);
PHP_FUNCTION(libvirt_domain_reboot);
PHP_FUNCTION(libvirt_domain_define_xml);
PHP_FUNCTION(libvirt_domain_create_xml);
+PHP_FUNCTION(libvirt_domain_set_max_memory);
+PHP_FUNCTION(libvirt_domain_set_memory);
+PHP_FUNCTION(libvirt_domain_set_memory_flags);
PHP_FUNCTION(libvirt_domain_memory_peek);
PHP_FUNCTION(libvirt_domain_memory_stats);
PHP_FUNCTION(libvirt_domain_update_device);
--
2.3.3
9 years, 7 months
[libvirt] [PATCH v2 0/1] qemu: monitor: Add memory balloon support for virtio-ccw
by Boris Fiuczynski
v2:
* corrected historic spelling error in comment
* added return code checking of the first qemuMonitorJSONFindLinkPath call to
prevent the second call of qemuMonitorJSONFindLinkPath on "error bail out"
return code.
A comment on this version: I find that even so this version is technically more
correct the simplicity and perceivability have suffered profoundly. I am not sure
that after the recent rework by which the init function protects itself from
being fully run a second time during a run of the domain it is necessary to
prevent a single second call returning "error bail out".
Boris Fiuczynski (1):
qemu: monitor: Add memory balloon support for virtio-ccw
src/qemu/qemu_monitor.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--
2.3.0
9 years, 7 months
[libvirt] [PATCH 0/4] Various cleanups
by Martin Kletzander
*** BLURB HERE ***
Martin Kletzander (4):
build: Remove unnecessarily repeated rules for syms -> def
rpc: Fix possible crash when MDNSAddEntry fails
Generate JSON with mDNS entries only when built --with-avahi
tests: Use libvirt properly with initialization and error dispatching
src/Makefile.am | 20 ++------------------
src/rpc/virnetserver.c | 4 +++-
tests/virnetservertest.c | 35 ++++++++++++++++++++---------------
3 files changed, 25 insertions(+), 34 deletions(-)
--
2.4.3
9 years, 7 months
[libvirt] [libvirt-php][PATCH 00/10] Couple of PHP fixes
by Michal Privoznik
Even though this project is not actively developed, it does not
mean we can't make some things better in it. After this patchset,
distcheck works, targets are not built everytime, only when
necessary, and so on.
Michal Privoznik (10):
Update .gitignore
Update autotools generated files
get_next_free_numeric_value: Use correct format for sscanf()
tools: Cleanup Makefile
configure.ac: Check for libtool
src: Clean up Makefile
tests: Clean up Makefile.am
tests: Update qemu path
tests: run under distcheck
Install libvirt-php.ini more wisely
.gitignore | 28 ++
INSTALL | 8 +-
Makefile.am | 4 +-
configure.ac | 8 +-
install-sh | 14 +-
missing | 412 ++++++++++-----------------
src/Makefile.am | 64 +++--
src/libvirt-php.c | 2 +-
tests/Makefile.am | 37 ++-
tests/data/example-qcow2-disk.xml | 2 +-
tests/{functions.phpt => functions.phpt.in} | 4 +-
tests/php.ini | 2 +-
tests/runtests.sh | 4 +-
tests/test-domain-create-and-coredump.phpt | 3 +-
tests/test-domain-create-and-get-xpath.phpt | 3 +-
tests/test-domain-create-get-metadata.phpt | 3 +-
tests/test-domain-create.phpt | 3 +-
tests/test-domain-define-create-destroy.phpt | 3 +-
tests/test-domain-define-undefine.phpt | 3 +-
tests/test-domain-snapshot.phpt | 3 +-
tools/Makefile.am | 29 +-
21 files changed, 309 insertions(+), 330 deletions(-)
rename tests/{functions.phpt => functions.phpt.in} (91%)
--
2.3.6
9 years, 7 months
[libvirt] [PATCH] qemu: emulatorpin: Don't reset pinning when pinning to all cpus
by Peter Krempa
Similarly to 3813b648e9761aeed5b4f3ee7e62253a9172ce8e remove the default
pinning assumption from emulatorpin.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1227180
---
src/qemu/qemu_driver.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 34e5581..c8e4aa9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5285,7 +5285,6 @@ qemuDomainPinEmulator(virDomainPtr dom,
virDomainDefPtr persistentDef;
int ret = -1;
qemuDomainObjPrivatePtr priv;
- bool doReset = false;
virBitmapPtr pcpumap = NULL;
virQEMUDriverConfigPtr cfg = NULL;
virObjectEventPtr event = NULL;
@@ -5329,12 +5328,6 @@ qemuDomainPinEmulator(virDomainPtr dom,
goto endjob;
}
- /* pinning to all physical cpus means resetting,
- * so check if we can reset setting.
- */
- if (virBitmapIsAllSet(pcpumap))
- doReset = true;
-
if (def) {
if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR,
@@ -5359,8 +5352,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
virBitmapFree(def->cputune.emulatorpin);
def->cputune.emulatorpin = NULL;
- if (!doReset &&
- !(def->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
+ if (!(def->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
goto endjob;
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
@@ -5380,8 +5372,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
virBitmapFree(persistentDef->cputune.emulatorpin);
persistentDef->cputune.emulatorpin = NULL;
- if (!doReset &&
- !(persistentDef->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
+ if (!(persistentDef->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
goto endjob;
ret = virDomainSaveConfig(cfg->configDir, persistentDef);
--
2.4.1
9 years, 7 months
[libvirt] [sandbox PATCH 0/4] Getting qemu sandboxes run as root + host-image format
by Cédric Bosdonnat
Hi all,
Here are a few patches to make sandboxes run with qemu:///system connection.
The last one is just a new feature to allow using somethings else than RAW images
in host-image mounts. This feature will later be needed to run docker container
using Eren's work.
Cédric Bosdonnat (4):
Make sure the sandbox state dir and config can be accessed
Write /dev/vd* instead of vd* in mounts.cfg
qemu: mount all host-images as ext4
Add host-image format parameter
.../libvirt-sandbox-builder-container.c | 4 +
libvirt-sandbox/libvirt-sandbox-builder-machine.c | 13 +++-
.../libvirt-sandbox-config-mount-host-image.c | 91 +++++++++++++++++++++-
.../libvirt-sandbox-config-mount-host-image.h | 5 +-
libvirt-sandbox/libvirt-sandbox-config.c | 70 +++++++++++++++--
.../libvirt-sandbox-context-interactive.c | 4 +-
libvirt-sandbox/libvirt-sandbox.sym | 5 ++
libvirt-sandbox/tests/test-config.c | 1 +
8 files changed, 180 insertions(+), 13 deletions(-)
--
2.1.4
9 years, 7 months
[libvirt] [PATCH] man: clarify usage of virsh blockcopy with --xml
by Ján Tomko
The --xml option is mandatory if an XML description is used.
Otherwise the third parameter is treated as the destination.
https://bugzilla.redhat.com/show_bug.cgi?id=1206406#c3
---
tools/virsh.pod | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 9b57c8c..154922e 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -989,12 +989,12 @@ unlimited. The hypervisor can choose whether to reject the value or
convert it to the maximum value allowed.
=item B<blockcopy> I<domain> I<path> { I<dest> [I<format>] [I<--blockdev>]
-| I<xml> } [I<--shallow>] [I<--reuse-external>] [I<bandwidth>]
+| I<--xml> B<file> } [I<--shallow>] [I<--reuse-external>] [I<bandwidth>]
[I<--wait> [I<--async>] [I<--verbose>]] [{I<--pivot> | I<--finish>}]
[I<--timeout> B<seconds>] [I<granularity>] [I<buf-size>]
Copy a disk backing image chain to a destination. Either I<dest> as
-the destination file name, or I<xml> as the name of an XML file containing
+the destination file name, or I<--xml> with the name of an XML file containing
a top-level <disk> element describing the destination, must be present.
Additionally, if I<dest> is given, I<format> should be specified to declare
the format of the destination (if I<format> is omitted, then libvirt
--
2.3.6
9 years, 7 months