direct-io.hg

changeset 2198:95d17d8191a5

bitkeeper revision 1.1159.1.40 (411b35dbH9xNYJhiWeq5taj0xdMP2w)

Stop libcurl using http_proxy.
author mjw@wray-m-3.hpl.hp.com
date Thu Aug 12 09:18:19 2004 +0000 (2004-08-12)
parents 443ede9ad110
children f9df1e9a2193
files tools/python/xen/xend/XendMigrate.py tools/xfrd/xen_domain.c
line diff
     1.1 --- a/tools/python/xen/xend/XendMigrate.py	Thu Aug 12 08:36:46 2004 +0000
     1.2 +++ b/tools/python/xen/xend/XendMigrate.py	Thu Aug 12 09:18:19 2004 +0000
     1.3 @@ -389,8 +389,8 @@ class XendMigrate:
     1.4  
     1.5      def session_begin(self, info):
     1.6          self._add_session(info.xid, info)
     1.7 -        mcf = XfrdClientFactory(info)
     1.8 -        reactor.connectTCP('localhost', XFRD_PORT, mcf)
     1.9 +        xcf = XfrdClientFactory(info)
    1.10 +        reactor.connectTCP('localhost', XFRD_PORT, xcf)
    1.11          return info
    1.12      
    1.13      def migrate_begin(self, dom, host, port=XFRD_PORT):
    1.14 @@ -401,6 +401,8 @@ class XendMigrate:
    1.15          @param port: destination port
    1.16          @return: deferred
    1.17          """
    1.18 +        if host in ['localhost', '127.0.0.1']:
    1.19 +            raise XendError('cannot migrate to localhost')
    1.20          # Check dom for existence, not migrating already.
    1.21          # Subscribe to migrate notifications (for updating).
    1.22          xid = self.nextid()
     2.1 --- a/tools/xfrd/xen_domain.c	Thu Aug 12 08:36:46 2004 +0000
     2.2 +++ b/tools/xfrd/xen_domain.c	Thu Aug 12 09:18:19 2004 +0000
     2.3 @@ -142,11 +142,19 @@ static int do_curl_global_init = 1;
     2.4  static CURL *curlinit(void){
     2.5      if(do_curl_global_init){
     2.6          do_curl_global_init = 0;
     2.7 +        // Stop libcurl using the proxy. There's a curl option to
     2.8 +        // set the proxy - but no option to defeat it.
     2.9 +        unsetenv("http_proxy");
    2.10          curl_global_init(CURL_GLOBAL_ALL);
    2.11      }
    2.12      return curl_easy_init();
    2.13  }
    2.14  
    2.15 +int curldebug(CURL *curl, curl_infotype ty, char *buf, size_t buf_n, void *data){
    2.16 +    printf("%*s\n", buf_n, buf);
    2.17 +    return 0;
    2.18 +}
    2.19 +
    2.20  /** Configure a new domain. Talk to xend using libcurl.
    2.21   */
    2.22  int xen_domain_configure(uint32_t dom, char *vmconfig, int vmconfig_n){
    2.23 @@ -195,6 +203,8 @@ int xen_domain_configure(uint32_t dom, c
    2.24          eprintf("> Error adding op field.\n");
    2.25          goto exit;
    2.26      }
    2.27 +    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
    2.28 +    curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curldebug);
    2.29      // No progress meter.
    2.30      //curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
    2.31      // Completely quiet.