qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] patch for smb/user-net with no network
@ 2004-12-27 16:28 Laurent Amon
  0 siblings, 0 replies; only message in thread
From: Laurent Amon @ 2004-12-27 16:28 UTC (permalink / raw)
  To: qemu-devel

[-- 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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-27 18:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-27 16:28 [Qemu-devel] patch for smb/user-net with no network Laurent Amon

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).