[Libvir] suspended domains
by Vadim Zaliva
I am using libvir 0.4.1 with Xen 3.2.0. It might be an obvious
question, but if there is a way to get list
of inactive/suspended domains via C API?
virsh # list --all
Id Name State
----------------------------------
0 Domain-0 running
6 centos51 blocked
virsh # domstate centos52
paused
As you can see 'centos52' is not shown, although it is known.
In general, could somebody explain to me how libvirt is managing
information about inactive
domains?
Thanks!
Vadim
16 years, 8 months
[Libvir] [PATCH] Typo in latest cvs lt.po
by Beth Kon
diff -urN libvirt.orig/po/lt.po libvirt/po/lt.po
--- libvirt.orig/po/lt.po 2008-03-14 11:57:02.000000000 -0400
+++ libvirt/po/lt.po 2008-03-25 13:00:57.000000000 -0400
@@ -1880,7 +1880,7 @@
msgstr "node cpu mhz"
#: src/test.c:780
-mseid "node memory"
+msgid "node memory"
msgstr "node memory"
#: src/test.c:786
--
Elizabeth Kon (Beth)
IBM Linux Technology Center
Open Hypervisor Team
email: eak(a)us.ibm.com
16 years, 8 months
[Libvir] PATCH: Add SCSI HBA backend for storage driver
by Daniel P. Berrange
This patch adds a new backend to the storage driver supporting SCSI HBAs.
With this you can now enumerate physical disks provided by FibreChannel,
internal SCSI / PATA / SATA / USB adapters.
The implemention uses HAL to enumerate the volumes asssociated with an HBA.
It is common for most boxes to support multiple HBAs. eg on my Linux laptop
$ ls /sys/class/scsi_host/
host0 host1 host2 host3
These HBA names are used to identify the host when defining the XML:
<pool type="scsi">
<name>hba0</name>
<source>
<adapter name="host0"/>
</source>
<target>
<path>/dev/disk/by-path</path>
</target>
</pool>
This does not provide any means of discovering HBA names - that's a later
piece of broader work on host device discovery. It also does not support
multipath devices (eg with FibreChannel the same storage volume can appear
on the host multiple times)
Example using the first host adapter which is my internal SATA controller
with a single disk attached:
# ./src/virsh pool-create /root/hba0.xml
Pool hba0 created from /root/hba0.xml
# ./src/virsh vol-list hba0
Name Path
-----------------------------------------
0:0:0:0 /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0
# ./src/virsh vol-info /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0
Name: 0:0:0:0
Type: block
Capacity: 153.39 GB
Allocation: 153.39 GB
# ./src/virsh vol-dumpxml /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0
libvir: Storage error : no storage vol with matching key
<volume>
<name>0:0:0:0</name>
<key>SATA_HDT722516DLA380_VDK91GTE0WPLER</key>
<source>
</source>
<capacity>164696555520</capacity>
<allocation>164696555520</allocation>
<target>
<path>/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0</path>
<permissions>
<mode>060640</mode>
<owner>0</owner>
<group>6</group>
<label>system_u:object_r:fixed_disk_device_t</label>
</permissions>
</target>
</volume>
This also does not deal with the problem of HBAs being created on the fly,
eg the NPIV case where you can add/remove adapters at will. I'm still working
on how to deal with this. If you have your virtual NPIV adapters already
defined though, it can enumerate them fine.
Aside from the bit where I map from the short HBA name (eg 'host0') into the
HAL device name, this should be portable to Solaris as-is.
Dan.
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
16 years, 8 months
[Libvir] [PATCH] reindent __virErrorMsg with spaces instead of tabs
by Guido Günther
__virErrorMsg is a mix of tabs and spaces which makes it a bit
hard to read. This patch cleans this up. Please apply.
-- Guido
---
src/virterror.c | 318 +++++++++++++++++++++++++++---------------------------
1 files changed, 159 insertions(+), 159 deletions(-)
diff --git a/src/virterror.c b/src/virterror.c
index 1e39be4..f16a43c 100644
--- a/src/virterror.c
+++ b/src/virterror.c
@@ -425,18 +425,18 @@ __virErrorMsg(virErrorNumber error, const char *info)
return (NULL);
case VIR_ERR_INTERNAL_ERROR:
if (info != NULL)
- errmsg = _("internal error %s");
+ errmsg = _("internal error %s");
else
- errmsg = _("internal error");
+ errmsg = _("internal error");
break;
case VIR_ERR_NO_MEMORY:
errmsg = _("out of memory");
break;
case VIR_ERR_NO_SUPPORT:
if (info == NULL)
- errmsg = _("this function is not supported by the hypervisor");
- else
- errmsg = _("this function is not supported by the hypervisor: %s");
+ errmsg = _("this function is not supported by the hypervisor");
+ else
+ errmsg = _("this function is not supported by the hypervisor: %s");
break;
case VIR_ERR_NO_CONNECT:
if (info == NULL)
@@ -446,21 +446,21 @@ __virErrorMsg(virErrorNumber error, const char *info)
break;
case VIR_ERR_INVALID_CONN:
if (info == NULL)
- errmsg = _("invalid connection pointer in");
- else
- errmsg = _("invalid connection pointer in %s");
+ errmsg = _("invalid connection pointer in");
+ else
+ errmsg = _("invalid connection pointer in %s");
break;
case VIR_ERR_INVALID_DOMAIN:
if (info == NULL)
- errmsg = _("invalid domain pointer in");
- else
- errmsg = _("invalid domain pointer in %s");
+ errmsg = _("invalid domain pointer in");
+ else
+ errmsg = _("invalid domain pointer in %s");
break;
case VIR_ERR_INVALID_ARG:
if (info == NULL)
- errmsg = _("invalid argument in");
- else
- errmsg = _("invalid argument in %s");
+ errmsg = _("invalid argument in");
+ else
+ errmsg = _("invalid argument in %s");
break;
case VIR_ERR_OPERATION_FAILED:
if (info != NULL)
@@ -485,9 +485,9 @@ __virErrorMsg(virErrorNumber error, const char *info)
break;
case VIR_ERR_UNKNOWN_HOST:
if (info != NULL)
- errmsg = _("unknown host %s");
- else
- errmsg = _("unknown host");
+ errmsg = _("unknown host %s");
+ else
+ errmsg = _("unknown host");
break;
case VIR_ERR_SEXPR_SERIAL:
if (info != NULL)
@@ -501,7 +501,7 @@ __virErrorMsg(virErrorNumber error, const char *info)
else
errmsg = _("could not use Xen hypervisor entry %s");
break;
- case VIR_ERR_NO_XENSTORE:
+ case VIR_ERR_NO_XENSTORE:
if (info == NULL)
errmsg = _("could not connect to Xen Store");
else
@@ -567,150 +567,150 @@ __virErrorMsg(virErrorNumber error, const char *info)
else
errmsg = _("library call %s failed, possibly not supported");
break;
- case VIR_ERR_XML_ERROR:
- if (info == NULL)
- errmsg = _("XML description not well formed or invalid");
- else
- errmsg = _("XML description for %s is not well formed or invalid");
- break;
- case VIR_ERR_DOM_EXIST:
- if (info == NULL)
- errmsg = _("this domain exists already");
- else
- errmsg = _("domain %s exists already");
- break;
- case VIR_ERR_OPERATION_DENIED:
- if (info == NULL)
- errmsg = _("operation forbidden for read only access");
- else
- errmsg = _("operation %s forbidden for read only access");
- break;
- case VIR_ERR_OPEN_FAILED:
- if (info == NULL)
- errmsg = _("failed to open configuration file for reading");
- else
- errmsg = _("failed to open %s for reading");
- break;
- case VIR_ERR_READ_FAILED:
- if (info == NULL)
- errmsg = _("failed to read configuration file");
- else
- errmsg = _("failed to read configuration file %s");
- break;
- case VIR_ERR_PARSE_FAILED:
- if (info == NULL)
- errmsg = _("failed to parse configuration file");
- else
- errmsg = _("failed to parse configuration file %s");
- break;
- case VIR_ERR_CONF_SYNTAX:
- if (info == NULL)
- errmsg = _("configuration file syntax error");
- else
- errmsg = _("configuration file syntax error: %s");
- break;
- case VIR_ERR_WRITE_FAILED:
- if (info == NULL)
- errmsg = _("failed to write configuration file");
- else
- errmsg = _("failed to write configuration file: %s");
- break;
- case VIR_ERR_XML_DETAIL:
- if (info == NULL)
- errmsg = _("parser error");
- else
- errmsg = "%s";
+ case VIR_ERR_XML_ERROR:
+ if (info == NULL)
+ errmsg = _("XML description not well formed or invalid");
+ else
+ errmsg = _("XML description for %s is not well formed or invalid");
+ break;
+ case VIR_ERR_DOM_EXIST:
+ if (info == NULL)
+ errmsg = _("this domain exists already");
+ else
+ errmsg = _("domain %s exists already");
+ break;
+ case VIR_ERR_OPERATION_DENIED:
+ if (info == NULL)
+ errmsg = _("operation forbidden for read only access");
+ else
+ errmsg = _("operation %s forbidden for read only access");
+ break;
+ case VIR_ERR_OPEN_FAILED:
+ if (info == NULL)
+ errmsg = _("failed to open configuration file for reading");
+ else
+ errmsg = _("failed to open %s for reading");
+ break;
+ case VIR_ERR_READ_FAILED:
+ if (info == NULL)
+ errmsg = _("failed to read configuration file");
+ else
+ errmsg = _("failed to read configuration file %s");
+ break;
+ case VIR_ERR_PARSE_FAILED:
+ if (info == NULL)
+ errmsg = _("failed to parse configuration file");
+ else
+ errmsg = _("failed to parse configuration file %s");
+ break;
+ case VIR_ERR_CONF_SYNTAX:
+ if (info == NULL)
+ errmsg = _("configuration file syntax error");
+ else
+ errmsg = _("configuration file syntax error: %s");
+ break;
+ case VIR_ERR_WRITE_FAILED:
+ if (info == NULL)
+ errmsg = _("failed to write configuration file");
+ else
+ errmsg = _("failed to write configuration file: %s");
+ break;
+ case VIR_ERR_XML_DETAIL:
+ if (info == NULL)
+ errmsg = _("parser error");
+ else
+ errmsg = "%s";
break;
case VIR_ERR_INVALID_NETWORK:
if (info == NULL)
- errmsg = _("invalid network pointer in");
- else
- errmsg = _("invalid network pointer in %s");
- break;
- case VIR_ERR_NETWORK_EXIST:
- if (info == NULL)
- errmsg = _("this network exists already");
- else
- errmsg = _("network %s exists already");
- break;
- case VIR_ERR_SYSTEM_ERROR:
- if (info == NULL)
- errmsg = _("system call error");
- else
- errmsg = "%s";
- break;
- case VIR_ERR_RPC:
- if (info == NULL)
- errmsg = _("RPC error");
- else
- errmsg = "%s";
- break;
- case VIR_ERR_GNUTLS_ERROR:
- if (info == NULL)
- errmsg = _("GNUTLS call error");
- else
- errmsg = "%s";
- break;
- case VIR_WAR_NO_NETWORK:
- if (info == NULL)
- errmsg = _("Failed to find the network");
- else
- errmsg = _("Failed to find the network: %s");
- break;
- case VIR_ERR_NO_DOMAIN:
- if (info == NULL)
- errmsg = _("Domain not found");
- else
- errmsg = _("Domain not found: %s");
- break;
- case VIR_ERR_NO_NETWORK:
- if (info == NULL)
- errmsg = _("Network not found");
- else
- errmsg = _("Network not found: %s");
- break;
- case VIR_ERR_INVALID_MAC:
- if (info == NULL)
- errmsg = _("invalid MAC address");
- else
- errmsg = _("invalid MAC address: %s");
- break;
- case VIR_ERR_AUTH_FAILED:
- if (info == NULL)
- errmsg = _("authentication failed");
- else
- errmsg = _("authentication failed: %s");
- break;
- case VIR_ERR_NO_STORAGE_POOL:
- if (info == NULL)
- errmsg = _("Storage pool not found");
- else
- errmsg = _("Storage pool not found: %s");
- break;
- case VIR_ERR_NO_STORAGE_VOL:
- if (info == NULL)
- errmsg = _("Storage volume not found");
- else
- errmsg = _("Storage volume not found: %s");
- break;
- case VIR_ERR_INVALID_STORAGE_POOL:
- if (info == NULL)
- errmsg = _("invalid storage pool pointer in");
- else
- errmsg = _("invalid storage pool pointer in %s");
- break;
- case VIR_ERR_INVALID_STORAGE_VOL:
- if (info == NULL)
- errmsg = _("invalid storage volume pointer in");
- else
- errmsg = _("invalid storage volume pointer in %s");
- break;
- case VIR_WAR_NO_STORAGE:
- if (info == NULL)
- errmsg = _("Failed to find a storage driver");
- else
- errmsg = _("Failed to find a storage driver: %s");
- break;
+ errmsg = _("invalid network pointer in");
+ else
+ errmsg = _("invalid network pointer in %s");
+ break;
+ case VIR_ERR_NETWORK_EXIST:
+ if (info == NULL)
+ errmsg = _("this network exists already");
+ else
+ errmsg = _("network %s exists already");
+ break;
+ case VIR_ERR_SYSTEM_ERROR:
+ if (info == NULL)
+ errmsg = _("system call error");
+ else
+ errmsg = "%s";
+ break;
+ case VIR_ERR_RPC:
+ if (info == NULL)
+ errmsg = _("RPC error");
+ else
+ errmsg = "%s";
+ break;
+ case VIR_ERR_GNUTLS_ERROR:
+ if (info == NULL)
+ errmsg = _("GNUTLS call error");
+ else
+ errmsg = "%s";
+ break;
+ case VIR_WAR_NO_NETWORK:
+ if (info == NULL)
+ errmsg = _("Failed to find the network");
+ else
+ errmsg = _("Failed to find the network: %s");
+ break;
+ case VIR_ERR_NO_DOMAIN:
+ if (info == NULL)
+ errmsg = _("Domain not found");
+ else
+ errmsg = _("Domain not found: %s");
+ break;
+ case VIR_ERR_NO_NETWORK:
+ if (info == NULL)
+ errmsg = _("Network not found");
+ else
+ errmsg = _("Network not found: %s");
+ break;
+ case VIR_ERR_INVALID_MAC:
+ if (info == NULL)
+ errmsg = _("invalid MAC address");
+ else
+ errmsg = _("invalid MAC address: %s");
+ break;
+ case VIR_ERR_AUTH_FAILED:
+ if (info == NULL)
+ errmsg = _("authentication failed");
+ else
+ errmsg = _("authentication failed: %s");
+ break;
+ case VIR_ERR_NO_STORAGE_POOL:
+ if (info == NULL)
+ errmsg = _("Storage pool not found");
+ else
+ errmsg = _("Storage pool not found: %s");
+ break;
+ case VIR_ERR_NO_STORAGE_VOL:
+ if (info == NULL)
+ errmsg = _("Storage volume not found");
+ else
+ errmsg = _("Storage volume not found: %s");
+ break;
+ case VIR_ERR_INVALID_STORAGE_POOL:
+ if (info == NULL)
+ errmsg = _("invalid storage pool pointer in");
+ else
+ errmsg = _("invalid storage pool pointer in %s");
+ break;
+ case VIR_ERR_INVALID_STORAGE_VOL:
+ if (info == NULL)
+ errmsg = _("invalid storage volume pointer in");
+ else
+ errmsg = _("invalid storage volume pointer in %s");
+ break;
+ case VIR_WAR_NO_STORAGE:
+ if (info == NULL)
+ errmsg = _("Failed to find a storage driver");
+ else
+ errmsg = _("Failed to find a storage driver: %s");
+ break;
}
return (errmsg);
}
--
1.5.4.3
16 years, 8 months
[Libvir] [PATCH] Another Report error in virsh.c code.
by S.Sakamoto
Hi,
I am watching through the virsh code for same type bug check.
http://git.et.redhat.com/?p=libvirt.git;a=commit;h=c857ace66df5a5068ed561...
And I found another point it should report error.
Thanks,
Shigeki Sakamoto.
Index: src/virsh.c
===================================================================
RCS file: /data/cvs/libvirt/src/virsh.c,v
retrieving revision 1.135
diff -u -p -r1.135 virsh.c
--- src/virsh.c 4 Mar 2008 19:59:56 -0000 1.135
+++ src/virsh.c 7 Mar 2008 07:03:12 -0000
@@ -1729,6 +1729,7 @@ cmdVcpupin(vshControl * ctl, vshCmd * cm
}
if (!(cpulist = vshCommandOptString(cmd, "cpulist", NULL))) {
+ vshError(ctl, FALSE, _("vcpupin: Invalid value of cpulist"));
virDomainFree(dom);
return FALSE;
}
@@ -1744,6 +1745,7 @@ cmdVcpupin(vshControl * ctl, vshCmd * cm
}
if (vcpu >= info.nrVirtCpu) {
+ vshError(ctl, FALSE, _("vcpupin: Invalid vCPU number."));
virDomainFree(dom);
return FALSE;
}
@@ -4473,6 +4475,7 @@ cmdAttachDevice(vshControl * ctl, vshCmd
from = vshCommandOptString(cmd, "file", &found);
if (!found) {
+ vshError(ctl, FALSE, _("attach-device: Invalid value of <file> option"));
virDomainFree(dom);
return FALSE;
}
@@ -4529,6 +4532,7 @@ cmdDetachDevice(vshControl * ctl, vshCmd
from = vshCommandOptString(cmd, "file", &found);
if (!found) {
+ vshError(ctl, FALSE, _("detach-device: Invalid value of <file> option"));
virDomainFree(dom);
return FALSE;
}
16 years, 8 months
[Libvir] [PATCH] Add Xen Scheduler APIs to xenDaemonDriver
by Saori Fukuta
Hi,
I add the Xen Scheduler APIs to xenDaemonDriver.
- xenDaemonGetSchedulerType
- xenDaemonGetSchedulerParameters
- xenDaemonSetSchedulerParameters
We will have the following improvements by this patch:
1) xenDaemonDriver of Schedulr is usable
when xenHypervisorDriver failed.
2) Show the Scheduler information with non-root user.
3) Set the Scheduler parameters for inactive domain.
(Unfortunately not right now, because we need this fix.
http://lists.xensource.com/archives/html/xen-devel/2008-03/msg00301.html)
And I have a few things to note:
- Currently, implemented for the Xen-credit scheduler only.
- xenDaemonGetSchedulerType is supported in xendConfigVersion >= 4,
because we can get "xen_scheduler" from xend after Cset13394 of
Xen (i.e. xendConfigVersion is four or later).
- For the above reason, xenDaemonGetSchedulerParameters and
xenDaemonSetSchedulerParameters are also supported in
xendConfigVersion >= 4, because they are using xenDaemonGetSchedulerType
to get the scheduler type.
- At xenDaemonSetSchedulerParameters, there are restrictions
which depends on Xend-version.
a) We cannot set the "cap" value by xend before Cset15476 of Xen,
because xend does not support the "cap" value
at xend/server/SrvDomain.py
b) We cannot set the scheduler parameters for inactive domain
without the following patch.
http://lists.xensource.com/archives/html/xen-devel/2008-03/msg00301.html
If the above patch is committed, this API will be available
for inactive domain.
Regards,
Saori Fukuta
16 years, 8 months
[Libvir] [PATCH] remove trailing newlines in error strings
by Guido Günther
Most of the error messages don't pass a final newline. Strip the ones
that still do so for consistency. Please apply.
-- Guido
---
src/qemu_driver.c | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 719f46e..adb33a7 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -962,14 +962,14 @@ qemudAddIptablesRules(virConnectPtr conn,
/* allow DHCP requests through to dnsmasq */
if ((err = iptablesAddTcpInput(driver->iptables, network->bridge, 67))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to allow DHCP requests from '%s' : %s\n"),
+ _("failed to add iptables rule to allow DHCP requests from '%s' : %s"),
network->bridge, strerror(err));
goto err1;
}
if ((err = iptablesAddUdpInput(driver->iptables, network->bridge, 67))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to allow DHCP requests from '%s' : %s\n"),
+ _("failed to add iptables rule to allow DHCP requests from '%s' : %s"),
network->bridge, strerror(err));
goto err2;
}
@@ -977,14 +977,14 @@ qemudAddIptablesRules(virConnectPtr conn,
/* allow DNS requests through to dnsmasq */
if ((err = iptablesAddTcpInput(driver->iptables, network->bridge, 53))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to allow DNS requests from '%s' : %s\n"),
+ _("failed to add iptables rule to allow DNS requests from '%s' : %s"),
network->bridge, strerror(err));
goto err3;
}
if ((err = iptablesAddUdpInput(driver->iptables, network->bridge, 53))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to allow DNS requests from '%s' : %s\n"),
+ _("failed to add iptables rule to allow DNS requests from '%s' : %s"),
network->bridge, strerror(err));
goto err4;
}
@@ -994,14 +994,14 @@ qemudAddIptablesRules(virConnectPtr conn,
if ((err = iptablesAddForwardRejectOut(driver->iptables, network->bridge))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to block outbound traffic from '%s' : %s\n"),
+ _("failed to add iptables rule to block outbound traffic from '%s' : %s"),
network->bridge, strerror(err));
goto err5;
}
if ((err = iptablesAddForwardRejectIn(driver->iptables, network->bridge))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to block inbound traffic to '%s' : %s\n"),
+ _("failed to add iptables rule to block inbound traffic to '%s' : %s"),
network->bridge, strerror(err));
goto err6;
}
@@ -1009,7 +1009,7 @@ qemudAddIptablesRules(virConnectPtr conn,
/* Allow traffic between guests on the same bridge */
if ((err = iptablesAddForwardAllowCross(driver->iptables, network->bridge))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to allow cross bridge traffic on '%s' : %s\n"),
+ _("failed to add iptables rule to allow cross bridge traffic on '%s' : %s"),
network->bridge, strerror(err));
goto err7;
}
@@ -1027,7 +1027,7 @@ qemudAddIptablesRules(virConnectPtr conn,
network->bridge,
network->def->forwardDev))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to allow forwarding from '%s' : %s\n"),
+ _("failed to add iptables rule to allow forwarding from '%s' : %s"),
network->bridge, strerror(err));
goto err8;
}
@@ -1038,7 +1038,7 @@ qemudAddIptablesRules(virConnectPtr conn,
network->bridge,
network->def->forwardDev))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to allow forwarding to '%s' : %s\n"),
+ _("failed to add iptables rule to allow forwarding to '%s' : %s"),
network->bridge, strerror(err));
goto err9;
}
@@ -1048,7 +1048,7 @@ qemudAddIptablesRules(virConnectPtr conn,
network->def->network,
network->def->forwardDev))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to add iptables rule to enable masquerading : %s\n"),
+ _("failed to add iptables rule to enable masquerading : %s"),
strerror(err));
goto err10;
}
@@ -1169,14 +1169,14 @@ static int qemudStartNetworkDaemon(virConnectPtr conn,
if (network->def->forwardDelay &&
(err = brSetForwardDelay(driver->brctl, network->bridge, network->def->forwardDelay))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to set bridge forward delay to %d\n"),
+ _("failed to set bridge forward delay to %d"),
network->def->forwardDelay);
goto err_delbr;
}
if ((err = brSetEnableSTP(driver->brctl, network->bridge, network->def->disableSTP ? 0 : 1))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to set bridge STP to %s\n"),
+ _("failed to set bridge STP to %s"),
network->def->disableSTP ? "off" : "on");
goto err_delbr;
}
@@ -1184,7 +1184,7 @@ static int qemudStartNetworkDaemon(virConnectPtr conn,
if (network->def->ipAddress[0] &&
(err = brSetInetAddress(driver->brctl, network->bridge, network->def->ipAddress))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("cannot set IP address on bridge '%s' to '%s' : %s\n"),
+ _("cannot set IP address on bridge '%s' to '%s' : %s"),
network->bridge, network->def->ipAddress, strerror(err));
goto err_delbr;
}
@@ -1192,7 +1192,7 @@ static int qemudStartNetworkDaemon(virConnectPtr conn,
if (network->def->netmask[0] &&
(err = brSetInetNetmask(driver->brctl, network->bridge, network->def->netmask))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("cannot set netmask on bridge '%s' to '%s' : %s\n"),
+ _("cannot set netmask on bridge '%s' to '%s' : %s"),
network->bridge, network->def->netmask, strerror(err));
goto err_delbr;
}
@@ -1200,7 +1200,7 @@ static int qemudStartNetworkDaemon(virConnectPtr conn,
if (network->def->ipAddress[0] &&
(err = brSetInterfaceUp(driver->brctl, network->bridge, 1))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to bring the bridge '%s' up : %s\n"),
+ _("failed to bring the bridge '%s' up : %s"),
network->bridge, strerror(err));
goto err_delbr;
}
@@ -1211,7 +1211,7 @@ static int qemudStartNetworkDaemon(virConnectPtr conn,
if (network->def->forward &&
!qemudEnableIpForwarding()) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to enable IP forwarding : %s\n"), strerror(err));
+ _("failed to enable IP forwarding : %s"), strerror(err));
goto err_delbr2;
}
@@ -1238,7 +1238,7 @@ static int qemudStartNetworkDaemon(virConnectPtr conn,
err_delbr:
if ((err = brDeleteBridge(driver->brctl, network->bridge))) {
- qemudLog(QEMUD_WARN, _("Failed to delete bridge '%s' : %s\n"),
+ qemudLog(QEMUD_WARN, _("Failed to delete bridge '%s' : %s"),
network->bridge, strerror(err));
}
@@ -1263,12 +1263,12 @@ static int qemudShutdownNetworkDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
if (network->def->ipAddress[0] &&
(err = brSetInterfaceUp(driver->brctl, network->bridge, 0))) {
- qemudLog(QEMUD_WARN, _("Failed to bring down bridge '%s' : %s\n"),
+ qemudLog(QEMUD_WARN, _("Failed to bring down bridge '%s' : %s"),
network->bridge, strerror(err));
}
if ((err = brDeleteBridge(driver->brctl, network->bridge))) {
- qemudLog(QEMUD_WARN, _("Failed to delete bridge '%s' : %s\n"),
+ qemudLog(QEMUD_WARN, _("Failed to delete bridge '%s' : %s"),
network->bridge, strerror(err));
}
@@ -1277,7 +1277,7 @@ static int qemudShutdownNetworkDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
kill(network->dnsmasqPid, SIGKILL);
if (waitpid(network->dnsmasqPid, NULL, 0) != network->dnsmasqPid)
qemudLog(QEMUD_WARN,
- "%s", _("Got unexpected pid for dnsmasq\n"));
+ "%s", _("Got unexpected pid for dnsmasq"));
}
network->bridge[0] = '\0';
--
1.5.4.3
16 years, 8 months
[Libvir] Looking to hire coder w/ libvir exp
by Robert J. Adams (jason)
Hello everyone,
We're looking to hire a programmer w/ libvir experience to develop a
VPS/VM hosting control panel (supporting xen). Anyone with interest (and
spare time) please shoot me an email.
Thanks,
Robert J. Adams
Apex Hosting Group.
16 years, 8 months
[Libvir] Adding suppport for daemon restarts with stateful drivers
by Daniel P. Berrange
The libvirt daemon has the ability to reload itself by sending it SIGHUP.
For the QEMU & network drivers this makes it reload the config files for
VMs and re-init the iptables rules. It would be desirable though to allow
the daemon to perform a full restart. Principally this is for RPM upgrades
where you want toensure the daemon is running the new code.
The tricky thing is figuring out how to handle driver state. Looking at the
QEMU, network, storage and LXC drivers, there is not actually all that much
state to deal with. It basically comes down to:
- PID of child processes (eg QEMU, dnsmasq, container)
- FDs for STDIN/OUT/ERR of the child processes
- A possible logfile FD
- Flag to indicate whether some objects are active or not
That is more or less it. Anything else is kept in the config files and can
be reloaded at will.
So I was thinking about whether we could provide a simple protocol to allow
each stateful driver to save its state into some location, the daemon could
just 'exec()' itself again, and upon startup the drivers reload their active
state. Since the daemon just exec()'s itself it would still own the child
processes & still have all the neccessary FD's open.
Dan.
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
16 years, 8 months
[Libvir] [RFC] 0 of 4 Linux Container support
by Dave Leskovec
Greetings,
Following are the patches adding linux container support. The first three
patches are updated versions of the original three I posted. They've been
updated for the feedback I've received so far and to include some other recent
libvirt changes. The last patch adds support for starting a container. Still
working on shutdown and destroy but wanted to get the start code out for comments.
The XML format has been updated to this:
<domain type='linuxcontainer'>
<name>TestContainer1</name>
<os>
<init>/home/dlesko/src/dev/lxc/lxc_rcinit</init>
</os>
<memory>65536</memory>
<devices>
<filesystem type='mount'>
<source dir='/home/dlesko/lxc_files/tmp/'/>
<target dir='/tmp/'/>
</filesystem>
<console tty='/dev/ptmx'/>
</devices>
</domain>
All comments and questions are welcome.
--
Best Regards,
Dave Leskovec
IBM Linux Technology Center
Open Virtualization
16 years, 8 months