[libvirt] Fwd: [PATCH libvirt-site] Add libvirt-php information page
by Michal Novotny
Hi,
I can't see this in the list although I'm having it in my inbox. Maybe
some issue with git-send-email or something so I'm forwarding the
message to make sure it's coming to the list.
Michal
-------- Original Message --------
Subject: [PATCH libvirt-site] Add libvirt-php information page
Date: Tue, 8 Feb 2011 13:33:44 +0100
From: Michal Novotny <minovotn(a)redhat.com>
To: libvir-list(a)redhat.com
CC: Michal Novotny <minovotn(a)redhat.com>
Hi,
this is the patch to add libvirt-php information page with some
basic information on libvirt-php project compilation, contribution
and other useful information.
Michal
Signed-off-by: Michal Novotny<minovotn(a)redhat.com>
---
docs/bindings.html.in | 13 ++++---
docs/php.html.in | 85 +++++++++++++++++++++++++++++++++++++++++++++++++
docs/sitemap.html.in | 4 ++
3 files changed, 96 insertions(+), 6 deletions(-)
create mode 100644 docs/php.html.in
diff --git a/docs/bindings.html.in b/docs/bindings.html.in
index 41114f0..87d894d 100644
--- a/docs/bindings.html.in
+++ b/docs/bindings.html.in
@@ -27,16 +27,17 @@
</li>
<li>
<p>
-<strong>PHP</strong>: Radek Hladik develops
-<a href="http://phplibvirt.cybersales.cz/">PHP bindings</a>.
+<strong>PHP</strong>: Radek Hladik started developing
+<a href="http://phplibvirt.cybersales.cz/">PHP bindings</a> in 2010.
</p>
<p>
- The php-libvirt bindings also have their source online
-<a href="http://github.com/Kedarius/php-libvirt">here in Github</a>.
+ In February 2011 the binding development has been moved to the
+<a href="http://libvirt.org/git/?p=libvirt-php.git;a=summary">libvirt.org as libvirt-php project</a>.
</p>
<p>
- This allows you to easily see the code, make comments on it,
- create your own forks, and contribute the changes back.
+ The project is now maintained by Michal Novotny and it's heavily based
+ on Radek's version. For more information including the information on posting
+ the patches you to libvirt-php please refer to<a href="php.html">PHP binding page</a>.
</p>
</li>
<li>
diff --git a/docs/php.html.in b/docs/php.html.in
new file mode 100644
index 0000000..ea4f76a
--- /dev/null
+++ b/docs/php.html.in
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<html>
+<body>
+<h1>PHP API bindings</h1>
+
+<h2>Presentation</h2>
+<p>The libvirt-php, originally called php-libvirt, is the PHP API bindings for
+ the libvirt virtualization toolkit originally developed by Radek Hladik but
+ currently maintained by Red Hat.</p>
+
+<h2>Getting the source</h2>
+<p> The PHP bindings code source is now maintained in a<a
+href="http://git-scm.com/">git</a> repository available on
+<a href="http://libvirt.org/git/">libvirt.org</a>:
+</p>
+<pre>
+git clone git://libvirt.org/libvirt-php.git
+</pre>
+<p>
+It can also be browsed at
+</p>
+<pre>
+<a href="http://libvirt.org/git/?p=libvirt-php.git;a=summary">http://libvirt.org/git/?p=libvirt-php.git;a=summary</a>
+</pre>
+
+<p></p>
+<h2>Building</h2>
+<p>The code is using autotools to generate the files necessary for compilation. The preferred way of building is
+ to run autogen.sh to generate configure script and then go on with the standard linux make commands, i.e.</p>
+
+<pre>
+$ cd libvirt-php
+$ ./autogen.sh
+$ make
+</pre>
+
+
+<h2>Enabling the module in PHP</h2>
+<p>Before you start using the module you have to install the module first. The module
+php_libvirt.so is being generated when you compile it. This is necessary to be loaded
+in the extensions sections of php.ini file for PHP version older than PHP-5.</p>
+<p>
+Starting with PHP-5 you can create a file called libvirt.ini in /etc/php.d having just
+one line<code>extension=php_libvirt.so</code> to enable the extension. Of course, you
+need to have this module copied in the directory with the rest of your PHP modules to
+make PHP find the module for you.</p>
+<p>
+If you're using PHP as a module (mod_php5.so) in the Apache webserver you need to
+restart your Apache to trigger configuration reload for PHP.
+</p>
+<p>
+If you're not sure that you have everything set up right and you don't want to restart
+your Apache webserver before you're sure everything will be working fine you could try
+running the test using cli-based PHP interpreter. There are some example scripts coming
+along the source codes in the<code>example</code> subdirectory so you can try to run
+php on the index.php script to check whether it's working fine to establish connection or not.
+</p>
+<p>
+When you're having some issues with the connection make sure the apache user is having
+access to libvirt. For more information please see<a href="auth.html">Libvirt access control</a> page.
+</p>
+<h2>Contribution</h2>
+<p>
+If you would like to contribute to the libvirt-php project you could write patches for it but please
+make sure you're following the procedure below:
+
+<ol>
+<li>Sign up to libvirt list if you're not on it yet (libvir-list(a)redhat.com)</li>
+<li>Clone the repository from libvirt.org site using:
+<pre>git clone git://libvirt.org/libvirt-php</pre>
+</li>
+<li>Set your git username and e-mail and also set the subject prefix in the project's repository using:
+<pre>git config --local format.subjectprefix "libvirt-php"</pre>
+</li>
+<li>Create the patch in the form of the commits and include also information about usage (example source codes maybe) and testing</li>
+<li>Format it using<code>git format-patch -X</code> where X is the number of patch parts to be posted, for multipart patch (X is greater than 1) please use also numbering (-n) option and include the cover-letter (--cover-letter).</li>
+<li>Send to libvir-list(a)redhat.com using the<code>git send-email<files> --to libvir-list(a)redhat.com</code> command where<files> can be<i>000*</i> to send all the patches formatted by git format-patch since git format-patch names the files starting with the 4 digit numbers.</li>
+</ol>
+
+When you send the patch you're patch will be reviewed and later committed to the libvirt-php repository. You'll be contacted in case some flaws are found during the review.
+
+</p>
+
+</body>
+</html>
diff --git a/docs/sitemap.html.in b/docs/sitemap.html.in
index c987c49..ac0af71 100644
--- a/docs/sitemap.html.in
+++ b/docs/sitemap.html.in
@@ -266,6 +266,10 @@
<a href="csharp.html">C#</a>
<span>overview of the C# API bindings</span>
</li>
+<li>
+<a href="php.html">PHP</a>
+<span>overview of the PHP API bindings</span>
+</li>
</ul>
</li>
<li>
--
1.7.3.2
13 years, 8 months
Re: [libvirt] [Qemu-devel] [PATCH 00/16] usb-ccid (v18)
by Eric Blake
[adding libvir-list as well]
On 02/07/2011 08:44 AM, Alon Levy wrote:
>>> I guess I'll wait a little longer for more feedback? Should I split
>>> the enum property separately? it's only used by ccid-card-emualted atm.
>>
>> The only non-cosmetic concern I have about your series is the enum
>> property so I would strongly suggest splitting it. If you did that
>> for v19, it will be pretty close to merge ready.
>>
>
> Eric,
>
> How does this affect libvirt? could you assume a default set of backends
> if "-device ccid-card-emulated,?" returns "backend=string" instead of
> "backend=A/B" ?
Hmm. At the moment, libvirt only looks for "ccid-card-emulated" in the
-device ? list, and hasn't yet tried inspecting -device
ccid-card-emulated,? output. In short, libvirt assumes that the
presence of ccid-card-emulated implies that both modes are available
(libvirt's <smartcard mode='host'/> => backend=nss-emulated; <smartcard
mode='host-certificates' => backend=certificates). Is it possible for
qemu to have support for one, but not both, of those modes? If that's
the case, then supporting "backend=nss-emulated/certificates" in -device
ccid-card-emulated,? would be handy for libvirt (for example, it would
be just "backend=certificates" if nss-emulated is not available). But
if it's an all-or-none approach (all backends are available if
ccid-card-emulated is present), then libvirt's current code won't be
impacted by changing the string to the simpler "backend=string".
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
13 years, 8 months
[libvirt] draft ~ l10n/i18n
by Zdenek Styblik
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
this is a draft of libvirt l10n/i18n translator's how-to. It is nowhere
definite and it actually is meant ...
It's practically summarized what we've talked about in last couple days.
~~~ DRAFT ~~~
# How-to libvirt l10n/i18n
We are glad you've decided to help with
localization/internationalization of libvirt. Before you do anything
else, stop!
Please, pay attention to following lines to save yourself from eventual
pitfalls.
'.po' files located in this directory are synchronized from Fedora
Project[https://translate.fedoraproject.org/projects/p/libvirt/], thus
it makes little sense to start translating them.
Here are two ways how you can translate and contribute:
## Optimal way
1st step: Create a "Fedora Project" account:
https://admin.fedoraproject.org/accounts/
(New Account, etc)
2nd step: Sign in to the libvirt transifex project
https://translate.fedoraproject.org/projects/p/libvirt/
It uses the just created Fedora Project account
3rd step: "Request to be a translator"
Once you've signed in with step 3, there's a button under the
"Translation files" heading that says something like "Request to
become a translator". Press that.
This is going to take some time.
4th step: Download '.po' file
'.po' file can be downloaded at
https://translate.fedoraproject.org/projects/p/libvirt/
5th step: Translate
See translator's tools section.
6th step: Upload translated file
!!! This point is still a mystery !!!
Upload modified file via web interface.
## Alternate way
If for some reason you don't want to or can't register at Fedora
Project, you still can translate and contribute to libvirt.
1st step: Get '.po' file
Download '.po' file from
https://translate.fedoraproject.org/projects/p/libvirt/ with language
you're going to translate to.
Make a backup copy of it
2nd step: Translate
See translator's tools section.
3rd step: Make a diff
Make a % diff; of the original file and the one you've translated.
eg. % diff -urN lang.po.org lang.po > lang.po.patch;
Send patch file back to mailing-list and somebody from the team
is going to push it at Fedora Project.
Why diff? Because it's easier to validate the work you've done,
solve eventual conflicts etc.
However, this approach has its downsides. First is it brings more
workload to libvirt team, second is '.po' file can change in the
meantime, because you are not able to "lock it" while you're working at
translations.
## Translator's tools
* KAider KDE4 ~ seems to be dead
* gtranslator ~ http://projects.gnome.org/gtranslator/
* poedit ~ http://www.poedit.net/
In case '.po' file in upstream got changed and you need to sync your
current work with upstream, you can try your luck with tool written in
Perl > http://www.zeratul.org/git/?p=scripts/perl/po-sync/.git;a=summary
~~~ DRAFT ~~~
Have a nice weekend,
Z.
- --
Zdenek Styblik
Net/Linux admin
OS TurnovFree.net
email: stybla(a)turnovfree.net
jabber: stybla(a)jabber.turnovfree.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk1DFJ4ACgkQ8MreUbSH7inLvQCeOg3CXKgxkdMz8EKlgQL8hSqK
F6gAoI2LbWBPL2WQir0tW2wEjm5NeSlr
=/2qM
-----END PGP SIGNATURE-----
13 years, 8 months
[libvirt] [PATCH] Support SCSI RAID type & lower log level for unknown types
by Daniel P. Berrange
The Linux kernel headers don't have a value for SCSI type 12,
but HAL source code shows this to be a 'raid'. Add workaround
for this type. Lower log level for unknown types since
this is not a fatal error condition. Include the device sysfs
path in the log output to allow identification of which device
has problems.
* src/node_device/node_device_udev.c: Add SCSI RAID type
---
src/node_device/node_device_udev.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 2da5529..93390af 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -41,6 +41,10 @@
#define VIR_FROM_THIS VIR_FROM_NODEDEV
+#ifndef TYPE_RAID
+# define TYPE_RAID 12
+#endif
+
struct _udevPrivate {
struct udev_monitor *udev_monitor;
int watch;
@@ -693,7 +697,8 @@ out:
}
-static int udevGetSCSIType(unsigned int type, char **typestring)
+static int udevGetSCSIType(virNodeDeviceDefPtr def,
+ unsigned int type, char **typestring)
{
int ret = 0;
int foundtype = 1;
@@ -728,6 +733,9 @@ static int udevGetSCSIType(unsigned int type, char **typestring)
case TYPE_ENCLOSURE:
*typestring = strdup("enclosure");
break;
+ case TYPE_RAID:
+ *typestring = strdup("raid");
+ break;
case TYPE_NO_LUN:
default:
foundtype = 0;
@@ -739,7 +747,8 @@ static int udevGetSCSIType(unsigned int type, char **typestring)
ret = -1;
virReportOOMError();
} else {
- VIR_ERROR(_("Failed to find SCSI device type %d"), type);
+ VIR_DEBUG("Failed to find SCSI device type %d for %s",
+ type, def->sysfs_path);
}
}
@@ -784,7 +793,7 @@ static int udevProcessSCSIDevice(struct udev_device *device ATTRIBUTE_UNUSED,
switch (udevGetUintSysfsAttr(device, "type", &tmp, 0)) {
case PROPERTY_FOUND:
- if (udevGetSCSIType(tmp, &data->scsi.type) == -1) {
+ if (udevGetSCSIType(def, tmp, &data->scsi.type) == -1) {
goto out;
}
break;
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] Only initialize/cleanup libpciaccess once
by Daniel P. Berrange
libpciaccess has many bugs in its pci_system_init/cleanup
functions that makes calling them multiple times unwise.
eg it will double close() FDs, and leak other FDs.
* src/node_device/node_device_udev.c: Only initialize
libpciaccess once
---
src/node_device/node_device_udev.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 379af86..2da5529 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -363,18 +363,10 @@ static int udevTranslatePCIIds(unsigned int vendor,
char **vendor_string,
char **product_string)
{
- int ret = -1, pciret;
+ int ret = -1;
struct pci_id_match m;
const char *vendor_name = NULL, *device_name = NULL;
- if ((pciret = pci_system_init()) != 0) {
- char ebuf[256];
- VIR_INFO("Failed to initialize libpciaccess: %s",
- virStrerror(pciret, ebuf, sizeof ebuf));
- ret = 0;
- goto out;
- }
-
m.vendor_id = vendor;
m.device_id = product;
m.subvendor_id = PCI_MATCH_ANY;
@@ -406,9 +398,6 @@ static int udevTranslatePCIIds(unsigned int vendor,
}
}
- /* pci_system_cleanup returns void */
- pci_system_cleanup();
-
ret = 0;
out:
@@ -1426,6 +1415,9 @@ static int udevDeviceMonitorShutdown(void)
ret = -1;
}
+ /* pci_system_cleanup returns void */
+ pci_system_cleanup();
+
return ret;
}
@@ -1593,6 +1585,15 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
udevPrivate *priv = NULL;
struct udev *udev = NULL;
int ret = 0;
+ int pciret;
+
+ if ((pciret = pci_system_init()) != 0) {
+ char ebuf[256];
+ VIR_INFO("Failed to initialize libpciaccess: %s",
+ virStrerror(pciret, ebuf, sizeof ebuf));
+ ret = -1;
+ goto out;
+ }
if (VIR_ALLOC(priv) < 0) {
virReportOOMError();
--
1.7.4
13 years, 8 months
Re: [libvirt] Vietnamese Translation for libvirt
by Hero Phương
>Is it ok with you, if we ask the other translation people how
>they get around this problem? :)
Because I use Ubuntu and I don't use the libvirt package very often (because
I like the GUI of VirtualBox more). If there's any luck that I can see a
wrong translation string, I'll fix it immediately. Other than that I can't
do anything else. :(
2011/2/7 Justin Clift <jclift(a)redhat.com>
> On 08/02/2011, at 12:26 AM, Hero Phương wrote:
> > The only and biggest problem is that I can not access all the
> > feature (because of limited ability) in libvirt so I can not
> > see the whole context for all string.
>
> Yeah, I can see how that would be a problem.
>
> Is it ok with you, if we ask the other translation people how
> they get around this problem? :)
>
> Regards and best wishes,
>
> Justin Clift
>
13 years, 8 months
Re: [libvirt] Vietnamese Translation for libvirt
by Hero Phương
The only and biggest problem is that I can not access all the feature
(because of limited ability) in libvirt so I can not see the whole context
for all string.
2011/2/7 Justin Clift <jclift(a)redhat.com>
> On 07/02/2011, at 11:36 PM, Hero Phương wrote:
> > It's good to do the translation work. So if I can do anything, I will do
> my best to complete it.
> > Then, I am very happy to hear the instruction from you.
>
> Cool. :)
>
> The Fedora Translation team have a "Quick Start Guide" here, with
> instructions
> in it:
>
>
> http://docs.fedoraproject.org/en-US/Fedora_Contributor_Documentation/1/ht...
>
> By the way, did you mean to reply to only me, rather than the two
> translation
> team guys CC'd on the previous email? They would be useful for you to be
> in contact with. :)
>
> Regards and best wishes,
>
> Justin Clift
>
13 years, 8 months
[libvirt] fork of php-libvirt
by Lyre
I've added many APIs to php-libvirt, including network, node device,
interface, and snapshot support.
Unfortunately, I wasn't able to contact original author Radek, I really hope
he can see this.
So I forked it, the address is: https://github.com/4179e1/php-libvirt
But there's something undone, as a new php extension writer, I don't know
how the documents are generated. Any clues are appreciated.
BTW, I've pack php-libvirt into rpm via opensuse build service, currently:
it's ready on openSuSE 11.3 & SLES 11 SP1; fedora 14 should works too (it
works on my VM), but the obs environment is not ready yet; and there's
something need to workaround on rhel6. check here:
http://download.opensuse.org/repositories/home:/midmay/
13 years, 8 months