[libvirt] [patch] initialize a local variable in qemudOpenMonitorUnix()
by Jun Koi
This patch initializes a local variable in qemudOpenMonitorUnix(),
thus also eliminates a compilation warning.
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 00dc6e5..d2db1a2 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -874,7 +874,7 @@ qemudOpenMonitorUnix(virConnectPtr conn,
struct sockaddr_un addr;
int monfd;
int timeout = 3; /* In seconds */
- int ret, i;
+ int ret, i = 0;
if ((monfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
virReportSystemError(conn, errno,
15 years, 4 months
[libvirt] [PATCH] rpm spec cleanup and split off client only requirements
by Daniel Veillard
This early patch changes the spec file to:
- remove the old Obsoletes: livir and such, that was 3 years ago
- make sure the inter packages require %{version}-%{release} and
not just %{version}
- compresses the ChangeLog which is getting close to a megabyte
- split out a separate libvirt-client binary rpm including only
what is needed to access the libvirt service from a client
viewpioint. The main package requires the client anyway
So I moved in the client:
- the shared library, I guess it's uncontroversial
- the virsh/virt-xml-validate binaries, I guess it it doesn't block
i386/x86_64 to be parallel installable that's fine
- the man pages, obvious based on previous
- the proxy when built, more controversial, it assumes that there
is a service running locally so could be left on the main package
- sasl and policykit data, more controversial, I guess it's better
to associate them with the client
- the schemas to allow checking on the client
Some of this is still open, including the name of the subpackage which I
initially expected to be libvirt-libs but in retrospect maybe -client
will be more in line with the content,
Comments welcome :-)
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/
15 years, 4 months
[libvirt] [PATCH 0/7] Support cgroups in QEMU driver
by Daniel P. Berrange
This series of patches introduces cgroups support to the QEMU driver.
At this time it uses the 'devices' controller to whitelist block
devices for QEMU guests to prevent unauthorized access. It uses the
'cpu_shares' controller to allow schedular tunables on a per guest
basis. In the future we should use the 'memory' controller to enforce
the limit set in the balloon driver ie if the guest does not honour
the balloon request, then force the guest into swap, avoiding host
overcommit.
There is also some refactoring of the cgroups code to remove the
assumption that libvirtd is starting in the root cgroup, remove
the requirement that all controllers be active, and allow for use
in non-privileged drivers.
Daniel P. Berrange (7):
Use enums for cgroup controller types / labels
Use virFileReadAll/virFileWriteStr for key cgroup read/write helpers
Make cgroups a little more efficient
Place every QEMU guest in a private cgroup
Implement schedular tunables API using cgroups
Use cgroups for block device whitelisting in QEMU guests
Refactor cgroups to allow a group per driver to be managed directly
src/cgroup.c | 861 ++++++++++++++++++++++++++--------------------
src/cgroup.h | 28 +-
src/libvirt_private.syms | 1 +
src/lxc_conf.h | 2 +
src/lxc_controller.c | 19 +-
src/lxc_driver.c | 25 +-
src/qemu_conf.h | 2 +
src/qemu_driver.c | 355 ++++++++++++++++++-
src/util.c | 27 ++-
src/util.h | 2 +
10 files changed, 904 insertions(+), 420 deletions(-)
15 years, 4 months
[libvirt] changing files in /var/lib/libvirt/images
by Gene Czarcinski
Assume I am working with virtual disk image files in /var/lib/libvirt/images
such as removing a file, defining a new file (with qemi-img create or qemu-img
convert), or simply copying a file ("cp") from elsewhere such as VMware. When
I do this, Guest definition or adding hardware to an existing guest under virt-
manager does not "see" the file change. That is, until I terminate virt-
manager and restart /etc/init.d/libvirtd.
Is there some better/easier/less-disruptive means of notifying "whatever" that
the list of files has changed?
I noticed that
/etc/init.d/libvirtd force-reload
has no effect.
I also notice that restarting libvirtd and/or terminating and restarting virt-
manager while there are guests running really screws things up.
If such a "means" does not exist, should one be created? [should this be an
RFE in bugzilla?]
Gene
15 years, 4 months
[libvirt] Create a new VM from an existent image?
by Jun Koi
Hi,
To use libvirt, I am strying to use virt-install to create a new VM
from an existent (KVM) VM image. I did the following steps:
1) run libvirtd with "libvirtd -d" (I use the latest libvirt git tree)
2) Run virt-install (0.400.3) with my existent image in img/img.winxp
# virt-install --import -n winxp -f img/img.xp3 --vnc --hvm
--accelerate --ram 800
However, this step returns error like:
"ERROR Could not find usable default libvirt connection."
Actually I am not sure that is the right way to use the new --import
option with virt-install. So that might be the problem?
All the code are updated, and compiled from source on Ubuntu 8.04. Any help?
Thanks a lot,
J
15 years, 4 months
[libvirt] [PATCH] qemu: Try multiple times to open unix monitor socket
by Cole Robinson
Unlike the pty monitor (which we know exists since we scrape its path from
stdout), we have no way of knowing that the unix monitor socket should exist/
be initialized. As a result, some of my KVM guests randomly fail to start on
F10 host.
Try to open the unix socket in a 3 second timeout loop. Ignore EACCES (path
does not exist if a first time run) and ECONNREFUSED (leftover socket from
a previous run hasn't been removed yet). Fixes things for me.
---
src/qemu_driver.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index e2b7acb..200718b 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -874,6 +874,8 @@ qemudOpenMonitorUnix(virConnectPtr conn,
{
struct sockaddr_un addr;
int monfd;
+ int timeout = 3; /* In seconds */
+ int ret, i;
if ((monfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
virReportSystemError(conn, errno,
@@ -885,10 +887,28 @@ qemudOpenMonitorUnix(virConnectPtr conn,
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, monitor, sizeof(addr.sun_path));
- if (connect(monfd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+ do {
+ ret = connect(monfd, (struct sockaddr *) &addr, sizeof(addr));
+
+ if (ret == 0)
+ break;
+
+ if (errno == EACCES || errno == ECONNREFUSED) {
+ /* EACCES : Socket may not have shown up yet
+ * ECONNREFUSED : Leftover socket hasn't been removed yet */
+ continue;
+ }
+
virReportSystemError(conn, errno, "%s",
_("failed to connect to monitor socket"));
goto error;
+
+ } while ((++i <= timeout*5) && (usleep(.2 * 1000000) <= 0));
+
+ if (ret != 0) {
+ virReportSystemError(conn, errno, "%s",
+ _("monitor socket did not show up."));
+ goto error;
}
if (qemudOpenMonitorCommon(conn, driver, vm, monfd, reconnect) < 0)
--
1.6.0.6
15 years, 4 months
[libvirt] adding scsi disk failed (code=9)
by Massimo Canonico
Hi,
I'm newbie and sorry if this question was already post in this ML (is
there any search engine for the ML archive?).
I'm trying to attach a volume in my instance. The instance is running
and the volume is available, but i got this error:
----
libvirt: operation failed: adding scsi disk failed (code=9)
virDomainAttachDevice() failed (err=-1) XML=<disk type='block'><driver
name='phy'/><source dev='/dev/etherd/e0.8'/><target dev='sdb'/></disk>
doAttachVolume() failed error=1
----
I'm not sure where I can start to debug this error. I'm using Fedora 11,
x86_64, with these packages
[root@minicloud eucalyptus]# rpm -qa | grep libv
libvirt-devel-0.6.2-12.fc11.x86_64
libvorbis-1.2.0-7.fc11.x86_64
libvirt-0.6.2-12.fc11.x86_64
libvirt-python-0.6.2-12.fc11.x86_64
libvolume_id-141-3.fc11.x86_64
May you help me, please?
Thanks in advance,
M
15 years, 4 months
[libvirt] [libvirt 0.6.4] Unable to set /domain/devices/serial[@port=1] as console?
by Charles Duffy
When I do a "virsh define" with the following:
<serial type='file'>
<source path='/path/to/serial.log'/>
<target port='0'/>
</serial>
<serial type='pty'>
<target port='1'/>
</serial>
<console type='pty'>
<target port='1'/>
</console>
The result is this:
<serial type='file'>
<source path='/path/to/serial.log'/>
<target port='0'/>
</serial>
<serial type='pty'>
<target port='1'/>
</serial>
<console type='file'>
<source path='/path/to/serial.log'/>
<target port='0'/>
</console>
...a markedly different configuration.
Is this the result of a bug, or a known behavior I've failed to catch in
the docs?
Thanks!
15 years, 4 months
[libvirt] Tentative schedule for 0.7.0
by Daniel Veillard
Basically I would like to freeze development at the end of next week
and push at the end of the month. Since I plan to be away on 31, I will
probably make the release on the 30th, but I think we can still apply
new features until Friday next week.
To try to help w.r.t. Fedora 12 schedule I will make a 0.7.0 beta
release probably on the week-end of the 25 and push it in rawhide for
parallel testing,
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/
15 years, 4 months