[libvirt] [PATCH] Recognize available media in nodedev hal driver
by Cole Robinson
The host device hal driver can't tell when a storage device has media
available, the culprit being an incorrect return value check. The
attached patch fixes this.
Unfortunately the driver also doesn't properly detect media eject and
media inserted hal events. I've been poking at this but it's a more
involved fix.
Thanks,
Cole
15 years, 8 months
[libvirt] [PATCH] Mark defined networks as persistent
by Cole Robinson
We aren't setting the persistent bit when a network is defined, so
'destroy' makes them disappear (though they will reappear later since
their persistent config is never removed).
Attached patch fixes this.
Thanks,
Cole
15 years, 8 months
[libvirt] [PATCH 0/6] Add device assignment related node device methods (v2)
by Mark McLoughlin
Hey,
Okay, here's the patches again with the following changes:
- Pass virConnectPtr to all pciDevice methods
- Read the vendor/product ID from sysfs rather than supplying
it to pciGetDevice()
- Re-factor the Dettach/ReAttach() so that it can be more easily
used with pciback
- Add <hostdev managed='(yes|no)'>
- Dettach and reset managed hostdev devices before starting a
QEMU guest
Cheers,
Mark.
15 years, 8 months
[libvirt] PATCH: Fix DBus thread safety
by Daniel P. Berrange
We are using DBus from multiple threads in libvirtd. We are not calling
dbus_threads_init_default(). Very bad things result. Happy-crashy-daemon
This patch fixes that, and also stops DBus messing around with SIGPIPE and
also stops it calling exit() when the bus disconnects, so we can actually
see the error & continue with life.
Daniel
diff -rup libvirt-0.6.0.orig/qemud/qemud.c libvirt-0.6.0.new/qemud/qemud.c
--- libvirt-0.6.0.orig/qemud/qemud.c 2009-02-18 10:56:34.000000000 +0000
+++ libvirt-0.6.0.new/qemud/qemud.c 2009-02-18 12:52:18.000000000 +0000
@@ -860,6 +860,10 @@ static struct qemud_server *qemudNetwork
if (auth_unix_rw == REMOTE_AUTH_POLKIT ||
auth_unix_ro == REMOTE_AUTH_POLKIT) {
DBusError derr;
+
+ dbus_connection_set_change_sigpipe(FALSE);
+ dbus_threads_init_default();
+
dbus_error_init(&derr);
server->sysbus = dbus_bus_get(DBUS_BUS_SYSTEM, &derr);
if (!(server->sysbus)) {
@@ -868,6 +872,7 @@ static struct qemud_server *qemudNetwork
dbus_error_free(&derr);
goto cleanup;
}
+ dbus_connection_set_exit_on_disconnect(server->sysbus, FALSE);
}
#endif
diff -rup libvirt-0.6.0.orig/src/node_device_hal.c libvirt-0.6.0.new/src/node_device_hal.c
--- libvirt-0.6.0.orig/src/node_device_hal.c 2009-01-16 12:44:22.000000000 +0000
+++ libvirt-0.6.0.new/src/node_device_hal.c 2009-02-18 12:52:48.000000000 +0000
@@ -685,6 +685,9 @@ static int halDeviceMonitorStartup(void)
nodeDeviceLock(driverState);
/* Allocate and initialize a new HAL context */
+ dbus_connection_set_change_sigpipe(FALSE);
+ dbus_threads_init_default();
+
dbus_error_init(&err);
hal_ctx = libhal_ctx_new();
if (hal_ctx == NULL) {
@@ -696,6 +699,8 @@ static int halDeviceMonitorStartup(void)
fprintf(stderr, "%s: dbus_bus_get failed\n", __FUNCTION__);
goto failure;
}
+ dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
+
if (!libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn)) {
fprintf(stderr, "%s: libhal_ctx_set_dbus_connection failed\n",
__FUNCTION__);
--
|: Red Hat, Engineering, London -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 :|
15 years, 8 months
[libvirt] Update on host interface configuration
by David Lutterkort
Hi,
I thought I'd write an update of what I've been doing with the host
interface configuration previously discussed[1]
After talking with Dan Williams, who is working in NetworkManager, it is
clear that the network interface functionality for libvirt is also
useful for NM and would help them with handling system-wide interface
configuration. To accomodate that, I will implement network interface
configuration in a separate library (inspiringly called 'netcf', until
somebody thinks of something catchier) and add public API to libvirt
that will use netcf to do the actual work.
One thorny issue is how libvirt's public API and netcf's public API
relate to each other, especially since both libvirt and netcf use XML
descriptions to describe network interfaces (netcf does that for exactly
the same reasons that libvirt does it, since it will have to deal with
similar stability issues)
For the time being, I am assuming that the two XML descriptions are
identical, with no guarantee that that will always be the case. If and
when we run into a case where libvirt's and netcf's needs diverge, we'll
break that identity. On the implementation side, that means that, for
now, netcf will do all the validation and pass errors back to libvirt.
In more concrete terms, I put up a git repo[2] for netcf. There's hardly
any code in there, the things I'd particularly appreciate
review/feedback on are
* the RelaxNG specification of the interface XML (in
xml/interface.rng) together with examples of such interface
specifications (in tests/interface/)
* the (very rough) sketch of the netcf public API, which should
map almost 1-1 to the public libvirt API in src/netcf.h
I know that the XML schema doesn't cover everything we've discussed in
[1], but I think it's a small enough subset to tackle relatively quickly
and large enough to be useful. So, one of the main things to think about
when looking at the schema is places where the schema would make it hard
to make desirable enhancements in the near future (like Marius' point
about default routes/gateways)
One important point about the model of network config in the schema is
that it is centered around what NM calls a 'connection' (though it's
called 'interface' in the schema): a grouping of the components that
make up the interface the user really cares about (a bridge or a bond)
together with the components subordinate to it (e.g. ethernet interfaces
enslaved to the bridge or bond) It's those groups that netcf deals with,
i.e. if eth0 is enslaved to br0, netcf won't list eth0 as an interface,
but only br0, with eth0 as a subinterface.
For the implementation, netcf will have a separate backend for each
network configuration regime (initscripts for
Fedora/RHEL, /etc/network/interfaces for Debian, ...) - once the
initscripts backend is done, I'd be very grateful for contributions for
the other backends.
To sketch out the initscripts implementation, I wrote two XSL
stylesheets, xml/initscripts-get.xml that goes from interface XML ->
initscripts files (via Augeas) and xml/initscripts-put.xml to go the
other way for querying; I'll use those for the core of the initscripts
backend. Whether other backands can be done in a similar manner is TBD.
David
[1] https://www.redhat.com/archives/libvir-list/2009-January/msg00350.html
[2] http://git.et.redhat.com/?p=netcf.git;a=tree
15 years, 8 months
[libvirt] Problem installing KVM Guest from command line
by aliahsan naqvi
Hi All
>From past many days i am trying to install KVM Guest Machine from command line via virt-install.Below is many command i have testing this on Fedora 9 and fedora 10 but not able to do it.
virt-install -n testing -r 256 -w bridge:virbr0 --location /mnt/Fedora-10-i386-DVD.iso --accelerate --os-type=linux --hvm --nographics -f /var/imgVM1 --force -x "console=ttyS0"
I am installing from HTTP server.After give Network information.Following error comes.i have also tried with NFS and ftp but same result.It seem guest machine not able to get ip address.Because when i ping the ip address of the guest which is provided in Networking setting during guest installation.It was not pingable.And this http server is working fine.i can browse all the install directory with no problem and i have install other machine with the http install directory.
I am getting following error after TCP/IP Manual/ DHCP Configuration
Network Settings
+-----------+ Error +------------+
| |
| Unable to retrieve |
| http://192.168.1.8/fedora |
| /linux/releases/10/Fedora/i38 |
| 6/os//images/install.img. |
| |
| +----+ |
| | OK | |
| +----+ |
| |
| |
+--------------------------------+
Please Advise.Please let me if i am doing some thing wrong or this a bug.
_________________________________________________________________
Windows Live™: Life without walls.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_032009
15 years, 9 months
RE: [libvirt] Help with bridged networking
by Jesus Urroa
Hi,
Thanks all for your help, I installed libvirt 0.6.0-4 and kvm 84-1 from fedora's rawhide and that solved the problem.
However know I have a new problem I tried the other virtual machines and some of them just don't start, they seem to stop when the bios jumps to the disk and grub, any ideas?
The only thing I can think of is to upgrade the host kernel but if I'm not wrong I have to upgrade to Fedora 9 or 10, and I would like to try something else before because I want to have everything running before leaving xen completely
> Subject: RE: [libvirt] Help with bridged networking
> From: lutter(a)redhat.com
> To: observer1(a)hotmail.es
> Date: Fri, 27 Feb 2009 08:48:13 -0800
>
> On Fri, 2009-02-27 at 00:55 +0000, Jesus Urroa wrote:
> > My mistake I see the lines for the ip config commented out in the file
> > and I place them again
> > Anyway I remove the card from the bridge to simplify the problem a
> > little, this the output of brctl show for the bridge using only xen
> > (no libvirt at all) and using kvm with libvirt and running only 2 vms:
> >
> > worknet 8000.feffffffffff no vif1.0
> > vif4.0
> > vif5.0
> > vif6.1
> > vif7.1
> > vif8.0
> >
> > worknet 8000.00ff52959073 no vnet0
> >
> > vnet3
>
> With the non-Xen setup, your bridge should have the same IP address as
> the enslaved NIC.
>
> What exactly is not working ? Can VM's on the same bridge ping each
> other ?
>
> Did you add teh following iptables rule (to forward packages from the
> bridge to the outside):
>
> # echo "-I FORWARD -m physdev --physdev-is-bridged -j ACCEPT" > /etc/sysconfig/iptables-forward-bridged
> # lokkit --custom-rules=ipv4:filter:/etc/sysconfig/iptables-forward-bridged
> # service libvirtd reload
>
> Otherwise, your VM;s can't talk to the outside.
>
> David
>
>
_________________________________________________________________
Anímate y disfruta con los mejores juegos de Messenger, ¡descúbrelos!
http://www.vivelive.com/juegos/
15 years, 9 months
[libvirt] internal error Timed out while reading console log output
by jmandawg
Hi,
I just compiled installed Libvirt from the latest git repo, and for some
reason when I try to start a VM from virsh I get the following error:
virsh # start XPTest
error: Failed to start domain XPTest
error: internal error unable to start guest:
and the corresponding output from libvirtd running in verbose mode:
08:19:53.163: info : Received unexpected signal 17
08:20:00.083: info : Received unexpected signal 17
08:20:00.095: info : Received unexpected signal 17
08:20:03.200: error : internal error Timed out while reading console log
output
libvir: QEMU error : internal error Timed out while reading console log
output
08:20:03.200: error : internal error unable to start guest:
libvir: QEMU error : internal error unable to start guest:
Here is the command virsh is trying to run from the Libvirt log file:
LC_ALL=C
PATH=/usr/bin:/bin:/root/bin:/usr/X11R6/bin:/usr/local/kvm/bin:/usr/local/sb
in:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games HOME=/root
USER=root LOGNAME=root /usr/bin/kvm -S -M pc -m 512 -smp 1 -name XPTest
-uuid 732fcba8-b71f-face-e067-cf8431fc94aa -monitor pty -pidfile
/var/run/libvirt/qemu//XPTest.pid -localtime -no-acpi -boot c -drive
file=/var/kvm-images/XPTest/XP_Test.img,if=ide,index=0,boot=on -net
nic,macaddr=00:0c:29:f6:c4:f8,vlan=0,model=e1000 -net
tap,fd=20,script=,vlan=0,ifname=vnet3 -serial none -parallel none -usb
-usbdevice tablet -vnc 0.0.0.0:9
If I start the VM from the commandline manually using this command and then
shutdown, I can successfully start it from Virsh
qemu-system-x86_64 -no-acpi -m 512 -hda XP_Test.img \
-net nic,macaddr=00:0C:29:F6:C4:F8 \
-net tap \
-usb -usbdevice tablet \
-monitor unix:monitor,server,nowait \
-soundhw all \
-pidfile pid &
virsh # version
Compiled against library: libvir 0.6.0
Using library: libvir 0.6.0
Using API: QEMU 0.6.0
Running hypervisor: QEMU 0.9.1
Any help would be appreciated.
Thanks,
John
15 years, 9 months
[libvirt] [PATCH]: Fix non-live migration failure
by Chris Lalancette
There is a logic error in the Qemu driver when doing a non-live migrate.
During a non-live migrate, on the source host during the Perform step, we
pause the domain; however, if there was ever a failure, we were forgetting
to unpause the domain, meaning that the domain was paused forever. Add a
flag to tell us when we should unpause the domain after a failure.
Also, as pointed out by DV, we were unnecessarily using a snprintf to a
buffer to execute qemu monitor commands, when we could get away with
just sending a static string. Fix that as well.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
15 years, 9 months