[libvirt] Add virStorageVolResize()
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Add a new function to allow changing of capacity of storage volumes.
---
include/libvirt/libvirt.h.in | 5 ++
src/driver.h | 5 ++
src/libvirt.c | 50 +++++++++++++++++++++++
src/libvirt_public.syms | 1 +
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 9 ++++-
src/remote_protocol-structs | 6 +++
src/storage/storage_backend.h | 6 +++
src/storage/storage_backend_fs.c | 59 ++++++++++++++++++++++++++++
src/storage/storage_driver.c | 80 ++++++++++++++++++++++++++++++++++++++
src/util/storage_file.c | 16 ++++++++
src/util/storage_file.h | 2 +
tools/virsh.c | 53 +++++++++++++++++++++++++
13 files changed, 292 insertions(+), 1 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index e99cd00..b169592 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -2386,6 +2386,11 @@ char * virStorageVolGetXMLDesc (virStorageVolPtr pool,
char * virStorageVolGetPath (virStorageVolPtr vol);
+int virStorageVolResize (virStorageVolPtr vol,
+ unsigned long long capacity,
+ unsigned int flags);
+
+
/**
* virKeycodeSet:
*
diff --git a/src/driver.h b/src/driver.h
index df2aa60..c850926 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -1261,6 +1261,10 @@ typedef int
unsigned long long offset,
unsigned long long length,
unsigned int flags);
+typedef int
+ (*virDrvStorageVolResize) (virStorageVolPtr vol,
+ unsigned long long capacity,
+ unsigned int flags);
typedef int
(*virDrvStoragePoolIsActive)(virStoragePoolPtr pool);
@@ -1323,6 +1327,7 @@ struct _virStorageDriver {
virDrvStorageVolGetInfo volGetInfo;
virDrvStorageVolGetXMLDesc volGetXMLDesc;
virDrvStorageVolGetPath volGetPath;
+ virDrvStorageVolResize volResize;
virDrvStoragePoolIsActive poolIsActive;
virDrvStoragePoolIsPersistent poolIsPersistent;
};
diff --git a/src/libvirt.c b/src/libvirt.c
index e9d638b..d1962a2 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -12927,6 +12927,56 @@ error:
return NULL;
}
+/**
+ * virStorageVolResize:
+ * @vol: pointer to storage volume
+ * @capacity: new capacity
+ * @flags: extra flags; not used yet, so callers should always pass 0
+ *
+ * Changes the capacity of the storage volume @vol to @capacity. The new
+ * capacity must not exceed the sum of current capacity of the volume and
+ * remainining free space of its parent pool. Also the new capacity must
+ * be greater than or equal to current allocation of the volume.
+ *
+ * Returns 0 on success, or -1 on error.
+ */
+int
+virStorageVolResize(virStorageVolPtr vol,
+ unsigned long long capacity,
+ unsigned int flags)
+{
+ virConnectPtr conn;
+ VIR_DEBUG("vol=%p capacity=%llu flags=%x", vol, capacity, flags);
+
+ virResetLastError();
+
+ if (!VIR_IS_STORAGE_VOL(vol)) {
+ virLibStorageVolError(VIR_ERR_INVALID_STORAGE_VOL, __FUNCTION__);
+ virDispatchError(NULL);
+ return -1;
+ }
+
+ conn = vol->conn;
+
+ if (conn->flags & VIR_CONNECT_RO) {
+ virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
+
+ if (conn->storageDriver && conn->storageDriver->volResize) {
+ int ret;
+ ret = conn->storageDriver->volResize(vol, capacity, flags);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+
+error:
+ virDispatchError(vol->conn);
+ return -1;
+}
/**
* virNodeNumOfDevices:
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 1340b0c..54a4f2c 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -520,6 +520,7 @@ LIBVIRT_0.9.10 {
global:
virDomainShutdownFlags;
virStorageVolWipePattern;
+ virStorageVolResize;
} LIBVIRT_0.9.9;
# .... define new API here using predicted next version number ....
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index f79f53e..2bb4cbf 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -4837,6 +4837,7 @@ static virStorageDriver storage_driver = {
.volGetInfo = remoteStorageVolGetInfo, /* 0.4.1 */
.volGetXMLDesc = remoteStorageVolGetXMLDesc, /* 0.4.1 */
.volGetPath = remoteStorageVolGetPath, /* 0.4.1 */
+ .volResize = remoteStorageVolResize, /* 0.9.10 */
.poolIsActive = remoteStoragePoolIsActive, /* 0.7.3 */
.poolIsPersistent = remoteStoragePoolIsPersistent, /* 0.7.3 */
};
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 0f354bb..29f98fc 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -1676,6 +1676,12 @@ struct remote_storage_vol_get_path_ret {
remote_nonnull_string name;
};
+struct remote_storage_vol_resize_args {
+ remote_nonnull_storage_vol vol;
+ unsigned hyper capacity;
+ unsigned int flags;
+};
+
/* Node driver calls: */
struct remote_node_num_of_devices_args {
@@ -2667,7 +2673,8 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_SET_INTERFACE_PARAMETERS = 256, /* autogen autogen */
REMOTE_PROC_DOMAIN_GET_INTERFACE_PARAMETERS = 257, /* skipgen skipgen */
REMOTE_PROC_DOMAIN_SHUTDOWN_FLAGS = 258, /* autogen autogen */
- REMOTE_PROC_STORAGE_VOL_WIPE_PATTERN = 259 /* autogen autogen */
+ REMOTE_PROC_STORAGE_VOL_WIPE_PATTERN = 259, /* autogen autogen */
+ REMOTE_PROC_STORAGE_VOL_RESIZE = 300 /* autogen autogen */
/*
* Notice how the entries are grouped in sets of 10 ?
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index de85862..9a60fc2 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -1260,6 +1260,11 @@ struct remote_storage_vol_get_path_args {
struct remote_storage_vol_get_path_ret {
remote_nonnull_string name;
};
+struct remote_storage_vol_resize_args {
+ remote_nonnull_storage_vol vol;
+ uint64_t capacity;
+ u_int flags;
+};
struct remote_node_num_of_devices_args {
remote_string cap;
u_int flags;
@@ -2101,4 +2106,5 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_GET_INTERFACE_PARAMETERS = 257,
REMOTE_PROC_DOMAIN_SHUTDOWN_FLAGS = 258,
REMOTE_PROC_STORAGE_VOL_WIPE_PATTERN = 259,
+ REMOTE_PROC_STORAGE_VOL_RESIZE = 300,
};
diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h
index 75ed676..a37bf7c 100644
--- a/src/storage/storage_backend.h
+++ b/src/storage/storage_backend.h
@@ -44,6 +44,11 @@ typedef int (*virStorageBackendDeleteVol)(virConnectPtr conn, virStoragePoolObjP
typedef int (*virStorageBackendBuildVolFrom)(virConnectPtr conn, virStoragePoolObjPtr pool,
virStorageVolDefPtr origvol, virStorageVolDefPtr newvol,
unsigned int flags);
+typedef int (*virStorageBackendVolumeResize)(virConnectPtr conn,
+ virStoragePoolObjPtr pool,
+ virStorageVolDefPtr vol,
+ unsigned long long capacity,
+ unsigned int flags);
/* File creation/cloning functions used for cloning between backends */
int virStorageBackendCreateRaw(virConnectPtr conn,
@@ -78,6 +83,7 @@ struct _virStorageBackend {
virStorageBackendCreateVol createVol;
virStorageBackendRefreshVol refreshVol;
virStorageBackendDeleteVol deleteVol;
+ virStorageBackendVolumeResize resizeVol;
};
virStorageBackendPtr virStorageBackendForType(int type);
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index d8dc29c..31f7c0a 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -1187,6 +1187,62 @@ virStorageBackendFileSystemVolRefresh(virConnectPtr conn,
return 0;
}
+static int
+virStorageBackendFilesystemResizeQemuImg(const char *path,
+ unsigned long long capacity)
+{
+ int ret = -1;
+ char *img_tool;
+ virCommandPtr cmd = NULL;
+
+ /* KVM is usually ahead of qemu on features, so try that first */
+ img_tool = virFindFileInPath("kvm-img");
+ if (!img_tool)
+ img_tool = virFindFileInPath("qemu-img");
+
+ if (!img_tool) {
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unable to find kvm-img or qemu-img"));
+ return -1;
+ }
+
+ cmd = virCommandNew(img_tool);
+ virCommandAddArgList(cmd, "resize", path, NULL);
+ virCommandAddArgFormat(cmd, "%llu", capacity);
+
+ ret = virCommandRun(cmd, NULL);
+
+ VIR_FREE(img_tool);
+ virCommandFree(cmd);
+
+ return ret;
+}
+
+/**
+ * Resize a volume
+ */
+static int
+virStorageBackendFileSystemVolResize(virConnectPtr conn ATTRIBUTE_UNUSED,
+ virStoragePoolObjPtr pool ATTRIBUTE_UNUSED,
+ virStorageVolDefPtr vol,
+ unsigned long long capacity,
+ unsigned int flags)
+{
+ virCheckFlags(0, -1);
+
+ if (vol->target.format == VIR_STORAGE_FILE_RAW) {
+ return virStorageFileResize(vol->target.path, capacity);
+ } else if (vol->target.format == VIR_STORAGE_FILE_DIR) {
+ virStorageReportError(VIR_ERR_NO_SUPPORT,
+ "%s", _("Changing size of directory based "
+ "volumes is not supported"));
+ return -1;
+ } else {
+ return virStorageBackendFilesystemResizeQemuImg(vol->target.path,
+ capacity);
+ }
+}
+
virStorageBackend virStorageBackendDirectory = {
.type = VIR_STORAGE_POOL_DIR,
@@ -1199,6 +1255,7 @@ virStorageBackend virStorageBackendDirectory = {
.createVol = virStorageBackendFileSystemVolCreate,
.refreshVol = virStorageBackendFileSystemVolRefresh,
.deleteVol = virStorageBackendFileSystemVolDelete,
+ .resizeVol = virStorageBackendFileSystemVolResize,
};
#if WITH_STORAGE_FS
@@ -1216,6 +1273,7 @@ virStorageBackend virStorageBackendFileSystem = {
.createVol = virStorageBackendFileSystemVolCreate,
.refreshVol = virStorageBackendFileSystemVolRefresh,
.deleteVol = virStorageBackendFileSystemVolDelete,
+ .resizeVol = virStorageBackendFileSystemVolResize,
};
virStorageBackend virStorageBackendNetFileSystem = {
.type = VIR_STORAGE_POOL_NETFS,
@@ -1232,5 +1290,6 @@ virStorageBackend virStorageBackendNetFileSystem = {
.createVol = virStorageBackendFileSystemVolCreate,
.refreshVol = virStorageBackendFileSystemVolRefresh,
.deleteVol = virStorageBackendFileSystemVolDelete,
+ .resizeVol = virStorageBackendFileSystemVolResize,
};
#endif /* WITH_STORAGE_FS */
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index a332ada..76730b4 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1695,7 +1695,86 @@ out:
return ret;
}
+static int
+storageVolumeResize(virStorageVolPtr obj,
+ unsigned long long capacity,
+ unsigned int flags)
+{
+ virStorageDriverStatePtr driver = obj->conn->storagePrivateData;
+ virStorageBackendPtr backend;
+ virStoragePoolObjPtr pool = NULL;
+ virStorageVolDefPtr vol = NULL;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ storageDriverLock(driver);
+ pool = virStoragePoolObjFindByName(&driver->pools, obj->pool);
+ storageDriverUnlock(driver);
+
+ if (!pool) {
+ virStorageReportError(VIR_ERR_NO_STORAGE_POOL,
+ _("no storage pool with matching uuid"));
+ goto out;
+ }
+
+ if (!virStoragePoolObjIsActive(pool)) {
+ virStorageReportError(VIR_ERR_OPERATION_INVALID,
+ _("storage pool is not active"));
+ goto out;
+ }
+
+ if ((backend = virStorageBackendForType(pool->def->type)) == NULL)
+ goto out;
+
+ vol = virStorageVolDefFindByName(pool, obj->name);
+
+ if (vol == NULL) {
+ virStorageReportError(VIR_ERR_NO_STORAGE_VOL,
+ _("no storage vol with matching name '%s'"),
+ obj->name);
+ goto out;
+ }
+
+ if (vol->building) {
+ virStorageReportError(VIR_ERR_OPERATION_INVALID,
+ _("volume '%s' is still being allocated."),
+ vol->name);
+ goto out;
+ }
+
+ if (capacity < vol->allocation) {
+ virStorageReportError(VIR_ERR_INVALID_ARG,
+ _("can't shrink capacity below "
+ "existing allocation"));
+ goto out;
+ }
+
+ if (capacity > vol->allocation + pool->def->available) {
+ virStorageReportError(VIR_ERR_INVALID_ARG,
+ _("Not enough space left on storage pool"));
+ goto out;
+ }
+
+ if (!backend->resizeVol) {
+ virStorageReportError(VIR_ERR_NO_SUPPORT,
+ _("storage pool does not support changing of "
+ "volume capacity"));
+ goto out;
+ }
+
+ if (backend->resizeVol(obj->conn, pool, vol, capacity, flags) < 0)
+ goto out;
+
+ vol->capacity = capacity;
+ ret = 0;
+
+out:
+ if (pool)
+ virStoragePoolObjUnlock(pool);
+ return ret;
+}
/* If the volume we're wiping is already a sparse file, we simply
* truncate and extend it to its original size, filling it with
@@ -2243,6 +2322,7 @@ static virStorageDriver storageDriver = {
.volGetInfo = storageVolumeGetInfo, /* 0.4.0 */
.volGetXMLDesc = storageVolumeGetXMLDesc, /* 0.4.0 */
.volGetPath = storageVolumeGetPath, /* 0.4.0 */
+ .volResize = storageVolumeResize, /* 0.9.10 */
.poolIsActive = storagePoolIsActive, /* 0.7.3 */
.poolIsPersistent = storagePoolIsPersistent, /* 0.7.3 */
diff --git a/src/util/storage_file.c b/src/util/storage_file.c
index ba9cfc5..8260adb 100644
--- a/src/util/storage_file.c
+++ b/src/util/storage_file.c
@@ -931,6 +931,22 @@ virStorageFileFreeMetadata(virStorageFileMetadata *meta)
VIR_FREE(meta);
}
+/**
+ * virStorageFileResize:
+ *
+ * Change the capacity of the raw storage file at 'path'.
+ */
+int
+virStorageFileResize(const char *path, unsigned long long capacity)
+{
+ if (truncate(path, capacity) < 0) {
+ virReportSystemError(errno, _("Failed to truncate file '%s'"), path);
+ return -1;
+ }
+
+ return 0;
+}
+
#ifdef __linux__
# ifndef NFS_SUPER_MAGIC
diff --git a/src/util/storage_file.h b/src/util/storage_file.h
index b8920d0..96afb12 100644
--- a/src/util/storage_file.h
+++ b/src/util/storage_file.h
@@ -72,6 +72,8 @@ int virStorageFileGetMetadataFromFD(const char *path,
void virStorageFileFreeMetadata(virStorageFileMetadata *meta);
+int virStorageFileResize(const char *path, unsigned long long capacity);
+
enum {
VIR_STORAGE_FILE_SHFS_NFS = (1 << 0),
VIR_STORAGE_FILE_SHFS_GFS2 = (1 << 1),
diff --git a/tools/virsh.c b/tools/virsh.c
index 74655c2..20d4bd0 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -11279,6 +11279,58 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
return ret;
}
+/*
+ * "vol-resize" command
+ */
+static const vshCmdInfo info_vol_resize[] = {
+ {"help", N_("resize a vol")},
+ {"desc", N_("Resizes a storage vol.")},
+ {NULL, NULL}
+};
+
+static const vshCmdOptDef opts_vol_resize[] = {
+ {"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol name, key or path")},
+ {"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, N_("new capacity for the vol with optional k,M,G,T suffix")},
+ {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")},
+ {NULL, 0, 0, NULL}
+};
+
+static bool
+cmdVolResize(vshControl *ctl, const vshCmd *cmd)
+{
+ virStorageVolPtr vol;
+ const char *capacityStr = NULL;
+ unsigned long long capacity = 0;
+ bool ret = true;
+
+ if (!vshConnectionUsability(ctl, ctl->conn))
+ return false;
+
+ if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", NULL)))
+ return false;
+
+ if (vshCommandOptString(cmd, "capacity", &capacityStr) <= 0)
+ goto cleanup;
+ if (cmdVolSize(capacityStr, &capacity) < 0) {
+ vshError(ctl, _("Malformed size %s"), capacityStr);
+ goto cleanup;
+ }
+
+ if (virStorageVolResize(vol, capacity, 0) == 0) {
+ vshPrint(ctl, "Size of volume '%s' successfully changed to %s\n",
+ virStorageVolGetName(vol), capacityStr);
+ ret = true;
+ } else {
+ vshError(ctl, "Failed to change size of volume '%s' to %s\n",
+ virStorageVolGetName(vol), capacityStr);
+ ret = false;
+ }
+
+cleanup:
+ virStorageVolFree(vol);
+ return ret;
+}
+
/*
* "vol-dumpxml" command
@@ -16141,6 +16193,7 @@ static const vshCmdDef storageVolCmds[] = {
{"vol-pool", cmdVolPool, opts_vol_pool, info_vol_pool, 0},
{"vol-upload", cmdVolUpload, opts_vol_upload, info_vol_upload, 0},
{"vol-wipe", cmdVolWipe, opts_vol_wipe, info_vol_wipe, 0},
+ {"vol-resize", cmdVolResize, opts_vol_resize, info_vol_resize, 0},
{NULL, NULL, NULL, NULL, 0}
};
--
1.7.7.5
12 years, 6 months
[libvirt] [PATCH 0/3] openvz: allow for runtime quota updates
by Guido Günther
Hi,
attached patches allow to change disk quota at runtime. This can later be
extended to update network configuration as well.
The patch revealed a problem of the openvz driver in genral: the
openvzLoadDomains only reads the on disk configuration but doesn't check if
running domains have (non persistent) diverging values due to openvz calls
without the "--save" option but that's part of another patch.
Cheers,
-- Guido
Guido Günther (3):
Introduce virDomainFSIndexByName
openvz: add persist parameter to openvzSetDiskQuota
openvz: wire up domainUpdateDeviceFlags
src/conf/domain_conf.c | 16 +++++++
src/conf/domain_conf.h | 1 +
src/openvz/openvz_driver.c | 105 ++++++++++++++++++++++++++++++++++++++++++--
3 files changed, 118 insertions(+), 4 deletions(-)
--
1.7.10
12 years, 6 months
Re: [libvirt] How to add custom tag to the libvirt xml file for a new feature of the VM
by Eric Blake
[re-adding the list]
On 06/05/2012 09:53 PM, Yashwanth K P wrote:
>>> I am working on libvirt development and I wanted to add a custom tag to
>>> the libvirt xml to add a new feature to the VM. I am having trouble
>>> getting started with this. It would be really helpful if you can help me
>>> get started with this and guide me on what part of the source code that
>>> has to be modified to achieve the goal.
>> It would help if we knew more information about what you wanted.
>>
> What I would like to do is that I want to add a new tag to the xml file
> which which when parsed should have an effect on the cpuset value of the
> vcpu tag. Thus starting the VM with a particular set of CPUs to run on.
> I am not sure on to implement this since I am new to development by
> making changes in the source code. It would be really helpful if u guide
> me to achive the goal.
This is already possible, via the 'cpuset' attribute of the top-level
<vcpu> element:
http://libvirt.org/formatdomain.html#elementsCPUAllocation
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
12 years, 6 months
[libvirt] Looking for libvirt for RHEL 6.1 to provide Memory related metrics.
by Roy, Kallol
Hello All,
Can some one let me know if we have the latest libvirt version for RHEL 6.1 which would provided me Memory related counters/metrics. The latest libvirt which I found was on Fedora.
Any pointer or expected dates of libvirt release on RHEL would be highly appreciated.
Thanks and Regards,
_____________________________________________________________________
Kallol Roy
"Be kinder than necessary, for everyone you meet is fighting some kind of battle."
12 years, 6 months
[libvirt] [PATCH] daemon: Do not lose storage driver
by Osier Yang
Per WITH_STORAGE_DIR is always defined as long as libvirtd is built,
it's fine to use it as the condition.
---
daemon/libvirtd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index c74cd43..7db02e3 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -366,7 +366,7 @@ static void daemonInitialize(void)
# ifdef WITH_NETWORK
virDriverLoadModule("network");
# endif
-# ifdef WITH_STORAGE
+# ifdef WITH_STORAGE_DIR
virDriverLoadModule("storage");
# endif
# ifdef WITH_NODE_DEVICES
--
1.7.7.3
12 years, 6 months
[libvirt] [Fwd: error: this function is not supported by the connection driver : virConnectNumOfStoragePool]
by Onkar
Hello All,
Any idea on this issue ?
Regards,
Onkar
-------- Forwarded Message --------
From: Onkar <kernzap(a)gmail.com>
To: libvir-list <libvir-list(a)redhat.com>
Subject: error: this function is not supported by the connection
driver : virConnectNumOfStoragePool
Date: Wed, 30 May 2012 21:29:42 +0530
Hello,
I configured libvirt like this
./configure --prefix=/ --exec-prefix=/usr/ --libdir=/usr/lib64/
--with-storage-dir --with-storage-dir --with-storage-dir
--with-storage-dir --with-storage-dir --with-storage-dir
--with-storage-dir --with-storage-dir --with-qemu --with-libvirtd
--with-selinux --with-network --with-libblkid
and then,
make -j4
make install
and then
# virsh list --all
Id Name State
----------------------------------------------------
- vm1 shut off
# virsh pool-list --all
error: Failed to list active pools
error: this function is not supported by the connection driver:
virConnectNumOfStoragePools
getting this error , any clues on why is this error ?
Regards,
Onkar
12 years, 6 months
[libvirt] Schedule of next release
by Daniel Veillard
I just looked and we are at 142 patches since the 0.9.12 release.
If we were to keep the 1 month between releases schedule we would need
to enter freeze at the end of the week, and that mean a relatively small
release next. So I suggests to delay the release by 2 more weeks which
also has the advantage to get back to the end of the month deadline
which is easy to remember. So unless there is a pressing issue to
make a release soon which I don't know about, let's plan to enter freeze
around Jun 22 for a release at the end of month.
As a note it seems that the rate of changes to libvirt is decreasing
a bit (see http://veillard.com/commits_by_year_month.png which I
generated at the end of may with gitstats) so maybe we should start
planning for slighty longuer release cycles. Let's see how the trend
evolves, but I doubt the rate wil increase over the summer :-)
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/
12 years, 6 months
[libvirt] [PATCH v3 0/2] Rework RPC message buffer
by Michal Privoznik
This patch set tries to fix corner cases where libvirt runs on huge
system, e.g. 4K CPU monster. In these cases, capabilities XML is
enormously big, as we are transferring info about each singe CPU core
(to which NUMA node it belongs, etc.). This XML is bigger than our
RPC limit, therefore users cannot get it as it is dropped on server,
leaving them with inability to connect. Therefore we need to increase
those limits (whole RPC message and RPC string). However, simple
lifting up will work, but increase mem usage.
Therefore I've reworked RPC buffer handling: changed it from
'statically' to dynamically allocated.
So in most cases - when small messages are sent - this will even
decrease our memory consumption. Leaving us flexible for corner cases
described above.
On the other hand, I realize we've had our history with RPC breakage.
So I think I'll require more than 1 ACK before pushing.
(I guess Eric's ACK still holds)
diff to v2:
-suggestions from Eric's review included
diff to v1:
-couple of fixes (1/2)
-increased other limits as well (2/2)
Michal Privoznik (2):
rpc: Switch to dynamically allocated message buffer
rpc: Size up RPC limits
src/libvirt.c | 2 +
src/remote/remote_protocol.x | 20 +-
src/rpc/virnetclient.c | 16 ++-
src/rpc/virnetmessage.c | 12 ++-
src/rpc/virnetmessage.h | 5 +-
src/rpc/virnetprotocol.x | 6 +-
src/rpc/virnetserverclient.c | 24 +++-
tests/virnetmessagetest.c | 393 +++++++++++++++++++++++-------------------
8 files changed, 281 insertions(+), 197 deletions(-)
--
1.7.8.5
12 years, 6 months
[libvirt] [PATCH] build: fix 'make distcheck' issues
by Eric Blake
We have a distributed file depending on a generated file, which is
a no-no for a VPATH build from a read-only source tree (no wonder
'make distcheck' gives us precisely that situation):
File `libvirt_driver_remote.la' does not exist.
File `libvirt_driver_remote_la-remote_driver.lo' does not exist.
Prerequisite `libvirt_probes.h' is newer than target `../../src/remote/remote_protocol.h'.
Must remake target `../../src/remote/remote_protocol.h'.
Invoking recipe from Makefile:7464 to update target `../../src/remote/remote_protocol.h'.
make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/libvirt-0.9.12/_build/src'
GEN ../../src/remote/remote_protocol.h
cannot create ../../src/remote/remote_protocol.h: Permission denied at ../../src/rpc/genprotocol.pl line 31.
make[3]: *** [../../src/remote/remote_protocol.h] Error 13
Rather than making distributed .c files depend on generated files, we
really want to ensure that compilation into .lo files is not attempted
until the generated files are present, done by this patch. After that
fix, the next issue was that make treats './foo' and 'foo' differently
in determining whether an implicit %foo rule is applicable. Also, the
output for using the .aug test files was a bit verbose.
After fixing that, the next error is related to the docs directory, where
the tarball is missing a stamp file and thus tries to regenerate files that
are already present:
GEN ../../docs/apibuild.py.stamp
Traceback (most recent call last):
File "../../docs/apibuild.py", line 2511, in <module>
rebuild("libvirt")
File "../../docs/apibuild.py", line 2495, in rebuild
builder.serialize()
File "../../docs/apibuild.py", line 2424, in serialize
output = open(filename, "w")
IOError: [Errno 13] Permission denied: '../../docs/libvirt-api.xml'
make[5]: *** [../../docs/apibuild.py.stamp] Error 1
and fixing that exposed another case of a distributed file (generated
html) depending on a built file (libvirt.h).
* src/Makefile.am ($(srcdir)/remote/remote_driver.c): Change...
(libvirt_driver_remote_la-remote_driver.lo): ...to the real
dependency.
($(builddir)/locking/%-sanlock.conf): Drop $(builddir), so that
rule gets run in time for test_libvirt_sanlock.aug.
(test_libvir*.aug): Cater to silent build.
(conf_DATA): Don't ship qemu-sanlock.conf in the tarball, since it
is trivial to regenerate.
* docs/Makefile.am (EXTRA_DIST): Ship our stamp file.
($(APIBUILD_STAMP)): Don't depend on generated file.
---
Painfully tested by running 'make distcheck' for each tweak until I
got it to pass. However, I'd like a review before pushing.
docs/Makefile.am | 5 ++++-
src/Makefile.am | 15 ++++++++-------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index a03ca3e..88407b1 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -202,11 +202,14 @@ python_generated_files = \
APIBUILD=$(srcdir)/apibuild.py
APIBUILD_STAMP=$(APIBUILD).stamp
+EXTRA_DIST += $(APIBUILD_STAMP)
$(python_generated_files): $(APIBUILD_STAMP)
$(APIBUILD_STAMP): $(srcdir)/apibuild.py \
- $(srcdir)/../include/libvirt/*.h \
+ $(srcdir)/../include/libvirt/libvirt.h.in \
+ $(srcdir)/../include/libvirt/libvirt-qemu.h \
+ $(srcdir)/../include/libvirt/virterror.h \
$(srcdir)/../src/libvirt.c \
$(srcdir)/../src/libvirt-qemu.c \
$(srcdir)/../src/util/virterror.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 781c547..7b21317 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -649,7 +649,8 @@ libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
libvirt-net-rpc.la
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
-$(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED)
+REMOTE_DRIVER_PREREQS = $(REMOTE_DRIVER_GENERATED)
+%remote_driver.lo: $(REMOTE_DRIVER_PREREQS)
endif WITH_REMOTE
@@ -1125,7 +1126,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
if WITH_QEMU
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
- $(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
+ $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
check-augeas-qemu: test_libvirtd_qemu.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1138,7 +1139,7 @@ endif
if WITH_LXC
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
- $(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
+ $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
check-augeas-lxc: test_libvirtd_lxc.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1150,7 +1151,7 @@ endif
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
locking/qemu-sanlock.conf $(AUG_GENTEST)
- $(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
+ $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
check-augeas-sanlock: test_libvirt_sanlock.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -1287,7 +1288,7 @@ libvirt_la_BUILT_LIBADD += libvirt_probes.lo
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
nodist_libvirt_la_SOURCES = libvirt_probes.h
if WITH_REMOTE
-$(REMOTE_DRIVER_GENERATED): libvirt_probes.h
+REMOTE_DRIVER_PREREQS += libvirt_probes.h
endif WITH_REMOTE
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp
@@ -1361,12 +1362,12 @@ augeas_DATA += locking/libvirt_sanlock.aug
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
-$(builddir)/locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
+locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
$(AM_V_GEN)$(MKDIR_P) locking ; \
cp $< $@
if WITH_QEMU
-conf_DATA += locking/qemu-sanlock.conf
+nodist_conf_DATA = locking/qemu-sanlock.conf
BUILT_SOURCES += locking/qemu-sanlock.conf
DISTCLEANFILES += locking/qemu-sanlock.conf
endif
--
1.7.7.6
12 years, 6 months
[libvirt] How to add custom tag to the libvirt xml file for a new feature of the VM
by Yashwanth K P
Hello,
I am working on libvirt development and I wanted to add a custom tag to
the libvirt xml to add a new feature to the VM. I am having trouble
getting started with this. It would be really helpful if you can help me
get started with this and guide me on what part of the source code that
has to be modified to achieve the goal.
Thanks in advance.
Regards,
Yashwanth KP
12 years, 6 months