qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Amon <amon@cs.stanford.edu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] patch for smb/user-net with no network
Date: Mon, 27 Dec 2004 17:28:39 +0100	[thread overview]
Message-ID: <5D98DB16-5824-11D9-B8FF-00039307264A@cs.stanford.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

Hi,

On OSX, I use user-net and qemu does not start when I am not connected 
to the network unless you do specify -nics 0. It exits when it does not 
find a DNS.

However, I use my SAMBA service to mount host partitions, so I would 
like to have the network start.

This patch sets the DNS to the local address when none is found so I 
can still use the net when host is not on the network.

Rgds,


[-- Attachment #2: nodns.diff --]
[-- Type: application/octet-stream, Size: 1141 bytes --]

*** qemu-snapshot-2004-12-22_23/slirp/slirp.c	Fri Oct  8 01:27:35 2004
--- qemu-snapshot-2004-12-22_23-patched/slirp/slirp.c	Mon Dec 27 17:18:29 2004
***************
*** 86,94 ****
      struct in_addr tmp_addr;
      
      f = fopen("/etc/resolv.conf", "r");
!     if (!f)
!         return -1;
! 
      lprint("IP address of your DNS(s): ");
      while (fgets(buff, 512, f) != NULL) {
          if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
--- 86,96 ----
      struct in_addr tmp_addr;
      
      f = fopen("/etc/resolv.conf", "r");
!     if (!f){
!         //return -1;
!         tmp_addr = our_addr;
! 		  *pdns_addr = tmp_addr;
! 	  }else{
      lprint("IP address of your DNS(s): ");
      while (fgets(buff, 512, f) != NULL) {
          if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
***************
*** 109,116 ****
          }
      }
      fclose(f);
!     if (!found)
!         return -1;
      return 0;
  }
  
--- 111,122 ----
          }
      }
      fclose(f);
! 	}
!     if (!found){
!         //return -1;
!         tmp_addr = our_addr;
! 		  *pdns_addr = tmp_addr;
! 	  }
      return 0;
  }
  

[-- Attachment #3: Type: text/plain, Size: 6 bytes --]



Lga.

                 reply	other threads:[~2004-12-27 18:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D98DB16-5824-11D9-B8FF-00039307264A@cs.stanford.edu \
    --to=amon@cs.stanford.edu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).