[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libvir] Remote patch, 2007/02/19

On Mon, Feb 19, 2007 at 03:30:25PM +0000, Richard W.M. Jones wrote:
> Just for everyone's information.
> http://annexia.org/tmp/libvirt-tls-20070219.patch

Can you split out the internal  virt/network driver API refactoring
to a separate patch so we can apply & test it independantly of the
main remote transport.

In src/remote_internal.c:

+    case trans_unix: {
+        sockname = sockname ? : strdup (LIBVIRTD_UNIX_SOCKET);
+        // 108 is hard-coded into the header files as well.
+#define UNIX_PATH_MAX 108
+        struct sockaddr_un addr;
+        memset (&addr, 0, sizeof addr);
+        addr.sun_family = AF_UNIX;
+        strncpy (addr.sun_path, sockname, UNIX_PATH_MAX);

Should really use  sizeof(addr.sun_path) - while 108 is hardcoded in the
Linux headers, there's no guarentee Solaris hardcodes it to 108 too.

In src/remote_internal.h:

+//#define LIBVIRTD_UNIX_SOCKET "/var/run/libvirtd/socket"
+#define LIBVIRTD_UNIX_SOCKET "/tmp/socket" // Just for testing
+#define LIBVIRTD_CONFIGURATION_FILE "/etc/libvirtd.conf"

Instead of using /var/run and /etc we should pass in the values of the
sysconfdir & localstatedir variables from autoconf. That way, during
testing & development people can run autogen.sh --prefix=$HOME/usr
and these will automatically point to $HOME/usr/var/run/libvirtd
and $HOME/usr/etc/libvirtd.conf  

|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]